GAMS  1.4.0
gams::algorithms::GroupBarrier Class Reference

An algorithm for covering an area in formation with a synchronous model of computation. More...

#include <GroupBarrier.h>

Inheritance diagram for gams::algorithms::GroupBarrier:
gams::algorithms::BaseAlgorithm

Public Member Functions

 GroupBarrier (const std::vector< std::string > &members, std::string barrier_name, double interval, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0)
 Constructor. More...
 
 ~GroupBarrier ()
 Destructor. More...
 
virtual int analyze (void)
 Analyzes environment, platform, or other information. More...
 
virtual int execute (void)
 Plans the next execution of the algorithm. More...
 
variables::Agentsget_agents (void)
 Gets the list of agents. More...
 
variables::AlgorithmStatusget_algorithm_status (void)
 Gets algorithm status variables. More...
 
madara::knowledge::KnowledgeBase * get_knowledge_base (void)
 Gets the knowledge base. More...
 
platforms::BasePlatformget_platform (void)
 Gets the platform. More...
 
variables::Selfget_self (void)
 Gets self-defined variables. More...
 
variables::Sensorsget_sensors (void)
 Gets the available sensor information. More...
 
void operator= (const GroupBarrier &rhs)
 Assignment operator. More...
 
virtual int plan (void)
 Plans the next execution of the algorithm. More...
 
virtual void set_agents (variables::Agents *agents)
 Sets the list of agents in the swarm. More...
 
virtual void set_platform (platforms::BasePlatform *platform)
 Sets the platform. More...
 
virtual void set_self (variables::Self *self)
 Sets the map of sensor names to sensor information. More...
 
virtual void set_sensors (variables::Sensors *sensors)
 Sets the map of sensor names to sensor information. More...
 

Protected Member Functions

int get_position_in_member_list (std::string id, std::vector< std::string > &member_list)
 Gets the position of the id in the member list. More...
 

Protected Attributes

variables::Agentsagents_
 the list of agents potentially participating in the algorithm More...
 
madara::knowledge::containers::Barrier barrier_
 movement barrier More...
 
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
 enforcer of barrier times More...
 
unsigned int executions_
 number of executions More...
 
madara::knowledge::KnowledgeBase * knowledge_
 provides access to the knowledge base More...
 
std::vector< std::string > members_
 members of the formation(e.g., agent.0, agent.1, etc.) More...
 
platforms::BasePlatformplatform_
 provides access to the platform More...
 
int position_
 position in member assignment More...
 
variables::Selfself_
 the algorithm's concept of self More...
 
variables::Sensorssensors_
 provides access to sensor information More...
 
variables::AlgorithmStatus status_
 provides access to status information for this platform More...
 

Detailed Description

An algorithm for covering an area in formation with a synchronous model of computation.

Allows specification of arbitrary group or swarm.

Definition at line 79 of file GroupBarrier.h.

Constructor & Destructor Documentation

◆ GroupBarrier()

gams::algorithms::GroupBarrier::GroupBarrier ( const std::vector< std::string > &  members,
std::string  barrier_name,
double  interval,
madara::knowledge::KnowledgeBase *  knowledge = 0,
platforms::BasePlatform platform = 0,
variables::Sensors sensors = 0,
variables::Self self = 0 
)

Constructor.

Parameters
membersthe members of the formation
barrier_namethe barrier name to synchronize on
intervalinterval in seconds between barrier increments
knowledgethe context containing variables and values
platformthe underlying platform the algorithm will use
sensorsmap of sensor names to sensor information
selfself-referencing variables

◆ ~GroupBarrier()

gams::algorithms::GroupBarrier::~GroupBarrier ( )

Destructor.

Member Function Documentation

◆ analyze()

virtual int gams::algorithms::GroupBarrier::analyze ( void  )
virtual

Analyzes environment, platform, or other information.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ execute()

virtual int gams::algorithms::GroupBarrier::execute ( void  )
virtual

Plans the next execution of the algorithm.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ get_agents()

variables::Agents* gams::algorithms::BaseAlgorithm::get_agents ( void  )
inherited

Gets the list of agents.

◆ get_algorithm_status()

variables::AlgorithmStatus* gams::algorithms::BaseAlgorithm::get_algorithm_status ( void  )
inherited

Gets algorithm status variables.

◆ get_knowledge_base()

