GAMS  1.2.2
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:
92  GroupBarrier (
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 
104  ~GroupBarrier ();
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 
180  virtual BaseAlgorithm * create (
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_
An algorithm for covering an area in formation with a synchronous model of computation.
Definition: GroupBarrier.h:79
Base class for algorithm factories that classes derived from.
A factory class for creating Formation Coverage algorithms.
Definition: GroupBarrier.h:156
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
enforcer of barrier times
Definition: GroupBarrier.h:150
Copyright (c) 2014 Carnegie Mellon University.
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
int position_
position in member assignment
Definition: GroupBarrier.h:144
The base platform for all platforms to use.
Definition: BasePlatform.h:190
Copyright (c) 2014 Carnegie Mellon University.
std::vector< Agent > Agents
An array of agent knowledge.
Definition: Agent.h:246
Copyright (c) 2014 Carnegie Mellon University.
Contains all GAMS-related tools, classes and code.
A container for self referencing information.
Definition: Self.h:69
#define GAMS_EXPORT
Definition: GamsExport.h:20
The base class that algorithms in GAMS use.
Definition: BaseAlgorithm.h:94
Copyright (c) 2014 Carnegie Mellon University.
std::vector< std::string > members_
members of the formation (e.g., agent.0, agent.1, etc.)
Definition: GroupBarrier.h:141
madara::knowledge::containers::Barrier barrier_
movement barrier
Definition: GroupBarrier.h:147
Copyright (c) 2014 Carnegie Mellon University.
Copyright (c) 2014 Carnegie Mellon University.