![]() |
fpmas 1.6
|
#include <spatial_model.h>
Public Member Functions | |
void | build (api::model::SpatialModel< CellType > &model, api::model::GroupList groups, api::model::SpatialAgentFactory< CellType > &factory, api::model::SpatialAgentMapping< MappingCellType > &agent_mapping) override |
void | build (api::model::SpatialModel< CellType > &model, api::model::GroupList groups, std::function< api::model::SpatialAgent< CellType > *()> factory, api::model::SpatialAgentMapping< MappingCellType > &agent_mapping) override |
![]() | |
virtual void | build (SpatialModel< CellType > &model, GroupList groups, SpatialAgentFactory< CellType > &factory, SpatialAgentMapping< api::model::Cell > &agent_mapping)=0 |
virtual void | build (SpatialModel< CellType > &model, GroupList groups, std::function< SpatialAgent< CellType > *()> factory, SpatialAgentMapping< api::model::Cell > &agent_mapping)=0 |
Additional Inherited Members | |
![]() | |
static const api::model::GroupId | TEMP_GROUP_ID |
![]() | |
void | build_agents (api::model::SpatialModel< CellType > &model, api::model::GroupList groups, api::model::SpatialAgentFactory< CellType > &factory, api::model::SpatialAgentMapping< api::model::Cell > &agent_mapping) |
void | build_agents (api::model::SpatialModel< CellType > &model, api::model::GroupList groups, std::function< api::model::SpatialAgent< CellType > *()> factory, api::model::SpatialAgentMapping< api::model::Cell > &agent_mapping) |
api::model::SpatialAgentBuilder implementation.
|
inlineoverride |
Build SpatialAgents in the specified model
in a distributed way.
More precisely:
cell
in model.cells()
, agent_mapping.countAt(cell)
SpatialAgents are allocated using factory.build()
.groups
, using AgentGroup::add().cell
they were built from, according to point 1. This is eventually performed using SpatialAgent::initLocation().model.distributedMoveAlgorithm()
is executed to complete the location initialization of built SpatialAgents.Additionnal implementation defined behaviors can be added according to the current model type.
model | model in which agent are initialized. More precisely, agents are initialized within the Cell network defined by model.cells() |
groups | groups to which each agent must be added |
factory | agent factory used to allocate agents |
agent_mapping | agent mapping used to compute the number of agents to initialize on each cell |
|
inlineoverride |
Same as build(SpatialModel<CellType>&, GroupList, SpatialAgentFactory<CellType>&, SpatialAgentMapping<MappingCellType>&) but uses a call to factory()
instead of the SpatialAgentFactory::build() method to build Agents.
It might be convenient to initialize the factory
from a lambda function:
model | model in which agent are initialized. More precisely, agents are initialized within the Cell network defined by model.cells() |
groups | groups to which each agent must be added |
factory | callable object used to allocate agents |
agent_mapping | agent mapping used to compute the number of agents to initialize on each cell |