What dose this function mean and what is the differentes ?

1 Ansicht (letzte 30 Tage)
Diyara Rashid
Diyara Rashid am 20 Okt. 2021
Kommentiert: DAL am 21 Okt. 2021
function u = heuristic0(B)
u = sum(B(:) == 0); %the number of bricks that are zero
end
function u = heuristic1(B)
u = - sum(B(:)); %the negative sum of the values of the bricks
%(remember they are in logarithm, so its not
% the original values being summed)
end
  1 Kommentar
DAL
DAL am 21 Okt. 2021
How would I explain the heuristic function if i combine both of these together?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 20 Okt. 2021
Bearbeitet: Matt J am 20 Okt. 2021
The first is calculating the number of zeros in B and the second is summing all values in B (times -1).
  6 Kommentare
Matt J
Matt J am 21 Okt. 2021
That's -N wher N is the number of B(i) that equal 1.
DAL
DAL am 21 Okt. 2021
wherest the N is the tiles?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Card games finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by