Skip to content

getSignalDensityAlongAxis and getPopulationDensityAlongAxis assertions #90

Description

@MrSlinkyman

I saw in a previous issue where these two assertions were added. I'm curious, however, if the program asserts that the direction is not CENTER, how do you prevent creatures from actually using that direction when these sensors are called?

assert(dir != Compass::CENTER); // require a defined axis

assert(dir != Compass::CENTER); // require a defined axis

In the getSensor() call I would imagine that the creatures would have a last move direction as CENTER just by chance.

sensorVal = getPopulationDensityAlongAxis(loc, lastMoveDir);

In my implementation in Java, these assertions are preventing the program from moving forward so I changed them to early returns where the method just returns 0.5 if the direction supplied is CENTER. But I am not sure if that is the right interpretation.

Would love some insight.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions