Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
homogeneous1DRandomWalk.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 HOMOGENOUS1DRANDOMWALK_H
17 #define HOMOGENOUS1DRANDOMWALK_H
18 
19 #include "markovChain.h"
20 #include "Distribution/discreteDistribution.h"
21 #include "Distribution/geometricDistribution.h"
22 
33 {
34  protected:
35  int _size;
36  double* _stateSpace;
37  double _p;
38  double _q;
39  double _r;
41  public:
42  homogeneous1DRandomWalk( double l, double m );
43  homogeneous1DRandomWalk( int sz, double l, double m );
45 
46  void makeMarkovChain();
47 
48  discreteDistribution* transientDistribution( int t, int nMax );
52  simulateChain( long int tMax, bool stat, bool traj, bool trace );
53 
54  public:
55  void write(string format, string prefix);
56 
57 };
58 
59 #endif // HOMOGENOUS1DRANDOMWALK_H
void write(string format, string prefix)
Writes a homogeneous1DRandomWalk chain in files with some specified format. Supported formats: ...
Definition: homogeneous1DRandomWalk.cpp:352
Markov Chain class.
Definition: markovChain.h:32
void makeMarkovChain()
Instantiation of the generator for the markovChain ancestor.
Definition: homogeneous1DRandomWalk.cpp:86
~homogeneous1DRandomWalk()
Destructor for a homogeneous1DRandomWalk chain.
Definition: homogeneous1DRandomWalk.cpp:75
simulationResult * simulateChain(long int tMax, bool stat, bool traj, bool trace)
Simulates the evolution of a homogeneous1DRandomWalk chain.
Definition: homogeneous1DRandomWalk.cpp:218
geometricDistribution * stationaryDistribution()
Computes the stationary distribution for a homogeneous1DRandomWalk chain with infinite state space...
Definition: homogeneous1DRandomWalk.cpp:155
discreteDistribution * transientDistribution(int t, int nMax)
Computes the transient distribution for a RW1D Markov Chain.
Definition: homogeneous1DRandomWalk.cpp:114
double _r
r = 1 - p - q is the proba of staying in the same state
Definition: homogeneous1DRandomWalk.h:39
The 1-dimensional random walk with homogeneous transition probabilities. This model is characterized ...
Definition: homogeneous1DRandomWalk.h:32
double _p
the probability to jump to the right
Definition: homogeneous1DRandomWalk.h:37
homogeneous1DRandomWalk(double l, double m)
Constructor for a homogeneous1DRandomWalk chain with infinite state space.
Definition: homogeneous1DRandomWalk.cpp:35
string format()
Utility to get _format.
Definition: markovChain.h:182
double * _stateSpace
representation of the state space when finite
Definition: homogeneous1DRandomWalk.h:36
int _size
the number of states; possibly infinite
Definition: homogeneous1DRandomWalk.h:35
double _q
the probability to jump to the left
Definition: homogeneous1DRandomWalk.h:38
The geometric distribution with starting value 0. The parameter "p" is called "ratio".
Definition: geometricDistribution.h:27
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:18