User Manual, Developers Guide and API Documentation

wns::markovchain::MarkovBase< T > Class Template Reference

Base Class to represent a Markov Process. More...

#include <markovchain/MarkovBase.hpp>

Inheritance diagram for wns::markovchain::MarkovBase< T >:

Inheritance graph
[legend]
Collaboration diagram for wns::markovchain::MarkovBase< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

int getActualStateIndex (int actualchain) const
 get the actual state index for a certain chain
const T * getStateContent (int index) const
 returns a state from the vector of states
const std::vector< double > & getStateProbabilities () const
double getStateProbability (int stateIndex) const
 get the state probability for a state
const std::vector< T > & getStates () const
 get Vector of States
double getTransitionMatrixElement (int row, int col) const
 get Transitions/probabilities Matrix elements
 MarkovBase (int nos, int noc, std::vector< T > states, TransitionMatrixType matrix, std::vector< int > sStates)
 Creates a Complete MarkovBase.
 MarkovBase (int _numberOfChains)
 Creates an empty MarkovBase. numberOfChains is needed.
int readNumberOfStates (std::istream &in)
 Reads the number of states from a stream.
void readTransitionsFromFile (std::istream &in)
 Reads the matrix of transitions/probabilities between the states from a stream.
void setNumberOfStates (int _numberOfStates)
 setNumberOfStates. The allocation of vectors and matrices is done afterwards
void setStartStates (std::vector< int > states)
 set Start States
void setTransitionMatrix (const TransitionMatrixType &matrix)
 set Transitions/probabilities Matrix
void setTransitionMatrixElement (int row, int col, double value)
 set Transitions/probabilities Matrix elements
virtual ~MarkovBase ()
 MarkovBase destructor.

Protected Member Functions

virtual void calculateStateProbabilities ()
 determine the probability of each state. this cannot be done here, as it depends on the transition matrix type (continuous or discrete)

Protected Attributes

std::vector< intactualStates
 Internal representation of actual states: vector of actual states: one for each chain.
wns::logger::Logger logger
 logger
std::vector< intnextStates
 Internal representation of next state: vector of next states, one for each chain.
std::vector< doublenextTransitionTime
 Internal representation of next state transition time: vector of next states transition time, one for each chain.
int numberOfChains
 Internal representation of the number of chains.
int numberOfStates
 Internal representation of the number of states.
std::vector< intstartStates
 Internal representation of start states: vector of start states, one for each chain.
std::vector< doublestateProbabilities
 probability of each state. Calculated in calculateStateProbabilities (different for continuous and discrete)
TransitionMatrixType transitionsMatrix
 Internal representation of the matrix of transitions/probabilities.
std::vector< T > vectorOfStates
 representation of vector of states

Private Member Functions

void prepareTransitionMatrixAndVectorOfStates ()
 prepare transitions/probabilities Matrix and the vector of states. It is called when the numberOfStates is known.

Friends

class MarkovBaseTest
std::ostream & operator<< (std::ostream &os, const MarkovBase &markov)


Detailed Description

template<class T>
class wns::markovchain::MarkovBase< T >

Author:
Sara Gutierrez de Mesa (sgm@comnets.rwth-aachen.de)

Rainer Schoenen (rs@comnets.rwth-aachen.de)

Functions and attributes that have in common MarkovContinuousTime and MarkovDiscreteTime. both classes derive from it

Definition at line 52 of file MarkovBase.hpp.


Constructor & Destructor Documentation

template<class T>
wns::markovchain::MarkovBase< T >::MarkovBase ( int  _numberOfChains  )  [inline]

Definition at line 69 of file MarkovBase.hpp.

template<class T>
wns::markovchain::MarkovBase< T >::MarkovBase ( int  nos,
int  noc,
std::vector< T >  states,
TransitionMatrixType  matrix,
std::vector< int sStates 
) [inline]

NumberOfStates: nos NumberOfChains: noc states: vector that contains all the states matrix: transition matrix/probability matrix startstates: vector with position of startstate of each chain actualstates: vector with position of actualstate of each chain nextstates: vector with position of nextstate of each chain nextTransitionTime: vector with Nexttransitiontime of each chain

Definition at line 99 of file MarkovBase.hpp.

template<class T>
virtual wns::markovchain::MarkovBase< T >::~MarkovBase (  )  [inline, virtual]

Definition at line 123 of file MarkovBase.hpp.


Member Function Documentation

