1#ifndef FPMAS_SPATIAL_GRAPH_BUILDER_H
2#define FPMAS_SPATIAL_GRAPH_BUILDER_H
13namespace fpmas {
namespace model {
29 template<
typename CellType>
35 std::size_t cell_count;
37 std::function<CellType*()> cell_allocator;
38 std::function<CellType*()> distant_cell_allocator;
56 std::size_t cell_count,
57 std::function<CellType*()> cell_allocator,
58 std::function<CellType*()> distant_cell_allocator) :
59 graph_builder(graph_builder), cell_count(cell_count),
60 cell_allocator(cell_allocator),
61 distant_cell_allocator(distant_cell_allocator) {
77 std::size_t cell_count,
78 std::function<CellType*()> cell_allocator)
80 graph_builder, cell_count, cell_allocator, cell_allocator) {
97 std::size_t cell_count)
103 return this->
build(model, {});
106 std::vector<CellType*>
build(
111 template<
typename CellType>
117 groups, cell_count, cell_allocator, distant_cell_allocator,
122 node_builder, api::model::CELL_SUCCESSOR, model.
graph()
125 return model.
cells();
Definition: graph_builder.h:154
virtual std::vector< api::graph::DistributedNode< T > * > build(DistributedNodeBuilder< T > &node_builder, LayerId layer, DistributedGraph< T > &graph)=0
Definition: spatial_model.h:568
virtual api::communication::MpiCommunicator & getMpiCommunicator()=0
virtual AgentGraph & graph()=0
virtual AgentGroup & cellGroup()=0
virtual std::vector< CellType * > cells()=0
Definition: graph_builder.h:31
CellNetworkBuilder(api::graph::DistributedGraphBuilder< model::AgentPtr > &graph_builder, std::size_t cell_count)
Definition: graph_builder.h:95
std::vector< CellType * > build(api::model::SpatialModel< CellType > &model) const override
Definition: graph_builder.h:101
CellNetworkBuilder(api::graph::DistributedGraphBuilder< model::AgentPtr > &graph_builder, std::size_t cell_count, std::function< CellType *()> cell_allocator)
Definition: graph_builder.h:75
CellNetworkBuilder(api::graph::DistributedGraphBuilder< model::AgentPtr > &graph_builder, std::size_t cell_count, std::function< CellType *()> cell_allocator, std::function< CellType *()> distant_cell_allocator)
Definition: graph_builder.h:54
int GroupId
Definition: model.h:78
std::vector< std::reference_wrapper< AgentGroup > > GroupList
Definition: model.h:833