GAMS  1.4.0
gams::formations::AgentFormation Class Referenceabstract

An agent formation. More...

#include <AgentFormation.h>

Public Member Functions

 AgentFormation ()
 Constructor. More...
 
virtual ~AgentFormation ()
 Constructor. More...
 
virtual void from_args (madara::knowledge::FunctionArguments &args)=0
 Configures the formation from arguments. More...
 
virtual double goodness (const std::string &id="", double buffer=3.0) const =0
 Checks the goodness of an agent in the current formation. More...
 
virtual bool is_extra (const std::string &id="") const =0
 Checks if the agent is an extra member of the formation. More...
 
virtual bool is_member (const std::string &id="") const =0
 Checks if the agent is a member of the formation. More...
 
void set_id (const std::string &id)
 Sets the id of the current agent(e.g. More...
 

Protected Attributes

groups::GroupFactoryRepository group_factory_
 The group factory. More...
 
std::string id_
 The current agent id. More...
 
madara::knowledge::KnowledgeBase * knowledge_
 The knowledge base to use as a data plane. More...
 

Detailed Description

An agent formation.

Definition at line 73 of file AgentFormation.h.

Constructor & Destructor Documentation

◆ AgentFormation()

gams::formations::AgentFormation::AgentFormation ( )

Constructor.

◆ ~AgentFormation()

virtual gams::formations::AgentFormation::~AgentFormation ( )
virtual

Constructor.

Member Function Documentation

◆ from_args()

virtual void gams::formations::AgentFormation::from_args ( madara::knowledge::FunctionArguments &  args)
pure virtual

Configures the formation from arguments.

Parameters
argsarguments to check through

◆ goodness()

virtual double gams::formations::AgentFormation::goodness ( const std::string &  id = "",
double  buffer = 3.0 
) const
pure virtual

Checks the goodness of an agent in the current formation.

Parameters
idthe agent id to check. Null means check all agents
buffermaximum allowed offset from correct location in meters
Returns
the goodness of the formation, where 0 is bad and 1 is good

◆ is_extra()

virtual bool gams::formations::AgentFormation::is_extra ( const std::string &  id = "") const
pure virtual

Checks if the agent is an extra member of the formation.

Parameters
idthe agent id(e.g. agent.0 or agent.leader). If null, uses the current agent's id
Returns
true if the agent is an extra member in the formation

◆ is_member()

virtual bool gams::formations::AgentFormation::is_member ( const std::string &  id = "") const
pure virtual

Checks if the agent is a member of the formation.

Parameters
idthe agent id(e.g. agent.0 or agent.leader). If null, uses the current agent's id
Returns
true if the agent is in the formation

◆ set_id()

void gams::formations::AgentFormation::set_id ( const std::string &  id)

Sets the id of the current agent(e.g.

"agent.0" or "agent.leader")

Parameters
idthe current agent id

Member Data Documentation

◆ group_factory_

groups::GroupFactoryRepository gams::formations::AgentFormation::group_factory_
protected

The group factory.

Definition at line 138 of file AgentFormation.h.

◆ id_

std::string gams::formations::AgentFormation::id_
protected

The current agent id.

Definition at line 133 of file AgentFormation.h.

◆ knowledge_

madara::knowledge::KnowledgeBase* gams::formations::AgentFormation::knowledge_
protected

The knowledge base to use as a data plane.

Definition at line 128 of file AgentFormation.h.


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