Class Mdp

java.lang.Object
  extended byMdp

public class Mdp
extends java.lang.Object

This class represents an MDP, and includes a constructor that can read the MDP from a data file. If you want to create your own MDP's, you can do so by adding new constructors and filling in all of the needed fields, or by creating data files that are read by the provided constructor (see assignment instructions).


Field Summary
 java.lang.String[] actionName
          an array containing the names of all of the actions
 int[][][] nextState
          a list of the possible states that can be reached from each state under each action
 int numActions
          total number of actions
 int numStates
          total number of states
 double[] reward
          an array containing the (immediate) reward associated with every state
 int startState
          the start state
 java.lang.String[] stateName
          an array containing the names of all of the states
 double[][][] transProb
          a table of transition probabilities: transProb[s][a][i] is the probability of transitioning from state s under action a to state nextState[s][a][i].
 
Constructor Summary
Mdp(java.lang.String filename)
          This constructor reads in data from filename and sets up all of the public fields.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numStates

public int numStates
total number of states


numActions

public int numActions
total number of actions


stateName

public java.lang.String[] stateName
an array containing the names of all of the states


actionName

public java.lang.String[] actionName
an array containing the names of all of the actions


reward

public double[] reward
an array containing the (immediate) reward associated with every state


nextState

public int[][][] nextState
a list of the possible states that can be reached from each state under each action


transProb

public double[][][] transProb
a table of transition probabilities: transProb[s][a][i] is the probability of transitioning from state s under action a to state nextState[s][a][i].


startState

public int startState
the start state

Constructor Detail

Mdp

public Mdp(java.lang.String filename)
    throws java.io.FileNotFoundException,
           java.io.IOException
This constructor reads in data from filename and sets up all of the public fields. See assignment instructions for information on the required format of this file. This constructor will properly read data from a gzipped file if filename ends with a ".gz" suffix.