Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
simulationResult.h
1 /* Marmote is free software: you can redistribute it and/or modify
2 it under the terms of the GNU General Public License as published by
3 the Free Software Foundation, either version 3 of the License, or
4 (at your option) any later version.
5 
6 Marmote is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 GNU General Public License for more details.
10 
11 You should have received a copy of the GNU General Public License
12 along with Marmote. If not, see <http://www.gnu.org/licenses/>.
13 
14 Copyright 2015 Alain Jean-Marie, Jean-Michel Fourneau, Jean-Marc Vincent, Issam Rabhi */
15 
16 #ifndef SIMULATIONRESULT_H
17 #define SIMULATIONRESULT_H
18 
19 using namespace std;
20 
21 #include <string.h>
22 #include "Distribution/discreteDistribution.h"
23 #include "marmoteConstants.h" // at least for the definition of enum timeType
24 
34 {
35  private:
36  timeType _type;
37  int _stateSpaceSize;
38  int _trajectorySize;
39  bool _hasDistrib;
40  bool _hasTrajectory;
41  discreteDistribution* _distrib;
42  double* _dates;
43  double* _increments;
44  int* _states;
46  public:
47  // constructors
55  simulationResult( int size, timeType t, bool stats );
63  simulationResult( string format, string modelName, bool stats );
64 
65  // destructor
71 
72  public:
73  // accessors
79  void setTrajectory(bool v) { _hasTrajectory = v; }
85  void setTrajectorySize(int l) { _trajectorySize = l; }
93  void setTrajectory(double* d, int *s) { _dates = d; _states = s; }
100  void distrib(discreteDistribution *d) { _distrib = d; }
106  discreteDistribution* getDistribution() { return _distrib; }
107 
108 public:
109  // output methods
115  void writeTrajectory( FILE* out, string format );
116 
117 private:
118  // technical private methods
127  ssize_t getDataLine(char** line, size_t *n, FILE* stream);
128 
129 };
130 
131 #endif // SIMULATIONRESULT_H
void setTrajectory(double *d, int *s)
Sets the trajectory element of the object, from pointers to tables. Tables are not copied...
Definition: simulationResult.h:93
Utilization of the Standard Template Library.
void setTrajectorySize(int l)
Sets the size of the trajectory.
Definition: simulationResult.h:85
void distrib(discreteDistribution *d)
Sets the empirical distribution, from a distribution object. The object is not copied.
Definition: simulationResult.h:100
void setTrajectory(bool v)
Sets the boolean indicating is a trajectory is present.
Definition: simulationResult.h:79
discreteDistribution * getDistribution()
Accessor to the empirical distribution.
Definition: simulationResult.h:106
The general discrete distribution with finite support.
Definition: discreteDistribution.h:25
The class for transmitting (Monte Carlo) simulation results between objects. Simulation results may b...
Definition: simulationResult.h:33