C API Documentation
rrRoadRunnerOptions.h
1 /*
2 * rrRoadRunnerOptions.h
3 *
4 * Created on: Sep 9, 2013
5 * Author: andy
6 */
7 
8 #ifndef RRROADRUNNEROPTIONS_H_
9 #define RRROADRUNNEROPTIONS_H_
10 
11 #include "rrExporter.h"
12 #include "Dictionary.h"
13 #include "Integrator.h"
14 
15 #include <string>
16 #include <vector>
17 #include "tr1proxy/rr_memory.h"
18 #include "tr1proxy/rr_unordered_map.h"
19 
20 #include <stdint.h>
21 
22 namespace rr
23 {
24 
31  class RR_DECLSPEC LoadSBMLOptions : public BasicDictionary
32  {
33  public:
35  {
45  CONSERVED_MOIETIES = (0x1 << 0), // => 0x00000001
46 
58  RECOMPILE = (0x1 << 1), // => 0x00000010
59 
69  READ_ONLY = (0x1 << 2), // => 0x00000100
70 
75  MUTABLE_INITIAL_CONDITIONS = (0x1 << 3), // => 0x00001000
76 
81  OPTIMIZE_GVN = (0x1 << 4),
82 
87  OPTIMIZE_CFG_SIMPLIFICATION = (0x1 << 5),
88 
94  OPTIMIZE_INSTRUCTION_COMBINING = (0x1 << 6),
95 
101  OPTIMIZE_DEAD_INST_ELIMINATION = (0x1 << 7),
102 
109  OPTIMIZE_DEAD_CODE_ELIMINATION = (0x1 << 8),
110 
114  OPTIMIZE_INSTRUCTION_SIMPLIFIER = (0x1 << 9),
115 
120  OPTIMIZE = OPTIMIZE_GVN | OPTIMIZE_CFG_SIMPLIFICATION |
121  OPTIMIZE_INSTRUCTION_COMBINING |
122  OPTIMIZE_DEAD_INST_ELIMINATION | OPTIMIZE_DEAD_CODE_ELIMINATION |
123  OPTIMIZE_INSTRUCTION_SIMPLIFIER,
124 
133  USE_MCJIT = (0x1 << 10),
134 
135 
136  LLVM_SYMBOL_CACHE = (0x1 << 11),
137 
141  TURN_ON_VALIDATION = (0x1 << 12)
142  };
143 
144  enum LoadOpt
145  {
149  NO_DEFAULT_SELECTIONS = (0x1 << 0) // => 0x00000001
150  };
151 
156 
161 
165  uint16_t version;
166 
170  uint16_t size;
171 
172 
173  uint32_t modelGeneratorOpt;
174 
175  uint32_t loadFlags;
176 
177 
181  virtual void setItem(const std::string& key, const rr::Variant& value);
182 
186  virtual Variant getItem(const std::string& key) const;
187 
193  virtual bool hasKey(const std::string& key) const;
194 
198  virtual size_t deleteItem(const std::string& key);
199 
203  virtual std::vector<std::string> getKeys() const;
204 
205 
206  inline bool getConservedMoietyConversion() const {
207  return modelGeneratorOpt & CONSERVED_MOIETIES;
208  }
209 
210  inline void setConservedMoietyConversion(bool val) {
211  modelGeneratorOpt = val ?
212  modelGeneratorOpt | CONSERVED_MOIETIES :
213  modelGeneratorOpt & ~CONSERVED_MOIETIES;
214  }
215 
216  inline void setValidation(bool val) {
217  loadFlags = val ?
218  loadFlags | TURN_ON_VALIDATION :
219  loadFlags & ~TURN_ON_VALIDATION;
220  }
221 
222  virtual ~LoadSBMLOptions();
223 
224  private:
225 
226  // load default values;
227  void defaultInit();
228  };
229 
241  class RR_DECLSPEC SimulateOptions : public BasicDictionary
242  {
243  public:
244 
249 
264 
271  int steps;
272 
277  double start;
278 
282  double duration;
283 
284 
291  std::string output_file;
292 
307  std::vector<std::string> variables;
308 
314  std::vector<std::string> amounts;
315 
321  std::vector<std::string> concentrations;
322 
326  std::string toString() const;
327 
331  std::string toRepr() const;
332 
333  /* Use this method to load SimulateOptions from an SBML file. Previously this was done by
334  * passing the filepath into the SimulateOptions constructor. However, the refactor has
335  * removed some properties from SimulateOptions and placed them in specific integrators. As
336  * a result, both the SimulateOptions and Integrator classes will have methods that allow
337  * users to read an SBML settings file.
338  */
339  void loadSBMLSettings(const std::string& filename);
340 
341  virtual void setItem(const std::string& key, const rr::Variant& value);
342 
343  };
344 
345 
346 
351  struct RR_DECLSPEC RoadRunnerOptions
352  {
353  enum Options
354  {
362  DISABLE_PYTHON_DYNAMIC_PROPERTIES = (0x1 << 0), // => 0x00000001
363  };
364 
368  uint32_t flags;
369 
374 
379 
380  };
381 
382 
383 } /* namespace rr */
384 #endif /* RRROADRUNNEROPTIONS_H_ */
RoadRunner's Gillespie SSA integrator.
This class is frozen, no new features Basic implementation of the Dictionary interface which uses a s...
Definition: Dictionary.h:141
This class is frozen, no new features A dictionary interface that objects can implement....
Definition: Dictionary.h:31
Definition: rrRoadRunnerOptions.h:32
uint16_t version
Definition: rrRoadRunnerOptions.h:165
LoadSBMLOptions(const Dictionary *dict)
virtual std::vector< std::string > getKeys() const
virtual void setItem(const std::string &key, const rr::Variant &value)
virtual bool hasKey(const std::string &key) const
LoadOpt
Definition: rrRoadRunnerOptions.h:145
ModelGeneratorOpt
Definition: rrRoadRunnerOptions.h:35
uint16_t size
Definition: rrRoadRunnerOptions.h:170
virtual Variant getItem(const std::string &key) const
virtual size_t deleteItem(const std::string &key)
This class is frozen, no new features RoadRunner simulation options.
Definition: rrRoadRunnerOptions.h:242
std::vector< std::string > variables
Definition: rrRoadRunnerOptions.h:307
std::string output_file
Definition: rrRoadRunnerOptions.h:291
virtual void setItem(const std::string &key, const rr::Variant &value)
std::vector< std::string > amounts
Definition: rrRoadRunnerOptions.h:314
int steps
Definition: rrRoadRunnerOptions.h:271
std::vector< std::string > concentrations
Definition: rrRoadRunnerOptions.h:321
bool reset_model
Definition: rrRoadRunnerOptions.h:253
double duration
Definition: rrRoadRunnerOptions.h:282
bool structured_result
Definition: rrRoadRunnerOptions.h:258
bool copy_result
Definition: rrRoadRunnerOptions.h:263
double start
Definition: rrRoadRunnerOptions.h:277
std::string toRepr() const
std::string toString() const
Definition: Variant.h:75
Definition: rrRoadRunnerOptions.h:352
double jacobianStepSize
Definition: rrRoadRunnerOptions.h:373
Options
Definition: rrRoadRunnerOptions.h:354
uint32_t flags
Definition: rrRoadRunnerOptions.h:368