fpmas 1.6
Public Member Functions | List of all members
fpmas::model::MoveAgentGroup< CellType > Class Template Reference

#include <spatial_model.h>

Inheritance diagram for fpmas::model::MoveAgentGroup< CellType >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::model::MoveAgentGroup< CellType >:
Collaboration graph
[legend]

Public Member Functions

 MoveAgentGroup (api::model::GroupId group_id, const api::model::Behavior &behavior, api::model::SpatialModel< CellType > &model, api::model::EndCondition< CellType > &end_condition)
 
api::scheduler::JobList jobs () const override
 
api::model::DistributedMoveAlgorithm< CellType > & distributedMoveAlgorithm () override
 
virtual DistributedMoveAlgorithm< CellType > & distributedMoveAlgorithm ()=0
 
virtual GroupId groupId () const =0
 
virtual const Behaviorbehavior ()=0
 
virtual void add (Agent *agent)=0
 
virtual void remove (Agent *agent)=0
 
virtual void clear ()=0
 
virtual void insert (AgentPtr *agent)=0
 
virtual void erase (AgentPtr *agent)=0
 
virtual std::vector< Agent * > agents () const =0
 
virtual std::vector< Agent * > localAgents () const =0
 
virtual std::vector< Agent * > distantAgents () const =0
 
virtual api::scheduler::Jobjob ()=0
 
virtual const api::scheduler::Jobjob () const =0
 
virtual api::scheduler::JobagentExecutionJob ()=0
 
virtual const api::scheduler::JobagentExecutionJob () const =0
 
virtual api::scheduler::JobList jobs () const =0
 
virtual void addEventHandler (Event event, api::utils::Callback< Agent * > *callback)=0
 
virtual void removeEventHandler (Event event, api::utils::Callback< Agent * > *callback)=0
 
- Public Member Functions inherited from fpmas::model::detail::AgentGroupBase
 AgentGroupBase (GroupId group_id, api::model::AgentGraph &agent_graph)
 
 AgentGroupBase (const AgentGroupBase &)=delete
 
AgentGroupBaseoperator= (const AgentGroupBase &)=delete
 
 AgentGroupBase (GroupId group_id, api::model::AgentGraph &agent_graph, const api::model::Behavior &behavior)
 
GroupId groupId () const override
 
const api::model::Behaviorbehavior () override
 
void add (api::model::Agent *) override
 
void remove (api::model::Agent *) override
 
void insert (api::model::AgentPtr *) override
 
void erase (api::model::AgentPtr *) override
 
void clear () override
 
scheduler::Jobjob () override
 
const scheduler::Jobjob () const override
 
api::scheduler::JobagentExecutionJob () override
 
const api::scheduler::JobagentExecutionJob () const override
 
std::vector< api::model::Agent * > agents () const override
 
std::vector< api::model::Agent * > localAgents () const override
 
std::vector< api::model::Agent * > distantAgents () const override
 
void addEventHandler (Event event, api::utils::Callback< api::model::Agent * > *callback) override
 
void removeEventHandler (Event event, api::utils::Callback< api::model::Agent * > *callback) override
 

Additional Inherited Members

- Public Types inherited from fpmas::api::model::AgentGroup
enum  Event { INSERT , ERASE , ADD , REMOVE }
 

Detailed Description

template<typename CellType>
class fpmas::model::MoveAgentGroup< CellType >

api::model::MoveAgentGroup implementation.

Constructor & Destructor Documentation

◆ MoveAgentGroup()

template<typename CellType >
fpmas::model::MoveAgentGroup< CellType >::MoveAgentGroup ( api::model::GroupId  group_id,
const api::model::Behavior behavior,
api::model::SpatialModel< CellType > &  model,
api::model::EndCondition< CellType > &  end_condition 
)
inline

MoveAgentGroup constructor.

The specified behavior is assumed to contain some SpatialAgent::moveTo() instructions. This is not required, but if it's not the case, the DistributedMoveAlgorithm will be systematically executed while it's useless.

Parameters
group_idunique group id
behaviorbehavior to execute on agents of the group
modelassociated spatial model
end_conditiondistributed move algorithm end condition

Member Function Documentation

◆ jobs()

template<typename CellType >
api::scheduler::JobList fpmas::model::MoveAgentGroup< CellType >::jobs
overridevirtual

Returns a JobList containing:

  1. The execution of behavior on agents of the group, where SpatialAgent::moveTo() operations are potentially performed, including any necessary synchronization at the end of all behavior executions. Corresponds to the agentExecutionJob() in practice.
  2. The execution of a DistributedMoveAlgorithm, according to the specified model, to commit the previous moveTo operations and update agents location, mobility fields and perceptions. The algorithm is executed only on agents contained in the group. However, notice that those agents' perceptions are still updated with any other agents located on model's cells, even if they are not included in this group.
Returns
list of Jobs associated to this AgentGroup

Implements fpmas::api::model::AgentGroup.

◆ distributedMoveAlgorithm()

template<typename CellType >
api::model::DistributedMoveAlgorithm< CellType > & fpmas::model::MoveAgentGroup< CellType >::distributedMoveAlgorithm ( )
inlineoverridevirtual

Returns the internal distributedMoveAlgorithm() associated to this group.

The execution of distributedMoveAlgorithm().jobs() apply the DistributedMoveAlgorithm to all agents currently contained in the group.

The JobList returned by jobs() corresponds to

api::model::DistributedMoveAlgorithm< CellType > & distributedMoveAlgorithm() override
Definition: spatial_model.h:121
api::scheduler::Job & agentExecutionJob() override
Definition: model.h:411
Returns
reference to internal distributed move algorithm instance

Implements fpmas::api::model::MoveAgentGroup< CellType >.


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