![]() |
fpmas 1.6
|
#include <model.h>
Additional Inherited Members | |
![]() | |
std::size_t | local_node_count |
An api::graph::DistributedNodeBuilder implementation that can be used to easily generate a random model, that can be provided to an api::graph::DistributedGraphBuilder implementation.
AgentNodes are built automatically, and can be linked according to the api::graph::DistributedGraphBuilder algorithm implementation.
fpmas::model::DistributedAgentNodeBuilder::DistributedAgentNodeBuilder | ( | const api::model::GroupList & | groups, |
std::size_t | agent_count, | ||
std::function< api::model::Agent *()> | allocator, | ||
api::communication::MpiCommunicator & | comm | ||
) |
DistributedAgentNodeBuilder constructor.
allocator
is a function object used to dynamically allocate Agents. When this version of the constructor is used, the allocator
is used by both buildNode() and buildDistantNode() methods. A lambda function can be used to easily define an allocator
.
some_agent_data
should in practice take distribution into account. For example, since 1000 is the total count of initialized Agents, it is very likely that much less Agents will be effectively initialized on the local process.fpmas::model::DistributedAgentNodeBuilder::DistributedAgentNodeBuilder | ( | const api::model::GroupList & | groups, |
std::size_t | agent_count, | ||
std::function< api::model::Agent *()> | allocator, | ||
std::function< api::model::Agent *()> | distant_allocator, | ||
api::communication::MpiCommunicator & | comm | ||
) |
DistributedAgentNodeBuilder constructor.
allocator
and distant_allocator
are function object used to dynamically allocate Agents. When this version of the constructor is used, allocator
is used by buildNode(), and distant_allocator
is used by buildDistantNode(). Since buildDistantNode() is used to build temporary representations of Agents, distant_allocator
can be used to efficiently allocated default constructed Agents. Lambda functions can be used to easily define an allocators.
|
override |
Builds a node in the specified graph.
graph | graph in which the node must be built |
|
override |
Builds a distant node in the specified graph
, with the provided id
. The node is assumed to be currently owned by the process with rank location
.
Such a node can be considered as a "temporary" node, that can be used by the underlying algorithm to build edges with nodes that are currently not located on this process.
Implementations are likely to behave as follow:
Notice that the count of nodes built using this method is not limited and is not correlated to localNodeCount() or nodeCount(), contrary to the buildNode() method.
id | id of the distant node |
location | current node location |
graph | graph in which the distant node will be inserted |