GAMS  1.4.0
AgentFormation.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_FORMATIONS_AGENT_FORMATION_H_
55 #define _GAMS_FORMATIONS_AGENT_FORMATION_H_
56 
57 #include <vector>
58 #include <string>
59 #include <map>
60 
61 #include "madara/knowledge/KnowledgeBase.h"
62 #include "madara/knowledge/containers/StringVector.h"
63 #include "gams/groups/GroupBase.h"
65 
66 namespace gams
67 {
68  namespace formations
69  {
74  {
75  public:
80 
84  virtual ~AgentFormation();
85 
90  virtual void from_args(madara::knowledge::FunctionArguments & args) = 0;
91 
98  virtual double goodness(
99  const std::string & id = "", double buffer = 3.0) const = 0;
100 
105  void set_id(const std::string & id);
106 
113  virtual bool is_member(const std::string & id = "") const = 0;
114 
121  virtual bool is_extra(const std::string & id = "") const = 0;
122 
123  protected:
124 
128  madara::knowledge::KnowledgeBase * knowledge_;
129 
133  std::string id_;
134 
139  };
140  }
141 }
142 
143 #include "AgentFormation.inl"
144 
145 #endif // _GAMS_FORMATIONS_AGENT_FORMATION_H_
Copyright(c) 2016 Carnegie Mellon University.
Copyright(c) 2016 Carnegie Mellon University.
virtual bool is_member(const std::string &id="") const =0
Checks if the agent is a member of the formation.
virtual ~AgentFormation()
Constructor.
madara::knowledge::KnowledgeBase * knowledge_
The knowledge base to use as a data plane.
groups::GroupFactoryRepository group_factory_
The group factory.
void set_id(const std::string &id)
Sets the id of the current agent(e.g.
virtual double goodness(const std::string &id="", double buffer=3.0) const =0
Checks the goodness of an agent in the current formation.
std::string id_
The current agent id.
virtual void from_args(madara::knowledge::FunctionArguments &args)=0
Configures the formation from arguments.
virtual bool is_extra(const std::string &id="") const =0
Checks if the agent is an extra member of the formation.
A repository for group factories.
Contains all GAMS-related tools, classes and code.