fpmas 1.6
Public Member Functions | List of all members
fpmas::api::model::CellNetworkBuilder< CellType > Class Template Referenceabstract

#include <spatial_model.h>

Inheritance diagram for fpmas::api::model::CellNetworkBuilder< CellType >:
Inheritance graph
[legend]

Public Member Functions

virtual std::vector< CellType * > build (SpatialModel< CellType > &spatial_model) const =0
 
virtual std::vector< CellType * > build (SpatialModel< CellType > &spatial_model, GroupList groups) const =0
 

Detailed Description

template<typename CellType>
class fpmas::api::model::CellNetworkBuilder< CellType >

CellNetworkBuilder API.

The main purpose of a CellNetworkBuilder is to generate some Cells according to specific environment properties (for example, a grid with a specified size or a geographic environment loaded from an OSM file), and to add it to a predefined SpatialModel in order to build a Cell network. In consequence, successor relations between Cells are also assumed to be built by the CellNetworkBuilder.

The CellNetworkBuilder is however allowed to instantiate and link any other type of Agent that might be relevant in the context of the built environment.

The construction of the SpatialModel might be distributed, so that the instantiation of all Cells are not handled by a single process, but this is not required.

The distributed instantiation of user defined SpatialAgents on the built Cell network can be handled using a SpatialAgentBuilder.

Member Function Documentation

◆ build() [1/2]

template<typename CellType >
virtual std::vector< CellType * > fpmas::api::model::CellNetworkBuilder< CellType >::build ( SpatialModel< CellType > &  spatial_model) const
pure virtual

Builds a Cell network into the specified spatial_model.

Built Cells are added to the SpatialModel using the SpatialModel::add() method.

The method also perform synchronizations on the underlying spatial_model graph to ensure that all links created are properly committed and synchronized upon return.

Parameters
spatial_modelspatial model in which cells will be added
Returns
cells built on the current process

Implemented in fpmas::model::CellNetworkBuilder< CellType >, and fpmas::model::detail::GridBuilder< CellType >.

◆ build() [2/2]

template<typename CellType >
virtual std::vector< CellType * > fpmas::api::model::CellNetworkBuilder< CellType >::build ( SpatialModel< CellType > &  spatial_model,
GroupList  groups 
) const
pure virtual

Same as build(spatial_model), but also adds built cells to groups, in order to assign behaviors to cells.

Parameters
spatial_modelspatial model in which cells will be added
groupsgroups to which built cells will be added
Returns
cells built on the current process

Implemented in fpmas::model::CellNetworkBuilder< CellType >, and fpmas::model::detail::GridBuilder< CellType >.


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