madara::knowledge::KnowledgeBase* gams::algorithms::BaseAlgorithm::get_knowledge_base ( void  )
inherited

Gets the knowledge base.

◆ get_platform()

platforms::BasePlatform* gams::algorithms::BaseAlgorithm::get_platform ( void  )
inherited

Gets the platform.

◆ get_position_in_member_list()

int gams::algorithms::GroupBarrier::get_position_in_member_list ( std::string  id,
std::vector< std::string > &  member_list 
)
protected

Gets the position of the id in the member list.

Parameters
idthe id of the member
member_listthe list of members
Returns
the position of the id in the member list. -1 if not found.

◆ get_self()

variables::Self* gams::algorithms::BaseAlgorithm::get_self ( void  )
inherited

Gets self-defined variables.

◆ get_sensors()

variables::Sensors* gams::algorithms::BaseAlgorithm::get_sensors ( void  )
inherited

Gets the available sensor information.

◆ operator=()

void gams::algorithms::GroupBarrier::operator= ( const GroupBarrier rhs)

Assignment operator.

Parameters
rhsvalues to copy

◆ plan()

virtual int gams::algorithms::GroupBarrier::plan ( void  )
virtual

Plans the next execution of the algorithm.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ set_agents()

virtual void gams::algorithms::BaseAlgorithm::set_agents ( variables::Agents agents)
virtualinherited

Sets the list of agents in the swarm.

Parameters
agentslist of agents

◆ set_platform()

virtual void gams::algorithms::BaseAlgorithm::set_platform ( platforms::BasePlatform platform)
virtualinherited

Sets the platform.

Parameters
platformthe underlying platform the algorithm will use

◆ set_self()

virtual void gams::algorithms::BaseAlgorithm::set_self ( variables::Self self)
virtualinherited

Sets the map of sensor names to sensor information.

Parameters
selfpointer to self-referencing variables container

◆ set_sensors()

virtual void gams::algorithms::BaseAlgorithm::set_sensors ( variables::Sensors sensors)
virtualinherited

Sets the map of sensor names to sensor information.

Parameters
sensorsmap of sensor names to sensor information

Member Data Documentation

◆ agents_

variables::Agents* gams::algorithms::BaseAlgorithm::agents_
protectedinherited

the list of agents potentially participating in the algorithm

Definition at line 201 of file BaseAlgorithm.h.

◆ barrier_

madara::knowledge::containers::Barrier gams::algorithms::GroupBarrier::barrier_
protected

movement barrier

Definition at line 147 of file GroupBarrier.h.

◆ enforcer_

madara::utility::EpochEnforcer<std::chrono::steady_clock> gams::algorithms::GroupBarrier::enforcer_
protected

enforcer of barrier times

Definition at line 150 of file GroupBarrier.h.

◆ executions_

unsigned int gams::algorithms::BaseAlgorithm::executions_
protectedinherited

number of executions

Definition at line 204 of file BaseAlgorithm.h.

◆ knowledge_

madara::knowledge::KnowledgeBase* gams::algorithms::BaseAlgorithm::knowledge_
protectedinherited

provides access to the knowledge base

Definition at line 207 of file BaseAlgorithm.h.

◆ members_

std::vector<std::string> gams::algorithms::GroupBarrier::members_
protected

members of the formation(e.g., agent.0, agent.1, etc.)

Definition at line 141 of file GroupBarrier.h.

◆ platform_

platforms::BasePlatform* gams::algorithms::BaseAlgorithm::platform_
protectedinherited

provides access to the platform

Definition at line 210 of file BaseAlgorithm.h.

◆ position_

int gams::algorithms::GroupBarrier::position_
protected

position in member assignment

Definition at line 144 of file GroupBarrier.h.

◆ self_

variables::Self* gams::algorithms::BaseAlgorithm::self_
protectedinherited

the algorithm's concept of self

Definition at line 213 of file BaseAlgorithm.h.

◆ sensors_

variables::Sensors* gams::algorithms::BaseAlgorithm::sensors_
protectedinherited

provides access to sensor information

Definition at line 216 of file BaseAlgorithm.h.

◆ status_

variables::AlgorithmStatus gams::algorithms::BaseAlgorithm::status_
protectedinherited

provides access to status information for this platform

Definition at line 219 of file BaseAlgorithm.h.


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