GAMS  1.4.0
gams::algorithms::area_coverage::MinTimeAreaCoverage Class Reference

Area coverage that minimizes the time taken for covering an area. More...

#include <MinTimeAreaCoverage.h>

Inheritance diagram for gams::algorithms::area_coverage::MinTimeAreaCoverage:
gams::algorithms::area_coverage::BaseAreaCoverage gams::algorithms::BaseAlgorithm gams::algorithms::area_coverage::PrioritizedMinTimeAreaCoverage

Public Member Functions

 MinTimeAreaCoverage (const std::string &search_id, double e_time, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0, variables::Agents *agents=0, const std::string &algo_name="mtac")
 Constructor. More...
 
virtual int analyze (void)
 Increment sensor values. 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...
 
utility::GPSPosition get_next_position (void) const
 Get next position. 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 MinTimeAreaCoverage &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 check_if_finished (int ret_val) const
 Check if finished based on time. More...
 
virtual void generate_new_position (void)
 generate new next position More...
 
virtual double get_utility (const utility::Position &start, const utility::Position &end, std::set< utility::Position > &online)
 A better way to manage this would probably be to take a function pointer to handle utility calculation. More...
 
virtual void review_last_move ()
 review if last move was good, did we hit all cells we said we would More...
 

Protected Attributes

variables::Agentsagents_
 the list of agents potentially participating in the algorithm More...
 
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
 enforcer for maximum time More...
 
unsigned int executions_
 number of executions More...
 
bool initialized_
 indicates whether the algorithm is initialized More...
 
madara::knowledge::KnowledgeBase * knowledge_
 provides access to the knowledge base More...
 
unsigned int last_generation_
 time step of last position generation More...
 
double max_time_
 for keeping track of the time set for maximum coverage time More...
 
variables::Sensor min_time_
 time since last coverage More...
 
utility::GPSPosition next_position_
 next position More...
 
platforms::BasePlatformplatform_
 provides access to the platform More...
 
std::map< utility::Position, double > position_value_map_
 positions we will be passing through and their previous values More...
 
pose::SearchArea search_area_
 Search Area to cover. 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...
 
std::set< utility::Positionvalid_positions_
 discretized positions in search area More...
 

Detailed Description

Area coverage that minimizes the time taken for covering an area.

Definition at line 84 of file MinTimeAreaCoverage.h.

Constructor & Destructor Documentation

◆ MinTimeAreaCoverage()

gams::algorithms::area_coverage::MinTimeAreaCoverage::MinTimeAreaCoverage ( const std::string &  search_id,
double  e_time,
madara::knowledge::KnowledgeBase *  knowledge = 0,
platforms::BasePlatform platform = 0,
variables::Sensors sensors = 0,
variables::Self self = 0,
variables::Agents agents = 0,
const std::string &  algo_name = "mtac" 
)

Constructor.

Parameters
search_idthe region or search area to be covered
e_timeamount of time to execute algorithm, 0 for infinite
knowledgethe context containing variables and values
platformthe underlying platform the algorithm will use
sensorsmap of sensor names to sensor information
selfself-referencing variables
agentsvariables relating to agents
algo_namename to use in Sensor for differentiation

Member Function Documentation

◆ analyze()

virtual int gams::algorithms::area_coverage::MinTimeAreaCoverage::analyze ( void  )
virtual

Increment sensor values.

Reimplemented from gams::algorithms::area_coverage::BaseAreaCoverage.

◆ check_if_finished()

int gams::algorithms::area_coverage::BaseAreaCoverage::check_if_finished ( int  ret_val) const
protectedinherited

Check if finished based on time.

◆ execute()

virtual int gams::algorithms::area_coverage::BaseAreaCoverage::execute ( void  )
virtualinherited

Plans the next execution of the algorithm.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ generate_new_position()

virtual void gams::algorithms::area_coverage::MinTimeAreaCoverage::generate_new_position ( void  )
protectedvirtual

generate new next position

Implements gams::algorithms::area_coverage::BaseAreaCoverage.

◆ 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_next_position()

utility::GPSPosition gams::algorithms::area_coverage::BaseAreaCoverage::get_next_position ( void  ) const
inherited

Get next position.

Returns
next_position_ member

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

◆ get_utility()

virtual double gams::algorithms::area_coverage::MinTimeAreaCoverage::get_utility ( const utility::Position start,
const utility::Position end,
std::set< utility::Position > &  online 
)
protectedvirtual

A better way to manage this would probably be to take a function pointer to handle utility calculation.

get utility of moving from one index position to another

Reimplemented in gams::algorithms::area_coverage::PrioritizedMinTimeAreaCoverage.

◆ operator=()

void gams::algorithms::area_coverage::MinTimeAreaCoverage::operator= ( const MinTimeAreaCoverage rhs)

Assignment operator.

Parameters
rhsvalues to copy

◆ plan()

virtual int gams::algorithms::area_coverage::BaseAreaCoverage::plan ( void  )
virtualinherited

Plans the next execution of the algorithm.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ review_last_move()

virtual void gams::algorithms::area_coverage::MinTimeAreaCoverage::review_last_move ( )
protectedvirtual

review if last move was good, did we hit all cells we said we would

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

◆ enforcer_

madara::utility::EpochEnforcer<std::chrono::steady_clock> gams::algorithms::area_coverage::BaseAreaCoverage::enforcer_
protectedinherited

enforcer for maximum time

Definition at line 149 of file BaseAreaCoverage.h.

◆ executions_

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

number of executions

Definition at line 204 of file BaseAlgorithm.h.

◆ initialized_

bool gams::algorithms::area_coverage::BaseAreaCoverage::initialized_
protectedinherited

indicates whether the algorithm is initialized

Definition at line 143 of file BaseAreaCoverage.h.

◆ knowledge_

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

provides access to the knowledge base

Definition at line 207 of file BaseAlgorithm.h.

◆ last_generation_

unsigned int gams::algorithms::area_coverage::MinTimeAreaCoverage::last_generation_
protected

time step of last position generation

Definition at line 144 of file MinTimeAreaCoverage.h.

◆ max_time_

double gams::algorithms::area_coverage::BaseAreaCoverage::max_time_
protectedinherited

for keeping track of the time set for maximum coverage time

Definition at line 146 of file BaseAreaCoverage.h.

◆ min_time_

variables::Sensor gams::algorithms::area_coverage::MinTimeAreaCoverage::min_time_
protected

time since last coverage

Definition at line 135 of file MinTimeAreaCoverage.h.

◆ next_position_

utility::GPSPosition gams::algorithms::area_coverage::BaseAreaCoverage::next_position_
protectedinherited

next position

Definition at line 140 of file BaseAreaCoverage.h.

◆ platform_

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

provides access to the platform

Definition at line 210 of file BaseAlgorithm.h.

◆ position_value_map_

std::map<utility::Position, double> gams::algorithms::area_coverage::MinTimeAreaCoverage::position_value_map_
protected

positions we will be passing through and their previous values

Definition at line 141 of file MinTimeAreaCoverage.h.

◆ search_area_

pose::SearchArea gams::algorithms::area_coverage::MinTimeAreaCoverage::search_area_
protected

Search Area to cover.

Definition at line 132 of file MinTimeAreaCoverage.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.

◆ valid_positions_

std::set<utility::Position> gams::algorithms::area_coverage::MinTimeAreaCoverage::valid_positions_
protected

discretized positions in search area

Definition at line 138 of file MinTimeAreaCoverage.h.


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