Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
homogeneousMultiDRandomWalk.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 HOMOGENEOUSMULTIDRANDOMWALK_H
17 #define HOMOGENEOUSMULTIDRANDOMWALK_H
18 
19 #include "markovChain.h"
20 #include "Distribution/discreteDistribution.h"
21 
33 {
34 protected:
35  // variables specific to this class
36  int _nbDims;
37  double* _stateSpace;
38  int *_dimSize;
39  double* _p;
40  double* _q;
41  double _r;
43 private:
44  int *_mu;
46 public:
54  homogeneousMultiDRandomWalk( int nbDims, int* sz, double* p, double* q );
61  homogeneousMultiDRandomWalk( int nbDims, double* p, double* q );
66 
67  void makeMarkovChain();
68 
69 public:
79  int* simulateHittingTime(int iState, bool *hittingSet, int nbSamples , int tMax);
80 
81 public:
87  void write(string format, string modelName);
88 
89 };
90 
91 #endif // HOMOGENEOUSMULTIDRANDOMWALK_H
Markov Chain class.
Definition: markovChain.h:32
double * _p
the probability to jump to the right
Definition: homogeneousMultiDRandomWalk.h:39
string modelName()
Utility to get _modelName.
Definition: markovChain.h:176
double _r
r = 1 - sum_i( p_i + q_i ) is the proba of staying in the same state
Definition: homogeneousMultiDRandomWalk.h:41
~homogeneousMultiDRandomWalk()
Standard destructor.
Definition: homogeneousMultiDRandomWalk.cpp:92
double * _stateSpace
representation of the state space when finite
Definition: homogeneousMultiDRandomWalk.h:37
int * _dimSize
size of the state space in each dimension
Definition: homogeneousMultiDRandomWalk.h:38
discreteDistribution * stationaryDistribution()
Computes the stationary distribution of the chain. These Markov chains have a product-form stationary...
Definition: homogeneousMultiDRandomWalk.cpp:125
string format()
Utility to get _format.
Definition: markovChain.h:182
void makeMarkovChain()
Instantiation of the generator for the markovChain ancestor Works only for dimension 2...
Definition: homogeneousMultiDRandomWalk.cpp:104
homogeneousMultiDRandomWalk(int nbDims, int *sz, double *p, double *q)
Constructor for the class. The initial state is set arbitrarily to (0,...,0).
Definition: homogeneousMultiDRandomWalk.cpp:56
The general d-dimensional random walk with homogeneous transition probabilities. This model is charac...
Definition: homogeneousMultiDRandomWalk.h:32
void write(string format, string modelName)
General output procedure for this class of Markov chains.
Definition: homogeneousMultiDRandomWalk.cpp:222
int * simulateHittingTime(int iState, bool *hittingSet, int nbSamples, int tMax)
Obtain samples of hitting times through Monte Carlo simulation. A trajectory is simulated until it hi...
Definition: homogeneousMultiDRandomWalk.cpp:176
The general discrete distribution with finite support.
Definition: discreteDistribution.h:25
double * _q
the probability to jump to the left
Definition: homogeneousMultiDRandomWalk.h:40
int _nbDims
number of dimensions of the grid. Is equal to 2 here
Definition: homogeneousMultiDRandomWalk.h:36