GAMS  1.4.0
gams::algorithms::ZoneCoverage Class Reference

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

#include <ZoneCoverage.h>

Inheritance diagram for gams::algorithms::ZoneCoverage:
gams::algorithms::BaseAlgorithm

Public Member Functions

 ZoneCoverage (const std::string &protectors, const std::string &assets, const std::string &enemies, const std::string &formation, double buffer, double distance, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0)
 Constructor. More...
 
 ~ZoneCoverage ()
 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 ZoneCoverage &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 Types

typedef pose::Position(ZoneCoverage::* formation_func) () const
 
typedef std::vector< madara::knowledge::containers::NativeDoubleArray > MadaraArrayVec
 

Protected Member Functions

pose::Position arc_formation () const
 
pose::Position line_formation () const
 
pose::Position onion_formation () const
 

Static Protected Member Functions

static formation_func get_form_func (const std::string &form_name)
 

Protected Attributes

variables::Agentsagents_
 the list of agents potentially participating in the algorithm More...
 
MadaraArrayVec asset_loc_cont_
 
std::vector< pose::Positionasset_locs_
 
gams::groups::GroupBaseassets_
 
gams::groups::AgentVector assets_members_
 
double buffer_
 
double distance_
 
gams::groups::GroupBaseenemies_
 
gams::groups::AgentVector enemies_members_
 
MadaraArrayVec enemy_loc_cont_
 
std::vector< pose::Positionenemy_locs_
 
unsigned int executions_
 number of executions More...
 
formation_func form_func_
 
std::string formation_
 
std::string frame_
 
groups::GroupFactoryRepository group_factory_
 factory for interacting with user-defined groups More...
 
int index_
 
madara::knowledge::KnowledgeBase * knowledge_
 provides access to the knowledge base More...
 
pose::Position next_loc_
 
platforms::BasePlatformplatform_
 provides access to the platform More...
 
gams::groups::GroupBaseprotectors_
 
gams::groups::AgentVector protectors_members_
 
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...
 

Private Member Functions

void update_arrays (const gams::groups::AgentVector &names, MadaraArrayVec &arrays) const
 
void update_locs (const MadaraArrayVec &arrays, std::vector< pose::Position > &locs) const
 

Detailed Description

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

Allows specification of arbitrary group or swarm.

Supports the following formation types, with the following names:

"line": protectors arrange themselves in a line perpendicular to line connecting enemy to asset, and parallel to the ground; supports only one enemy and one asset(only first in each group will be used)

Definition at line 85 of file ZoneCoverage.h.

Member Typedef Documentation

◆ formation_func

typedef pose::Position(ZoneCoverage::* gams::algorithms::ZoneCoverage::formation_func) () const
protected

Definition at line 165 of file ZoneCoverage.h.

◆ MadaraArrayVec

typedef std::vector<madara::knowledge::containers::NativeDoubleArray> gams::algorithms::ZoneCoverage::MadaraArrayVec
protected

Definition at line 175 of file ZoneCoverage.h.

Constructor & Destructor Documentation

◆ ZoneCoverage()

gams::algorithms::ZoneCoverage::ZoneCoverage ( const std::string &  protectors,
const std::string &  assets,
const std::string &  enemies,
const std::string &  formation,
double  buffer,
double  distance,
madara::knowledge::KnowledgeBase *  knowledge = 0,
platforms::BasePlatform platform = 0,
variables::Sensors sensors = 0,
variables::Self self = 0 
)

Constructor.

Parameters
protectorsname of group of protecting agents
assetsname of group of agents to protect
enemiesname of group of attacking agents
formationname of formation
frameframe of reference(cartesian, GPS)
bufferbuffer between agents
distancedistance from the asset
knowledgethe context containing variables and values
platformthe underlying platform the algorithm will use
sensorsmap of sensor names to sensor information
selfself-referencing variables

◆ ~ZoneCoverage()

gams::algorithms::ZoneCoverage::~ZoneCoverage ( )

Destructor.

Member Function Documentation

◆ analyze()

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

Analyzes environment, platform, or other information.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ arc_formation()

pose::Position gams::algorithms::ZoneCoverage::arc_formation ( ) const
protected

◆ execute()

