VPTissue Reference Manual
SimState.h
Go to the documentation of this file.
1 #ifndef SIMSTATE_H_INCLUDED
2 #define SIMSTATE_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "bio/MeshState.h"
23 
24 #include <boost/property_tree/ptree.hpp>
25 #include <ostream>
26 
27 namespace SimPT_Sim {
28 
33 class SimState
34 {
35 public:
37  int GetTimeStep() const;
38 
40  double GetTime() const;
41 
43  MeshState GetMeshState() const;
44 
46  boost::property_tree::ptree GetParameters() const;
47 
49  std::string GetProjectName() const;
50 
52  boost::property_tree::ptree GetRandomEngineState() const;
53 
56  void SetTimeStep(int step);
57 
60  void SetTime(double t);
61 
63  void SetMeshState(MeshState const& mesh_state);
64 
67  void SetParameters(boost::property_tree::ptree const& parameters);
68 
70  void SetProjectName(std::string project_name);
71 
74  void SetRandomEngineState(boost::property_tree::ptree const& re_state);
75 
79  void PrintToStream(std::ostream& out) const;
80 
81 private:
82  double m_time;
83  int m_time_step;
84  MeshState m_mesh_state;
85  boost::property_tree::ptree m_parameters;
86  boost::property_tree::ptree m_re_state;
87  std::string m_project_name;
88 };
89 
90 } // namespace
91 
92 #endif // end_of_include_guard
93 
double GetTime() const
Returns the value of the current time step in seconds.
Definition: SimState.cpp:40
void SetRandomEngineState(boost::property_tree::ptree const &re_state)
Sets the state of the random number engine used for generating random in the simulation.
Definition: SimState.cpp:90
Interface of MeshState.
MeshState GetMeshState() const
Get the state of the mesh.
Definition: SimState.cpp:45
void PrintToStream(std::ostream &out) const
Prints a text representation to the given output stream.
Definition: SimState.cpp:95
Namespace for the core simulator.
void SetMeshState(MeshState const &mesh_state)
Sets the current state of the mesh in the simulation.
Definition: SimState.cpp:75
void SetTimeStep(int step)
Sets the index of the current time step.
Definition: SimState.cpp:65
std::string GetProjectName() const
Returns the name of the associated project.
Definition: SimState.cpp:55
void SetParameters(boost::property_tree::ptree const &parameters)
Sets the parameters currently used simulation model.
Definition: SimState.cpp:80
Contains the state of the whole Simulator at a given simulation step.
Definition: SimState.h:33
boost::property_tree::ptree GetParameters() const
Returns the parameters currently used simulation model.
Definition: SimState.cpp:50
Contains the state of the whole Mesh at a given simulation step.
Definition: MeshState.h:41
int GetTimeStep() const
Returns the index of the current time step.
Definition: SimState.cpp:35
void SetTime(double t)
Sets the value of the current time step in seconds.
Definition: SimState.cpp:70
void SetProjectName(std::string project_name)
Sets the name of the associated project.
Definition: SimState.cpp:85
boost::property_tree::ptree GetRandomEngineState() const
Returns the state of the random engine in a ptree.
Definition: SimState.cpp:60