![]() |
fpmas 1.6
|
#include <spatial_model.h>
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 Behavior & | behavior ()=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::Job & | job ()=0 |
virtual const api::scheduler::Job & | job () const =0 |
virtual api::scheduler::Job & | agentExecutionJob ()=0 |
virtual const api::scheduler::Job & | agentExecutionJob () 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 |
![]() | |
AgentGroupBase (GroupId group_id, api::model::AgentGraph &agent_graph) | |
AgentGroupBase (const AgentGroupBase &)=delete | |
AgentGroupBase & | operator= (const AgentGroupBase &)=delete |
AgentGroupBase (GroupId group_id, api::model::AgentGraph &agent_graph, const api::model::Behavior &behavior) | |
GroupId | groupId () const override |
const api::model::Behavior & | behavior () 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::Job & | job () override |
const scheduler::Job & | job () const override |
api::scheduler::Job & | agentExecutionJob () override |
const api::scheduler::Job & | agentExecutionJob () 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 | |
![]() | |
enum | Event { INSERT , ERASE , ADD , REMOVE } |
api::model::MoveAgentGroup implementation.
|
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.
group_id | unique group id |
behavior | behavior to execute on agents of the group |
model | associated spatial model |
end_condition | distributed move algorithm end condition |
|
overridevirtual |
Returns a JobList containing:
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.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.Implements fpmas::api::model::AgentGroup.
|
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
Implements fpmas::api::model::MoveAgentGroup< CellType >.