template<class T>
virtual void wns::markovchain::MarkovBase< T >::calculateStateProbabilities (  )  [inline, protected, virtual]

template<class T>
int wns::markovchain::MarkovBase< T >::getActualStateIndex ( int  actualchain  )  const [inline]

Definition at line 153 of file MarkovBase.hpp.

template<class T>
const T* wns::markovchain::MarkovBase< T >::getStateContent ( int  index  )  const [inline]

Definition at line 179 of file MarkovBase.hpp.

template<class T>
const std::vector<double>& wns::markovchain::MarkovBase< T >::getStateProbabilities (  )  const [inline]

Definition at line 169 of file MarkovBase.hpp.

template<class T>
double wns::markovchain::MarkovBase< T >::getStateProbability ( int  stateIndex  )  const [inline]

Definition at line 162 of file MarkovBase.hpp.

template<class T>
const std::vector<T>& wns::markovchain::MarkovBase< T >::getStates (  )  const [inline]

Definition at line 143 of file MarkovBase.hpp.

template<class T>
double wns::markovchain::MarkovBase< T >::getTransitionMatrixElement ( int  row,
int  col 
) const [inline]

Definition at line 209 of file MarkovBase.hpp.

template<class T>
void wns::markovchain::MarkovBase< T >::prepareTransitionMatrixAndVectorOfStates (  )  [inline, private]

Definition at line 358 of file MarkovBase.hpp.

template<class T>
int wns::markovchain::MarkovBase< T >::readNumberOfStates ( std::istream &  in  )  [inline]

Definition at line 231 of file MarkovBase.hpp.

template<class T>
void wns::markovchain::MarkovBase< T >::readTransitionsFromFile ( std::istream &  in  )  [inline]

Definition at line 259 of file MarkovBase.hpp.

template<class T>
void wns::markovchain::MarkovBase< T >::setNumberOfStates ( int  _numberOfStates  )  [inline]

Definition at line 133 of file MarkovBase.hpp.

template<class T>
void wns::markovchain::MarkovBase< T >::setStartStates ( std::vector< int states  )  [inline]

Definition at line 188 of file MarkovBase.hpp.

template<class T>
void wns::markovchain::MarkovBase< T >::setTransitionMatrix ( const TransitionMatrixType matrix  )  [inline]

Definition at line 222 of file MarkovBase.hpp.

template<class T>
void wns::markovchain::MarkovBase< T >::setTransitionMatrixElement ( int  row,
int  col,
double  value 
) [inline]

Definition at line 198 of file MarkovBase.hpp.


Friends And Related Function Documentation

template<class T>
friend class MarkovBaseTest [friend]

Definition at line 350 of file MarkovBase.hpp.

template<class T>
std::ostream& operator<< ( std::ostream &  os,
const MarkovBase< T > &  markov 
) [friend]

Definition at line 57 of file MarkovBase.hpp.


Member Data Documentation

template<class T>
std::vector<int> wns::markovchain::MarkovBase< T >::actualStates [protected]

Definition at line 324 of file MarkovBase.hpp.

template<class T>
wns::logger::Logger wns::markovchain::MarkovBase< T >::logger [protected]

Definition at line 347 of file MarkovBase.hpp.

template<class T>
std::vector<int> wns::markovchain::MarkovBase< T >::nextStates [protected]

Definition at line 330 of file MarkovBase.hpp.

template<class T>
std::vector<double> wns::markovchain::MarkovBase< T >::nextTransitionTime [protected]

Definition at line 336 of file MarkovBase.hpp.

template<class T>
int wns::markovchain::MarkovBase< T >::numberOfChains [protected]

Definition at line 302 of file MarkovBase.hpp.

template<class T>
int wns::markovchain::MarkovBase< T >::numberOfStates [protected]

Definition at line 297 of file MarkovBase.hpp.

template<class T>
std::vector<int> wns::markovchain::MarkovBase< T >::startStates [protected]

Definition at line 318 of file MarkovBase.hpp.

template<class T>
std::vector<double> wns::markovchain::MarkovBase< T >::stateProbabilities [protected]

Definition at line 342 of file MarkovBase.hpp.

Definition at line 312 of file MarkovBase.hpp.

template<class T>
std::vector<T> wns::markovchain::MarkovBase< T >::vectorOfStates [protected]

Definition at line 307 of file MarkovBase.hpp.


The documentation for this class was generated from the following file:

Generated on Sun May 27 03:33:00 2012 for openWNS by  doxygen 1.5.5