GAMS  1.4.0
GroupBarrier.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_ALGORITHMS_GROUP_BARRIER_H_
55 #define _GAMS_ALGORITHMS_GROUP_BARRIER_H_
56 
57 #include <vector>
58 #include <string>
59 
60 #include "gams/variables/Sensor.h"
63 #include "gams/variables/Self.h"
67 #include "madara/knowledge/containers/Integer.h"
68 #include "madara/knowledge/containers/Barrier.h"
69 #include "madara/utility/EpochEnforcer.h"
70 
71 namespace gams
72 {
73  namespace algorithms
74  {
80  {
81  public:
93  const std::vector<std::string> & members,
94  std::string barrier_name,
95  double interval,
96  madara::knowledge::KnowledgeBase * knowledge = 0,
97  platforms::BasePlatform * platform = 0,
98  variables::Sensors * sensors = 0,
99  variables::Self * self = 0);
100 
105 
110  void operator=(const GroupBarrier & rhs);
111 
116  virtual int analyze(void);
117 
122  virtual int execute(void);
123 
128  virtual int plan(void);
129 
130  protected:
137  int get_position_in_member_list(std::string id,
138  std::vector <std::string> & member_list);
139 
141  std::vector <std::string> members_;
142 
145 
147  madara::knowledge::containers::Barrier barrier_;
148 
150  madara::utility::EpochEnforcer<std::chrono::steady_clock> enforcer_;
151  };
152 
157  {
158  public:
159 
181  const madara::knowledge::KnowledgeMap & args,
182  madara::knowledge::KnowledgeBase * knowledge,
183  platforms::BasePlatform * platform,
184  variables::Sensors * sensors,
185  variables::Self * self,
186  variables::Agents * agents);
187  };
188  }
189 }
190 
191 #endif // _GAMS_ALGORITHMS_GROUP_BARRIER_H_
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Copyright (c) 2014 Carnegie Mellon University.
#define GAMS_EXPORT
Definition: GamsExport.h:20
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Base class for algorithm factories that classes derived from.
The base class that algorithms in GAMS use.
Definition: BaseAlgorithm.h:95
A factory class for creating Formation Coverage algorithms.
Definition: GroupBarrier.h:157
virtual BaseAlgorithm * create(const madara::knowledge::KnowledgeMap &args, madara::knowledge::KnowledgeBase *knowledge, platforms::BasePlatform *platform, variables::Sensors *sensors, variables::Self *self, variables::Agents *agents)
Creates a Formation Coverage Algorithm.
An algorithm for covering an area in formation with a synchronous model of computation.
Definition: GroupBarrier.h:80
std::vector< std::string > members_
members of the formation(e.g., agent.0, agent.1, etc.)
Definition: GroupBarrier.h:141
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.
void operator=(const GroupBarrier &rhs)
Assignment operator.
int position_
position in member assignment
Definition: GroupBarrier.h:144
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.
virtual int analyze(void)
Analyzes environment, platform, or other information.
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
enforcer of barrier times
Definition: GroupBarrier.h:150
virtual int plan(void)
Plans the next execution of the algorithm.
virtual int execute(void)
Plans the next execution of the algorithm.
madara::knowledge::containers::Barrier barrier_
movement barrier
Definition: GroupBarrier.h:147
The base platform for all platforms to use.
Definition: BasePlatform.h:113
A container for self referencing information.
Definition: Self.h:70
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
std::vector< Agent > Agents
An array of agent knowledge.
Definition: Agent.h:246
Contains all GAMS-related tools, classes and code.