fpmas 1.6
Public Types | Public Member Functions | List of all members
fpmas::api::model::SpatialModel< _CellType > Class Template Referenceabstract

#include <spatial_model.h>

Inheritance diagram for fpmas::api::model::SpatialModel< _CellType >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::api::model::SpatialModel< _CellType >:
Collaboration graph
[legend]

Public Types

typedef _CellType CellType
 

Public Member Functions

virtual void add (CellType *cell)=0
 
virtual std::vector< CellType * > cells ()=0
 
virtual AgentGroupcellGroup ()=0
 
virtual const AgentGroupcellGroup () const =0
 
virtual MoveAgentGroup< CellType > & buildMoveGroup (GroupId id, const Behavior &behavior)=0
 
- Public Member Functions inherited from fpmas::api::model::Model
virtual AgentGraphgraph ()=0
 
virtual const AgentGraphgraph () const =0
 
virtual api::scheduler::Schedulerscheduler ()=0
 
virtual const api::scheduler::Schedulerscheduler () const =0
 
virtual api::runtime::Runtimeruntime ()=0
 
virtual const api::runtime::Runtimeruntime () const =0
 
virtual const api::scheduler::JobloadBalancingJob () const =0
 
virtual AgentGroupbuildGroup (GroupId id)=0
 
virtual AgentGroupbuildGroup (GroupId id, const Behavior &behavior)=0
 
virtual void removeGroup (AgentGroup &group)=0
 
virtual AgentGroupgetGroup (GroupId id) const =0
 
virtual const std::unordered_map< GroupId, AgentGroup * > & groups () const =0
 
virtual AgentEdgelink (Agent *src_agent, Agent *tgt_agent, api::graph::LayerId layer)=0
 
virtual void unlink (AgentEdge *edge)=0
 
virtual api::communication::MpiCommunicatorgetMpiCommunicator ()=0
 
virtual const api::communication::MpiCommunicatorgetMpiCommunicator () const =0
 
virtual void clear ()=0
 

Additional Inherited Members

- Protected Member Functions inherited from fpmas::api::model::Model
virtual void insert (GroupId id, AgentGroup *group)=0
 

Detailed Description

template<typename _CellType>
class fpmas::api::model::SpatialModel< _CellType >

Model API extension to handle SpatialAgents.

Member Typedef Documentation

◆ CellType

template<typename _CellType >
typedef _CellType fpmas::api::model::SpatialModel< _CellType >::CellType

Type of Cell on which SpatialAgents are moving.

Member Function Documentation

◆ add()

template<typename _CellType >
virtual void fpmas::api::model::SpatialModel< _CellType >::add ( CellType cell)
pure virtual

Adds a Cell to this model.

Cells added to the model constitute the "Cell network", on which SpatialAgents, added to groups created with buildMoveGroup(), will be able to move.

Parameters
cellcell to add to the model

◆ cells()

template<typename _CellType >
virtual std::vector< CellType * > fpmas::api::model::SpatialModel< _CellType >::cells ( )
pure virtual

Returns the list of LOCAL cells on the current process.

Such Cells have necessarily been added to the model using add(), but might have migrate across processes during load-balancing operations.

Returns
local Cells list

Implemented in fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >.

◆ cellGroup() [1/2]

template<typename _CellType >
virtual AgentGroup & fpmas::api::model::SpatialModel< _CellType >::cellGroup ( )
pure virtual

Returns the AgentGroup containing all Cells in the current SpatialModel.

Returns
cell group

Implemented in fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >.

◆ cellGroup() [2/2]

template<typename _CellType >
virtual const AgentGroup & fpmas::api::model::SpatialModel< _CellType >::cellGroup ( ) const
pure virtual

Returns the AgentGroup containing all Cells in the current SpatialModel.

Returns
cell group

Implemented in fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >.

◆ buildMoveGroup()

template<typename _CellType >
virtual MoveAgentGroup< CellType > & fpmas::api::model::SpatialModel< _CellType >::buildMoveGroup ( GroupId  id,
const Behavior behavior 
)
pure virtual

Builds an agent group that automatically includes the DistributedMoveAlgorithm execution.

The specified behavior is assumed to include some SpatialAgent::moveTo() operations, even if it's not required. Contrary to the Model::buildGroup() method, the returned group is such that in addition to the execution of the behavior for each agent of the group, the AgentGroup::jobs() list also includes the DistributedMoveAlgorithm::jobs() list, built properly from cells() in the model and agents contained in the AgentGroup.

Parameters
idunique group id
behavioragent behavior
Returns
an AgentGroup such that AgentGroup::jobs() is suitable for the execution and commitment of SpatialAgent::moveTo() operations

Implemented in fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >.


The documentation for this class was generated from the following file: