C API Documentation
RK4Integrator.h
1 /*
2  * RK4Integrator.h
3  *
4  * Created on: Jul 22, 2014
5  * Author: andy
6  */
7 
8 #ifndef RK4Integrator_H_
9 #define RK4Integrator_H_
10 
11 #include <Integrator.h>
12 #include <rrRoadRunnerOptions.h>
13 
14 namespace rr
15 {
16 
17 
28  class RK4Integrator: public Integrator
29  {
30  public:
31 
32 
49 
53  virtual ~RK4Integrator();
54 
60  virtual void syncWithModel(ExecutableModel* m);
61 
62 
66  public:
67 
71  virtual double integrate(double t0, double tf);
72 
77  virtual void restart(double t0);
78 
80  //* get a description of this object, compatable with python __str__
81  //*/
82  //virtual std::string toString() const;
83 
85  //* get a short descriptions of this object, compatable with python __repr__.
86  //*/
87  //virtual std::string toRepr() const;
88 
89  // ** Meta Info ********************************************************
90 
96  std::string getName() const;
97 
102  static std::string getRK4Name();
103 
109  std::string getDescription() const;
110 
115  static std::string getRK4Description();
116 
122  std::string getHint() const;
123 
128  static std::string getRK4Hint();
129 
130  // ** Getters / Setters ************************************************
131 
132  virtual Variant getValue(std::string key);
133 
138  IntegrationMethod getIntegrationMethod() const;
139 
145 
146  // ** Listeners ********************************************************
147 
152  virtual void setListener(IntegratorListenerPtr);
153 
157  virtual IntegratorListenerPtr getListener();
158 
159  public:
160 
164 // virtual void setItem(const std::string& key, const rr::Variant& value);
165 
169 // virtual Variant getItem(const std::string& key) const;
170 
174 // virtual bool hasKey(const std::string& key) const;
175 
179 // virtual int deleteItem(const std::string& key);
180 
184 // virtual std::vector<std::string> getKeys() const;
185 
186 
187  private:
188  ExecutableModel *model;
189 
190  unsigned stateVectorSize;
191 
195  double *k1, *k2, *k3, *k4, *y, *ytmp;
196 
197  void testRootsAtInitialTime();
198  void applyEvents(double timeEnd, std::vector<unsigned char> &previousEventStatus);
199 
200  };
201 
202 
203  // ** Registration *********************************************************
204 
205 
207  public:
212  virtual std::string getName() const {
213  return RK4Integrator::getRK4Name();
214  }
215 
220  virtual std::string getDescription() const {
222  }
223 
228  virtual std::string getHint() const {
229  return RK4Integrator::getRK4Hint();
230  }
231 
236  virtual Integrator* construct(ExecutableModel *model) const {
237  return new RK4Integrator(model);
238  }
239  };
240 
241 } /* namespace rr */
242 
243 #endif /* RK4Integrator_H_ */
RoadRunner's Gillespie SSA integrator.
Base class for all code generation systems; allows compiling and evaluating the model.
Definition: rrExecutableModel.h:118
Definition: Integrator.h:62
Handles constructing an integrator and contains meta information about it.
Definition: Integrator.h:161
Definition: RK4Integrator.h:29
virtual void restart(double t0)
std::string getHint() const
Get the hint for this integrator.
static std::string getRK4Name()
Get the name for this integrator.
IntegrationMethod getIntegrationMethod() const
Always deterministic for RK4.
virtual IntegratorListenerPtr getListener()
virtual double integrate(double t0, double tf)
virtual void setListener(IntegratorListenerPtr)
static std::string getRK4Hint()
Get the hint for this integrator.
virtual void syncWithModel(ExecutableModel *m)
Called whenever a new model is loaded to allow integrator to reset internal state.
RK4Integrator(ExecutableModel *m)
std::string getDescription() const
Get the description for this integrator.
static std::string getRK4Description()
Get the description for this integrator.
virtual ~RK4Integrator()
std::string getName() const
‍**
void resetSettings()
Reset all integrator settings to their respective default values.
Definition: RK4Integrator.h:206
virtual Integrator * construct(ExecutableModel *model) const
Constructs a new integrator of a given type.
Definition: RK4Integrator.h:236
virtual std::string getDescription() const
Gets the description associated with this integrator type.
Definition: RK4Integrator.h:220
virtual std::string getHint() const
Gets the hint associated with this integrator type.
Definition: RK4Integrator.h:228
virtual std::string getName() const
Gets the name associated with this integrator type.
Definition: RK4Integrator.h:212
Definition: Variant.h:75