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

#include <graph_builder.h>

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

Public Member Functions

 CellNetworkBuilder (api::graph::DistributedGraphBuilder< model::AgentPtr > &graph_builder, std::size_t cell_count, std::function< CellType *()> cell_allocator, std::function< CellType *()> distant_cell_allocator)
 
 CellNetworkBuilder (api::graph::DistributedGraphBuilder< model::AgentPtr > &graph_builder, std::size_t cell_count, std::function< CellType *()> cell_allocator)
 
 CellNetworkBuilder (api::graph::DistributedGraphBuilder< model::AgentPtr > &graph_builder, std::size_t cell_count)
 
std::vector< CellType * > build (api::model::SpatialModel< CellType > &model) const override
 
std::vector< CellType * > build (api::model::SpatialModel< CellType > &model, api::model::GroupList groups) const override
 
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::model::CellNetworkBuilder< CellType >

An fpmas::api::model::CellNetworkBuilder implementation.

The algorithm takes as input a generic fpmas::api::graph::DistributedGraphBuilder instance, and builds a Cell network from it with appropriate AgentGroups and CELL_SUCCESSOR links.

Template Parameters
CellTypetype of cells to build

Constructor & Destructor Documentation

◆ CellNetworkBuilder() [1/3]

template<typename CellType >
fpmas::model::CellNetworkBuilder< CellType >::CellNetworkBuilder ( api::graph::DistributedGraphBuilder< model::AgentPtr > &  graph_builder,
std::size_t  cell_count,
std::function< CellType *()>  cell_allocator,
std::function< CellType *()>  distant_cell_allocator 
)
inline

CellNetworkBuilder constructor.

Parameters
graph_builderDistributedGraphBuilder used to build the Cell graph
cell_countsize of the Cell network to build. The global network size should be provided on all processes, independently from the distribution.
cell_allocatorfunction used to dynamically allocate LOCAL CellType instances
distant_cell_allocatorfunction used to dynamically allocate DISTANT CellType instances

◆ CellNetworkBuilder() [2/3]

template<typename CellType >
fpmas::model::CellNetworkBuilder< CellType >::CellNetworkBuilder ( api::graph::DistributedGraphBuilder< model::AgentPtr > &  graph_builder,
std::size_t  cell_count,
std::function< CellType *()>  cell_allocator 
)
inline

CellNetworkBuilder constructor.

Parameters
graph_builderDistributedGraphBuilder used to build the Cell graph
cell_countsize of the Cell network to build. The global network size should be provided on all processes, independently from the distribution.
cell_allocatorfunction used to dynamically allocate LOCAL and DISTANT CellType instances

◆ CellNetworkBuilder() [3/3]

template<typename CellType >
fpmas::model::CellNetworkBuilder< CellType >::CellNetworkBuilder ( api::graph::DistributedGraphBuilder< model::AgentPtr > &  graph_builder,
std::size_t  cell_count 
)
inline

CellNetworkBuilder constructor.

LOCAL and DISTANT CellType instances are allocated using the new CellType instruction.

Parameters
graph_builderDistributedGraphBuilder used to build the Cell graph
cell_countsize of the Cell network to build. The global network size should be provided on all processes, independently from the distribution.

Member Function Documentation

◆ build() [1/2]

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

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

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

◆ build() [2/2]

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

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

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


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