![]() |
fpmas 1.6
|
#include <dist_move_algo.h>
Public Member Functions | |
void | init (api::communication::MpiCommunicator &comm, std::vector< api::model::SpatialAgent< CellType > * > agents, std::vector< CellType * >) override |
void | step () override |
bool | end () override |
![]() | |
virtual void | init (api::communication::MpiCommunicator &comm, std::vector< api::model::SpatialAgent< CellType > * > agents, std::vector< CellType * > cells)=0 |
virtual void | step ()=0 |
virtual bool | end ()=0 |
Implements a dynamic api::model::EndCondition for the DistributedMoveAlgorithm.
The required number of steps that must be performed by the DistributedMoveAlgorithm is determined at runtime, at each initialization of the end condition. To do so, an algorithm determines the current maximum radius of mobility and perception ranges of all SpatialAgents in the simulation (more particularly, those provided to the init() method). In consequence, inter-processes communications occur to globally determine the maximum.
This EndCondition might be less efficient than the StaticEndCondition. However, it allows mobility and perception ranges of each SpatialAgent to evolve dynamically at runtime, without any restriction. Moreover, the computed number of steps is always optimized, and exactly corresponds to the minimal number of steps required by the DistributedMoveAlgorithm to properly update SpatialAgent locations.
|
inlineoverride |
Initializes the end condition, computing the requied number of steps from the current perception and mobility ranges of all agents
on all processes.
comm | MPI communicator |
agents | moving agents |
|
inlineoverridevirtual |
Advances the end condition.
Implements fpmas::api::model::EndCondition< CellType >.
|
inlineoverridevirtual |
Returns true if and only if the end condition has been reached.
Implements fpmas::api::model::EndCondition< CellType >.