GAMS  1.4.0
Agent.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_VARIABLES_DEVICES_H_
55 #define _GAMS_VARIABLES_DEVICES_H_
56 
57 #include <vector>
58 #include <map>
59 #include <string>
60 
61 #include "gams/GamsExport.h"
62 #include "madara/knowledge/containers/Integer.h"
63 #include "madara/knowledge/containers/Double.h"
64 #include "madara/knowledge/containers/String.h"
65 #include "madara/knowledge/containers/NativeDoubleVector.h"
66 #include "madara/knowledge/containers/Vector.h"
67 #include "madara/knowledge/containers/Map.h"
68 #include "madara/knowledge/KnowledgeBase.h"
69 #include "AccentStatus.h"
70 #include "gams/groups/GroupBase.h"
71 
72 namespace gams
73 {
74  namespace variables
75  {
80  {
81  public:
85  Agent();
86 
90  ~Agent();
91 
96  void operator=(const Agent & agent);
97 
103  void init_vars(madara::knowledge::KnowledgeBase & knowledge,
104  const std::string & prefix);
105 
111  void init_vars(madara::knowledge::KnowledgeBase & knowledge,
112  const madara::knowledge::KnowledgeRecord::Integer& id);
113 
119  void init_vars(madara::knowledge::Variables & knowledge,
120  const madara::knowledge::KnowledgeRecord::Integer& id);
121 
126  static bool is_agent(madara::knowledge::KnowledgeBase & knowledge,
127  const std::string prefix);
128 
130  madara::knowledge::containers::NativeDoubleArray acceleration;
131 
133  madara::knowledge::containers::Integer battery_remaining;
134 
136  madara::knowledge::containers::Integer bridge_id;
137 
139  madara::knowledge::containers::String algorithm;
140 
142  madara::knowledge::containers::Integer algorithm_id;
143 
145  madara::knowledge::containers::Integer algorithm_rejects;
146 
148  madara::knowledge::containers::Integer algorithm_accepts;
149 
151  madara::knowledge::containers::Integer algorithm_changed;
152 
154  madara::knowledge::containers::Map algorithm_args;
155 
157  madara::knowledge::containers::String last_algorithm;
158 
160  madara::knowledge::containers::Integer last_algorithm_id;
161 
163  madara::knowledge::containers::Map last_algorithm_args;
164 
166  madara::knowledge::containers::String coverage_type;
167 
169  madara::knowledge::containers::Double desired_altitude;
170 
172  madara::knowledge::containers::NativeDoubleArray dest;
173 
175  madara::knowledge::containers::NativeDoubleArray dest_orientation;
176 
178  madara::knowledge::containers::NativeDoubleArray home;
179 
181  madara::knowledge::containers::Integer is_mobile;
182 
184  madara::knowledge::containers::NativeDoubleArray location;
185 
187  madara::knowledge::containers::NativeDoubleArray orientation;
188 
190  madara::knowledge::containers::Double min_alt;
191 
193  madara::knowledge::containers::String next_coverage_type;
194 
196  madara::knowledge::containers::Integer search_area_id;
197 
199  madara::knowledge::containers::NativeDoubleArray source;
200 
202  madara::knowledge::containers::NativeDoubleArray source_orientation;
203 
205  madara::knowledge::containers::Double temperature;
206 
208  madara::knowledge::containers::NativeDoubleArray velocity;
209 
212 
214  madara::knowledge::containers::Integer madara_debug_level;
215 
217  madara::knowledge::containers::Integer gams_debug_level;
218 
220  madara::knowledge::containers::Double send_hz;
221 
223  madara::knowledge::containers::Double loop_hz;
224 
226  std::string prefix;
227 
228  protected:
234  static std::string make_variable_name(
235  const madara::knowledge::KnowledgeRecord::Integer& id);
236 
241  };
242 
246  typedef std::vector <Agent> Agents;
247 
251  typedef std::map <std::string, Agent> AgentMap;
252 
259  GAMS_EXPORT void init_vars(Agents & variables,
260  madara::knowledge::KnowledgeBase & knowledge,
261  const madara::knowledge::KnowledgeRecord::Integer& processes);
262 
269  GAMS_EXPORT void init_vars(Agents & variables,
270  madara::knowledge::KnowledgeBase & knowledge,
271  const groups::GroupBase & group);
272  }
273 }
274 
275 #endif // _GAMS_VARIABLES_DEVICES_H_
Copyright(c) 2014 Carnegie Mellon University.
#define GAMS_EXPORT
Definition: GamsExport.h:20
Copyright(c) 2016 Carnegie Mellon University.
Base class for a group of agents.
Definition: GroupBase.h:91
A container for agent information.
Definition: Agent.h:80
madara::knowledge::containers::Double loop_hz
the rate to process the algorithm and platform MAPE loop
Definition: Agent.h:223
static bool is_agent(madara::knowledge::KnowledgeBase &knowledge, const std::string prefix)
Checks if the prefix points to an agent in the knowledge base.
void init_vars(madara::knowledge::KnowledgeBase &knowledge, const madara::knowledge::KnowledgeRecord::Integer &id)
Initializes variable containers.
std::string prefix
the prefix for this agent
Definition: Agent.h:226
madara::knowledge::containers::NativeDoubleArray source
the source location
Definition: Agent.h:199
madara::knowledge::containers::Integer bridge_id
indicator for whether or not the agent is busy with a mission
Definition: Agent.h:136
madara::knowledge::containers::Double min_alt
the minimum altitude for this agent
Definition: Agent.h:190
madara::knowledge::containers::NativeDoubleArray orientation
the angle for this device(roll, pitch, yaw)
Definition: Agent.h:187
madara::knowledge::containers::Double send_hz
the rate to send messages
Definition: Agent.h:220
static std::string make_variable_name(const madara::knowledge::KnowledgeRecord::Integer &id)
Create agent/local agent name.
madara::knowledge::containers::NativeDoubleArray acceleration
the acceleration vector of the platform
Definition: Agent.h:130
madara::knowledge::containers::Integer search_area_id
indicator for next assigned search area id
Definition: Agent.h:196
madara::knowledge::containers::String coverage_type
agent specific command
Definition: Agent.h:166
madara::knowledge::containers::NativeDoubleArray home
the home location
Definition: Agent.h:178
madara::knowledge::containers::Integer algorithm_accepts
number of algorithm accepts / changes
Definition: Agent.h:148
void init_vars(madara::knowledge::KnowledgeBase &knowledge, const std::string &prefix)
Initializes variable containers.
madara::knowledge::containers::NativeDoubleArray dest
the destination location
Definition: Agent.h:172
madara::knowledge::containers::Integer algorithm_id
the algorithm id(useful if algorithm requests may need to be resent)
Definition: Agent.h:142
madara::knowledge::containers::Integer battery_remaining
the battery indicator for this agent
Definition: Agent.h:133
madara::knowledge::containers::String algorithm
agent specific command
Definition: Agent.h:139
void init_variable_settings()
Set variable settings.
madara::knowledge::containers::Double temperature
indicator for temperature
Definition: Agent.h:205
madara::knowledge::containers::String last_algorithm
Last command.
Definition: Agent.h:157
void init_vars(madara::knowledge::Variables &knowledge, const madara::knowledge::KnowledgeRecord::Integer &id)
Initializes variable containers.
madara::knowledge::containers::Integer last_algorithm_id
Last command.
Definition: Agent.h:160
madara::knowledge::containers::Double desired_altitude
desired altitude in meters
Definition: Agent.h:169
madara::knowledge::containers::Integer madara_debug_level
the MADARA debug level
Definition: Agent.h:214
madara::knowledge::containers::Integer is_mobile
the mobility indicator for this agent(true if mobile)
Definition: Agent.h:181
madara::knowledge::containers::NativeDoubleArray dest_orientation
the destination orientation
Definition: Agent.h:175
madara::knowledge::containers::Map algorithm_args
arguments for algorithm
Definition: Agent.h:154
void operator=(const Agent &agent)
Assignment operator.
madara::knowledge::containers::Map last_algorithm_args
Last command args.
Definition: Agent.h:163
AccentStatuses accents
container for accents
Definition: Agent.h:211
madara::knowledge::containers::Integer algorithm_changed
agent specific command has changed
Definition: Agent.h:151
madara::knowledge::containers::NativeDoubleArray location
the location, usually encoded in GPS, for this agent
Definition: Agent.h:184
madara::knowledge::containers::NativeDoubleArray velocity
the velocity vector of the platform
Definition: Agent.h:208
madara::knowledge::containers::Integer gams_debug_level
the GAMS debug level
Definition: Agent.h:217
madara::knowledge::containers::String next_coverage_type
indicator for next type of area coverage requested(queue like)
Definition: Agent.h:193
madara::knowledge::containers::Integer algorithm_rejects
number of algorithm rejections(bad name or id)
Definition: Agent.h:145
madara::knowledge::containers::NativeDoubleArray source_orientation
the source angle
Definition: Agent.h:202
GAMS_EXPORT void init_vars(AccentStatuses &variables, madara::knowledge::KnowledgeBase &knowledge, const std::string &prefix)
Initializes accent status containers.
std::map< std::string, Agent > AgentMap
A map of agent prefixes to agent knowledge.
Definition: Agent.h:251
std::vector< AccentStatus > AccentStatuses
An array of accents.
Definition: AccentStatus.h:126
std::vector< Agent > Agents
An array of agent knowledge.
Definition: Agent.h:246
Contains all GAMS-related tools, classes and code.