libRoadRunner C++ API  1.0.0
 All Classes Functions Variables Enumerations Enumerator Pages
rrExecutableModel.h
1 #ifndef rrExecutableModelH
2 #define rrExecutableModelH
3 #include "rrOSSpecifics.h"
4 
5 #include <stdint.h>
6 #include <string>
7 #include <list>
8 #include <ostream>
9 
10 namespace rr
11 {
12 
26 class RR_DECLSPEC ExecutableModel
27 {
28 public:
32  virtual std::string getModelName() = 0;
33 
34  virtual void setTime(double _time) = 0;
35  virtual double getTime() = 0;
36 
53  virtual void evalInitialConditions() = 0;
54 
60  virtual void reset() = 0;
61 
62 
63 
64  /************************ Floating Species Section ****************************/
65  #if (1) /**********************************************************************/
66  /******************************************************************************/
67 
72  virtual int getNumDepFloatingSpecies() = 0;
73 
77  virtual int getNumFloatingSpecies() = 0;
78 
79  virtual int getFloatingSpeciesIndex(const std::string& eid) = 0;
80  virtual std::string getFloatingSpeciesId(int index) = 0;
81 
86  virtual int getNumIndFloatingSpecies() = 0;
87 
96  virtual int getFloatingSpeciesAmounts(int len, int const *indx,
97  double *values) = 0;
98 
99  virtual int setFloatingSpeciesAmounts(int len, int const *indx,
100  const double *values) = 0;
101 
102  virtual int getFloatingSpeciesAmountRates(int len, int const *indx,
103  double *values) = 0;
104 
105 
106  virtual int getFloatingSpeciesConcentrationRates(int len, int const *indx,
107  double *values) = 0;
108 
117  virtual int getFloatingSpeciesConcentrations(int len, int const *indx,
118  double *values) = 0;
119 
128  virtual int setFloatingSpeciesConcentrations(int len, int const *indx,
129  double const *values) = 0;
130 
141  virtual int setFloatingSpeciesInitConcentrations(int len, int const *indx,
142  double const *values) = 0;
143 
148  virtual int getFloatingSpeciesInitConcentrations(int len, int const *indx,
149  double *values) = 0;
150 
161  virtual int setFloatingSpeciesInitAmounts(int len, int const *indx,
162  double const *values) = 0;
163 
168  virtual int getFloatingSpeciesInitAmounts(int len, int const *indx,
169  double *values) = 0;
170 
171  /************************ End Floating Species Section ************************/
172  #endif /***********************************************************************/
173  /******************************************************************************/
174 
175 
176 
177  /************************ Boundary Species Section ****************************/
178  #if (1) /**********************************************************************/
179  /******************************************************************************/
180 
181 
185  virtual int getNumBoundarySpecies() = 0;
186  virtual int getBoundarySpeciesIndex(const std::string &eid) = 0;
187  virtual std::string getBoundarySpeciesId(int index) = 0;
188 
197  virtual int getBoundarySpeciesAmounts(int len, int const *indx,
198  double *values) = 0;
199 
200 
209  virtual int getBoundarySpeciesConcentrations(int len, int const *indx,
210  double *values) = 0;
211 
220  virtual int setBoundarySpeciesConcentrations(int len, int const *indx,
221  double const *values) = 0;
222 
223 
224  /************************ End Boundary Species Section ************************/
225  #endif /***********************************************************************/
226  /******************************************************************************/
227 
228 
229  /************************ Global Parameters Section ***************************/
230  #if (1) /**********************************************************************/
231  /******************************************************************************/
232 
236  virtual int getNumGlobalParameters() = 0;
237 
241  virtual int getGlobalParameterIndex(const std::string& eid) = 0;
242 
246  virtual std::string getGlobalParameterId(int index) = 0;
247 
256  virtual int getGlobalParameterValues(int len, int const *indx,
257  double *values) = 0;
258 
259  virtual int setGlobalParameterValues(int len, int const *indx,
260  const double *values) = 0;
261 
262 
263  /************************ Global Parameters Species Section *******************/
264  #endif /***********************************************************************/
265  /******************************************************************************/
266 
267 
268  /************************ Compartments Section ********************************/
269  #if (1) /**********************************************************************/
270  /******************************************************************************/
271 
272  virtual int getNumCompartments() = 0;
273  virtual int getCompartmentIndex(const std::string& eid) = 0;
274  virtual std::string getCompartmentId(int index) = 0;
275 
284  virtual int getCompartmentVolumes(int len, int const *indx,
285  double *values) = 0;
286 
287  virtual int setCompartmentVolumes(int len, int const *indx,
288  const double *values) = 0;
289 
300  virtual int setCompartmentInitVolumes(int len, int const *indx,
301  double const *values) = 0;
302 
307  virtual int getCompartmentInitVolumes(int len, int const *indx,
308  double *values) = 0;
309 
310 
311  /************************ End Compartments Species Section ********************/
312  #endif /***********************************************************************/
313  /******************************************************************************/
314 
315 
316  /************************ Selection Ids Species Section ***********************/
317  #if (1) /**********************************************************************/
318  /******************************************************************************/
319 
328  virtual void getIds(int types, std::list<std::string> &ids) = 0;
329 
333  virtual int getSupportedIdTypes() = 0;
334 
339  virtual double getValue(const std::string& id) = 0;
340 
344  virtual void setValue(const std::string& id, double value) = 0;
345 
346 
347  /************************ End Selection Ids Species Section *******************/
348  #endif /***********************************************************************/
349  /******************************************************************************/
350 
361  virtual int getStoichiometryMatrix(int* rows, int* cols, double** data) = 0;
362 
368  virtual double getStoichiometry(int speciesIndex, int reactionIndex) = 0;
369 
370 
371  virtual int getNumConservedMoieties() = 0;
372  virtual int getConservedMoietyIndex(const std::string& eid) = 0;
373  virtual std::string getConservedMoietyId(int index) = 0;
374  virtual int getConservedMoietyValues(int len, int const *indx, double *values) = 0;
375  virtual int setConservedMoietyValues(int len, int const *indx,
376  const double *values) = 0;
377 
378  virtual int getNumRules() = 0;
379 
383  virtual int getNumReactions() = 0;
384 
389  virtual int getReactionIndex(const std::string& eid) = 0;
390 
394  virtual std::string getReactionId(int index) = 0;
395 
396  virtual int getReactionRates(int len, int const *indx,
397  double *values) = 0;
398 
404  virtual void evalReactionRates() = 0;
405 
420  virtual void setRateRuleValues(const double *rateRuleValues) = 0;
421 
429  virtual void getRateRuleValues(double *rateRuleValues) = 0;
430 
441  virtual int getStateVector(double *stateVector) = 0;
442 
452  virtual int setStateVector(const double *stateVector) = 0;
453 
454 
455  virtual void convertToConcentrations() = 0;
456  virtual void updateDependentSpeciesValues() = 0;
457  virtual void computeAllRatesOfChange() = 0;
458 
475  virtual void evalModel(double time, const double *y, double* dydt=0) = 0;
476 
477  virtual void testConstraints() = 0;
478 
479  virtual std::string getInfo() = 0;
480 
481  virtual void print(std::ostream &stream) = 0;
482 
483  /******************************* Events Section *******************************/
484  #if (1) /**********************************************************************/
485  /******************************************************************************/
486 
487  virtual int getNumEvents() = 0;
488 
499  virtual int getEventTriggers(int len, const int *indx, unsigned char *values) = 0;
500 
501  virtual void evalEvents(double timeEnd, const unsigned char* previousEventStatus,
502  const double *initialState, double* finalState) = 0;
503 
504  virtual int applyPendingEvents(const double *stateVector, double timeEnd, double tout) = 0;
505 
517  virtual void evalEventRoots(double time, const double* y, double* gdot) = 0;
518 
519  virtual double getNextPendingEventTime(bool pop) = 0;
520 
521  virtual int getPendingEventSize() = 0;
522 
523  virtual void resetEvents() = 0;
524 
531  virtual ~ExecutableModel() {};
532 
533  /******************************* Events Section *******************************/
534  #endif /**********************************************************************/
535  /******************************************************************************/
536 
537  /******************************* Deprecated Section ***************************/
538 
543  virtual bool getConservedSumChanged() = 0;
544 
549  virtual void computeConservedTotals() = 0;
550 
555  virtual void setConservedSumChanged(bool) = 0;
556 
564  virtual void convertToAmounts() = 0;
565 };
566 
570 RR_DECLSPEC std::ostream& operator << (std::ostream &stream, ExecutableModel* model);
571 
572 
573 }
574 #endif
virtual ~ExecutableModel()
Definition: rrExecutableModel.h:531
Definition: rrExecutableModel.h:26