fpmas 1.6
Public Member Functions | List of all members
fpmas::model::SpatialModel< SyncMode, CellType, EndCondition > Class Template Reference

#include <spatial_model.h>

Inheritance diagram for fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >:
Collaboration graph
[legend]

Public Member Functions

void add (CellType *cell) override
 
std::vector< CellType * > cells () override
 
fpmas::api::model::AgentGroupcellGroup () override
 
const fpmas::api::model::AgentGroupcellGroup () const override
 
MoveAgentGroup< CellType > & buildMoveGroup (api::model::GroupId id, const api::model::Behavior &behavior) override
 
- Public Member Functions inherited from fpmas::api::model::SpatialModel< api::model::Cell >
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
 
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
 
- Public Member Functions inherited from fpmas::model::detail::DefaultModel< SyncMode >
 DefaultModel ()
 
 DefaultModel (api::graph::LoadBalancing< AgentPtr > &load_balancing)
 
 DefaultModel (api::scheduler::Scheduler &scheduler, api::runtime::Runtime &runtime, api::graph::LoadBalancing< AgentPtr > &load_balancing)
 
- Public Member Functions inherited from fpmas::model::detail::Model
 Model (api::model::AgentGraph &graph, api::scheduler::Scheduler &scheduler, api::runtime::Runtime &runtime, api::model::LoadBalancing &load_balancing)
 
 Model (const Model &)=delete
 
 Model (Model &&)=delete
 
Modeloperator= (const Model &)=delete
 
Modeloperator= (Model &&)=delete
 
api::model::AgentGraphgraph () override
 
const api::model::AgentGraphgraph () const override
 
api::scheduler::Schedulerscheduler () override
 
const api::scheduler::Schedulerscheduler () const override
 
api::runtime::Runtimeruntime () override
 
const api::runtime::Runtimeruntime () const override
 
const scheduler::JobloadBalancingJob () const override
 
api::model::AgentGroupbuildGroup (api::model::GroupId id) override
 
api::model::AgentGroupbuildGroup (api::model::GroupId id, const api::model::Behavior &behavior) override
 
void removeGroup (api::model::AgentGroup &group) override
 
api::model::AgentGroupgetGroup (api::model::GroupId id) const override
 
const std::unordered_map< GroupId, api::model::AgentGroup * > & groups () const override
 
AgentEdge * link (api::model::Agent *src_agent, api::model::Agent *tgt_agent, api::graph::LayerId layer) override
 
void unlink (api::model::AgentEdge *edge) override
 
api::communication::MpiCommunicatorgetMpiCommunicator () override
 
const api::communication::MpiCommunicatorgetMpiCommunicator () const override
 
void clear () override
 

Additional Inherited Members

- Public Types inherited from fpmas::api::model::SpatialModel< api::model::Cell >
typedef api::model::Cell CellType
 
virtual void insert (GroupId id, AgentGroup *group)=0
 
- Protected Member Functions inherited from fpmas::model::detail::Model
void insert (api::model::GroupId id, api::model::AgentGroup *group) override
 

Detailed Description

template<template< typename > class SyncMode, typename CellType = api::model::Cell, typename EndCondition = DynamicEndCondition<CellType>>
class fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >

api::model::SpatialModel implementation.

Template Parameters
SyncModeSynchronization Mode (see fpmas::synchro)
CellTypeCell type on which SpatialAgents are moving. The specified type might be abstract.
EndConditionDistributedMoveAlgorithm end condition. Uses DynamicEndCondition by default.

Member Function Documentation

◆ add()

template<template< typename > class SyncMode, typename CellType , typename EndCondition >
void fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >::add ( CellType cell)
override

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<template< typename > class SyncMode, typename CellType , typename EndCondition >
std::vector< CellType * > fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >::cells
overridevirtual

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

Implements fpmas::api::model::SpatialModel< api::model::Cell >.

◆ cellGroup() [1/2]

template<template< typename > class SyncMode, typename CellType , typename EndCondition >
fpmas::api::model::AgentGroup & fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >::cellGroup
overridevirtual

Returns the AgentGroup containing all Cells in the current SpatialModel.

Returns
cell group

Implements fpmas::api::model::SpatialModel< api::model::Cell >.

◆ cellGroup() [2/2]

template<template< typename > class SyncMode, typename CellType , typename EndCondition >
const fpmas::api::model::AgentGroup & fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >::cellGroup
overridevirtual

Returns the AgentGroup containing all Cells in the current SpatialModel.

Returns
cell group

Implements fpmas::api::model::SpatialModel< api::model::Cell >.

◆ buildMoveGroup()

template<template< typename > class SyncMode, typename CellType , typename EndCondition >
MoveAgentGroup< CellType > & fpmas::model::SpatialModel< SyncMode, CellType, EndCondition >::buildMoveGroup ( api::model::GroupId  id,
const api::model::Behavior behavior 
)
overridevirtual

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

Implements fpmas::api::model::SpatialModel< api::model::Cell >.


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