Open roughhawkbit opened 11 years ago
As far as I can tell, the reason move()
is called at the beginning of the method is to perform movement due to the current agent of interest being a neighbour of any other agents in previous iterations of the loop in which interact
is called (ie it's _movement
vector may be non-zero at the start of the method), this will ensure the potential shovers found are for the new location. Then the second move()
call will be for movement due to the new neighbours.
However this leads to a potential bug if seq
is false and the desired behaviour is keep the agents stationary until the end of the step, and the first move()
call will counter this.
But this is currently avoided in the code by hardcoding seq=true
in the only place interact
is called on line 590 of AgentContainer.java:
performMove(shoveOnly, false, 1);
where the false
is not-ted when interact
is called.
Issue #36 may be related to this.
It's worth pointing out that AgentContainer.performMove(pushOnly, isSynchro, gain)
is only ever called by AgentContainer.shoveAllLocated(fullRelax, shoveOnly, maxShoveIter, gainMin, gainMax)
, which always sets isSynchro
to false (line 590). This means that seq
in LocatedAgent.interact(MUTUAL, shoveOnly, seq, gain)
is always true, and so move()
is always called twice
As it currently stands:
Issues:
if (_isAttached&!shoveOnly) {}
was intended for but it no longer does anything.