roadrunner  2.6.0
Fast simulator for SBML models
rrSBMLModelSimulation.h
1 #ifndef rrSBMLModelSimulationH
2 #define rrSBMLModelSimulationH
3 //---------------------------------------------------------------------------
4 #include <string>
5 #include <filesystem>
6 #include "rrExporter.h"
7 #include "rrStringUtils.h"
8 #include "rrRoadRunnerOptions.h"
9 #include "rrRoadRunnerData.h"
10 
11 namespace rr
12 {
13 
14 class RoadRunner;
15 
21 class RR_DECLSPEC SBMLModelSimulation
22 {
23  protected:
24  std::string mModelFileName;
25  std::filesystem::path mModelFilePath;
26  std::filesystem::path mModelSettingsFileName;
27  std::filesystem::path mSimulationLogFile;
28  std::filesystem::path mDataOutputFolder;
29  std::filesystem::path mTempDataFolder;
30  RoadRunner *mEngine;
31  SimulateOptions mSettings;
32  bool mCompileIfDllExists;
33 
34  public:
35  SBMLModelSimulation(std::filesystem::path dataOutputFolder = "", std::filesystem::path tempDataFilePath = "");
36  virtual ~SBMLModelSimulation();
37  bool SetModelFilePath(const std::filesystem::path& path);
38  bool SetModelFileName(const std::string& name);
39  bool SetDataOutputFolder(const std::filesystem::path& name);
40  std::filesystem::path GetModelsFullFilePath();
41  std::filesystem::path GetDataOutputFolder();
42  std::filesystem::path GetTempDataFolder();
43  bool UseEngine(RoadRunner* engine);
44 
45 
46  bool SaveModelAsXML( std::filesystem::path& folder);
47 
48  //wrappers
49  bool SetTimeStart(const double& tStart);
50  bool SetTimeEnd(const double& tEnd);
51  bool SetNumberOfPoints(const int& pts);
52  bool SetSelectionList(const std::string& list);
53  virtual bool LoadSBMLFromFile(); //Use current file information to load sbml from file
54  virtual bool Simulate();
55  virtual bool SaveResult();
56  void loadSBMLTolerances(std::filesystem::path const& filename);
57  virtual bool LoadSettings(const std::filesystem::path& fName = "");
58  virtual RoadRunnerData GetResult();
59 
60  void ReCompileIfDllExists(const bool& doIt);
61  bool DoCompileIfDllExists();
62 
63 // // models are created by loadSBML, if a shared lib already exits, it is loaded.
64  bool CreateModel();
65  bool GenerateModelCode();
66  bool CompileModel();
67  bool GenerateAndCompileModel();
68 
70  double mAbsolute;
72  double mRelative;
73 };
75 }
76 
77 
78 
79 #endif