edu.wwu.tobikley.acgc.mc
Class HomogeneousMarkovChain

java.lang.Object
  extended by edu.wwu.tobikley.acgc.mc.HomogeneousMarkovChain
Direct Known Subclasses:
JerrumChain, JerrumHeatBathChain

public abstract class HomogeneousMarkovChain
extends Object

Abstract implementation of a markov chain for simulation purposes, that provides all necessary functionality but the transition mechanim. As a markov chain consists of the following three elements:

A concrete implementation, hence has yet to specify the type of the states and provide the implementation of the transition mechanism. Because of the implementations sole purpose is simulation, the initial state will be set using the classes constructor.

Version:
1.0
Author:
Tobias Kley

Field Summary
protected  Object currentState
          Current state.
protected  RandomEngine randomEngine
          Pseudo random number generator used when updating.
protected  int t
          Current time.
 
Constructor Summary
HomogeneousMarkovChain(RandomEngine randomEngine, Object initialState)
          Creates a new instance of the markov chain.
 
Method Summary
 Object next()
          Performs one update on the markov chain.
 Object next(int n)
          Performs n updates on the markov chain.
abstract  Object update(Object fromState)
          Spezifies the transition mechanism of the markov chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentState

protected Object currentState
Current state.


t

protected int t
Current time.


randomEngine

protected RandomEngine randomEngine
Pseudo random number generator used when updating.

Constructor Detail

HomogeneousMarkovChain

public HomogeneousMarkovChain(RandomEngine randomEngine,
                              Object initialState)
Creates a new instance of the markov chain.

Parameters:
randomEngine - Pseudo random number generator.
initialState - State to initialise the markov chain at time t = 0.
Method Detail

update

public abstract Object update(Object fromState)
Spezifies the transition mechanism of the markov chain. The implementation has is to simulate the state at time t+1 given the current time is t. Updating the state of the markovchain will use always use random numbers invoking randomEngine.raw().

Parameters:
fromState - State at time t.
Returns:
State at time t+1.

next

public Object next()
Performs one update on the markov chain.

Returns:
State of the markov chain at time t+1, given the current time is t.

next

public Object next(int n)
Performs n updates on the markov chain.

Returns:
State of the markov chain at time t+n, given the current time is t.


Copyright © 2007 Tobias Kley. All Rights Reserved.