You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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.
The text was updated successfully, but these errors were encountered:
From a quick look, I think that the lastMoveDir member variable will not be CENTER because it is initialized to Dir::random8() (which can't be CENTER) and modified only in one place in Peeps::drainMoveQueue(). The lastMoveDir member is only modified there if the individual is alive and if the newLoc grid location is empty, which prevents it from being set on the CENTER location which is where the individual resides.
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?
biosim4/src/getSensor.cpp
Line 22 in 33d6832
biosim4/src/getSensor.cpp
Line 120 in 33d6832
In the getSensor() call I would imagine that the creatures would have a last move direction as CENTER just by chance.
biosim4/src/getSensor.cpp
Line 311 in 33d6832
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.
The text was updated successfully, but these errors were encountered: