davidrmiller / biosim4

Biological evolution simulator
Other
3.1k stars 435 forks source link

Circle Challenge #102

Closed ayuzzh closed 1 month ago

ayuzzh commented 1 month ago

It seems that the CHALLENGE_CIRCLE is supposed to select the population that is in the middle of the area. However, the population is evolving to move towards the lower left part of the world instead.

Even if they can't evolve to move to the center due to their brain capacity, why are they only moving towards the lower left part?

davidrmiller commented 1 month ago

Hi @ayuzzh, the circle's center and radius are defined at lines 22 and 23 in src/survival-criteria.cpp. It looks like the default code places the center in the lower left quadrant of the arena, but you can change that:

// Survivors are those inside the circular area defined by
// safeCenter and radius
case CHALLENGE_CIRCLE:
    {
        Coord safeCenter { (int16_t)(p.sizeX / 4.0), (int16_t)(p.sizeY / 4.0) };
        float radius = p.sizeX / 4.0;