virtual int gams::algorithms::ZoneCoverage::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_form_func()

static formation_func gams::algorithms::ZoneCoverage::get_form_func ( const std::string &  form_name)
staticprotected

◆ 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_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.

◆ line_formation()

pose::Position gams::algorithms::ZoneCoverage::line_formation ( ) const
protected

◆ onion_formation()

pose::Position gams::algorithms::ZoneCoverage::onion_formation ( ) const
protected

◆ operator=()

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

Assignment operator.

Parameters
rhsvalues to copy

◆ plan()

virtual int gams::algorithms::ZoneCoverage::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

◆ update_arrays()

void gams::algorithms::ZoneCoverage::update_arrays ( const gams::groups::AgentVector names,
MadaraArrayVec arrays 
) const
private

◆ update_locs()

void gams::algorithms::ZoneCoverage::update_locs ( const MadaraArrayVec arrays,
std::vector< pose::Position > &  locs 
) const
private

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.

◆ asset_loc_cont_

MadaraArrayVec gams::algorithms::ZoneCoverage::asset_loc_cont_
protected

Definition at line 177 of file ZoneCoverage.h.

◆ asset_locs_

std::vector<pose::Position> gams::algorithms::ZoneCoverage::asset_locs_
protected

Definition at line 180 of file ZoneCoverage.h.

◆ assets_

gams::groups::GroupBase* gams::algorithms::ZoneCoverage::assets_
protected

Definition at line 150 of file ZoneCoverage.h.

◆ assets_members_

gams::groups::AgentVector gams::algorithms::ZoneCoverage::assets_members_
protected

Definition at line 154 of file ZoneCoverage.h.

◆ buffer_

double gams::algorithms::ZoneCoverage::buffer_
protected

Definition at line 159 of file ZoneCoverage.h.

◆ distance_

double gams::algorithms::ZoneCoverage::distance_
protected

Definition at line 161 of file ZoneCoverage.h.

◆ enemies_

gams::groups::GroupBase* gams::algorithms::ZoneCoverage::enemies_
protected

Definition at line 151 of file ZoneCoverage.h.

◆ enemies_members_

gams::groups::AgentVector gams::algorithms::ZoneCoverage::enemies_members_
protected

Definition at line 155 of file ZoneCoverage.h.

◆ enemy_loc_cont_

MadaraArrayVec gams::algorithms::ZoneCoverage::enemy_loc_cont_
protected

Definition at line 178 of file ZoneCoverage.h.

◆ enemy_locs_

std::vector<pose::Position> gams::algorithms::ZoneCoverage::enemy_locs_
protected

Definition at line 181 of file ZoneCoverage.h.

◆ executions_

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

number of executions

Definition at line 204 of file BaseAlgorithm.h.

◆ form_func_

formation_func gams::algorithms::ZoneCoverage::form_func_
protected

Definition at line 167 of file ZoneCoverage.h.

◆ formation_

std::string gams::algorithms::ZoneCoverage::formation_
protected

Definition at line 157 of file ZoneCoverage.h.

◆ frame_

std::string gams::algorithms::ZoneCoverage::frame_
protected

Definition at line 147 of file ZoneCoverage.h.

◆ group_factory_

groups::GroupFactoryRepository gams::algorithms::ZoneCoverage::group_factory_
protected

factory for interacting with user-defined groups

Definition at line 145 of file ZoneCoverage.h.

◆ index_

int gams::algorithms::ZoneCoverage::index_
protected

Definition at line 163 of file ZoneCoverage.h.

◆ knowledge_

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

provides access to the knowledge base

Definition at line 207 of file BaseAlgorithm.h.

◆ next_loc_

pose::Position gams::algorithms::ZoneCoverage::next_loc_
protected

Definition at line 182 of file ZoneCoverage.h.

◆ platform_

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

provides access to the platform

Definition at line 210 of file BaseAlgorithm.h.

◆ protectors_

gams::groups::GroupBase* gams::algorithms::ZoneCoverage::protectors_
protected

Definition at line 149 of file ZoneCoverage.h.

◆ protectors_members_

gams::groups::AgentVector gams::algorithms::ZoneCoverage::protectors_members_
protected

Definition at line 153 of file ZoneCoverage.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: