ericmedvet / jgea

Apache License 2.0
19 stars 11 forks source link

MapElites descriptors bug #54

Closed FrancescoRusin closed 2 months ago

FrancescoRusin commented 4 months ago

The MapElites Descriptor method "coordinate" returns incorrect values for the values that should fall into the border bins.

ericmedvet commented 2 months ago

Can you be more specific? Maybe giving an example of a wrong computation. Thanks.

FrancescoRusin commented 2 months ago

The code suggests that the number of bins varies from 0 to nOfBins - 1, as by construction no individual can be classified over these extremes. However, taken for example a descriptor with any function with values in [0,1], with min = 0, max = 1 and nOfBins = 10, if the function returns 0.05 for an individual, it is expected that the descriptor classifies the individual in the bin 0, but the actual computation is:

min(max(0, ceil(0.05 / 1 * 10)), 9)

But as ceil(0.05 / 1 * 10) = ceil(0.5) = 1, the individual is classified in the bin 1 instead.

ericmedvet commented 2 months ago

Fixed in 5366b8a.