GAMS  1.2.2
JavaAlgorithm.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_ALGORITHM_JAVA_H_
55 #define _GAMS_ALGORITHM_JAVA_H_
56 
57 #include "gams/variables/Self.h"
58 #include "gams/variables/Sensor.h"
62 #include "madara/knowledge/KnowledgeBase.h"
64 
65 #ifdef _GAMS_JAVA_
66 #include <jni.h>
67 #include "gams_jni.h"
68 #endif
69 
70 namespace gams
71 {
72  namespace algorithms
73  {
78  {
79  public:
90  jobject obj,
91  madara::knowledge::KnowledgeBase * knowledge = 0,
92  platforms::BasePlatform * platform = 0,
93  variables::Sensors * sensors = 0,
94  variables::Self * self = 0,
95  variables::Agents * agents = 0);
96 
100  ~JavaAlgorithm ();
101 
106  void operator= (const JavaAlgorithm & rhs);
107 
112  virtual int analyze (void);
113 
118  virtual int execute (void);
119 
124  virtual int plan (void);
125 
131  virtual std::string get_id () const;
132 
136  virtual std::string get_name () const;
137 
142  jobject get_java_instance (void);
143 
144  protected:
146  jobject obj_;
147 
149  jclass class_;
150  };
151 
152 
157  {
158  public:
159 
164  JavaAlgorithmFactory (jobject obj);
165 
169  virtual ~JavaAlgorithmFactory ();
170 
187  virtual BaseAlgorithm * create (
188  const madara::knowledge::KnowledgeMap & args,
189  madara::knowledge::KnowledgeBase * knowledge,
190  platforms::BasePlatform * platform,
191  variables::Sensors * sensors,
192  variables::Self * self,
193  variables::Agents * agents);
194 
199  jobject get_java_instance (void);
200 
201  protected:
203  jobject obj_;
204  };
205  }
206 }
207 
208 #endif // _GAMS_ALGORITHM_JAVA_H_
Base class for algorithm factories that classes derived from.
Copyright (c) 2014 Carnegie Mellon University.
A factory class for creating Java Algorithms.
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
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.
A facade for Java algorithms.
Definition: JavaAlgorithm.h:77
Contains all GAMS-related tools, classes and code.
A container for self referencing information.
Definition: Self.h:69
Copyright (c) 2014 Carnegie Mellon University.
#define GAMS_EXPORT
Definition: GamsExport.h:20
jclass class_
the class of the Java object obj_
The base class that algorithms in GAMS use.
Definition: BaseAlgorithm.h:94
Copyright (c) 2014 Carnegie Mellon University.
jobject obj_
the Java object with callable methods
Copyright (c) 2014 Carnegie Mellon University.
jobject obj_
the Java object with callable methods