fpmas 1.6
Public Member Functions | List of all members
fpmas::model::AgentNodeBuilder Class Reference

#include <model.h>

Inheritance diagram for fpmas::model::AgentNodeBuilder:
Inheritance graph
[legend]
Collaboration diagram for fpmas::model::AgentNodeBuilder:
Collaboration graph
[legend]

Public Member Functions

 AgentNodeBuilder (api::model::AgentGroup &group)
 
void push (api::model::Agent *agent)
 
api::model::AgentNodebuildNode (api::graph::DistributedGraph< AgentPtr > &) override
 
std::size_t nodeCount () override
 
- Public Member Functions inherited from fpmas::api::graph::NodeBuilder< AgentPtr >
virtual std::size_t nodeCount ()=0
 
virtual DistributedNode< AgentPtr > * buildNode (DistributedGraph< AgentPtr > &graph)=0
 

Detailed Description

An api::graph::NodeBuilder implementation that can be used to easily generate a random model, that can be provided to an api::graph::GraphBuilder implementation.

AgentNodes are built automatically, and can be linked according to the api::graph::GraphBuilder algorithm implementation.

Constructor & Destructor Documentation

◆ AgentNodeBuilder()

fpmas::model::AgentNodeBuilder::AgentNodeBuilder ( api::model::AgentGroup group)
inline

AgentNodeBuilder constructor.

Parameters
groupgroup to which agents will be added

Member Function Documentation

◆ push()

void fpmas::model::AgentNodeBuilder::push ( api::model::Agent agent)
inline

Pushes an agent into the node builder, that will be inserted into the graph with the buildNode() function.

Parameters
agentagent to add to the graph

◆ buildNode()

api::model::AgentNode * fpmas::model::AgentNodeBuilder::buildNode ( api::graph::DistributedGraph< AgentPtr > &  )
override

Adds the agent to the specified group, using the api::model::AgentGroup::add() method.

In consequence, a node is automatically built and added to the group's underlying graph.

Such node can be linked automatically as specified by the api::graph::GraphBuilder algorithm implementation.

◆ nodeCount()

std::size_t fpmas::model::AgentNodeBuilder::nodeCount ( )
inlineoverridevirtual

Returns the count of agents left in the AgentNodeBuilder.

Returns
agent count

Implements fpmas::api::graph::NodeBuilder< AgentPtr >.


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