![]() |
fpmas 1.6
|
#include <spatial_model.h>
Protected Member Functions | |
void | moveTo (CellType *cell) override |
![]() | |
void | updateLocation (api::model::Cell *cell) |
void | handleNewMove () override |
void | handleNewPerceive () override |
void | moveTo (DistributedId id) override |
Neighbors< api::model::Cell > | mobilityField () const |
Neighbors< NeighborType > | perceptions () const |
![]() | |
virtual void | moveTo (DistributedId id)=0 |
virtual void | moveTo (Cell *cell)=0 |
SpatialAgent that can be used in an arbitrary graph environment.
AgentType | final SpatialAgent type (i.e. most derived class from this SpatialAgent) |
CellType | type of cells on which the agent moves |
Derived | direct derived class, or at least the next class in the serialization chain |
|
inlineoverrideprotected |
Moves to the input Cell.
The input Cell is not required to be contained in the current mobility field of this SpatialAgent, what allows:
The execution of a DistributedMoveAlgorithm is required to commit the operation and update mobility fields and perceptions. However, this can be handled automatically on specific AgentGroups: see SpatialModel::buildMoveGroup().
More precisely, the current location, if defined, is unlinked, and so does the mobility field and perceptions, and a link from this SpatialAgent to cell
is created on the NEW_LOCATION
layer. In consequence, the behavior of locationCell() is undefined until a DistributedMoveAlgorithm is executed.
Notice that performing an other moveTo() operation before the previous is committed produces an undefined behavior.
cell | cell to which this SpatialAgent should move. |