Class PolicyEval

java.lang.Object
  extended byPolicyEval

public class PolicyEval
extends java.lang.Object

This is the template of a class that evaluates a given policy, i.e., computes the utility of each state when actions are chosen according to it. The utility is returned in the public utility field. You need to fill in the constructor. You may wish to add other fields with other useful information that you want this class to return (for instance, number of iterations before convergence).


Field Summary
static double precision
          the precision used to determine when to stop iterating (called epsilon in lecture)
 double[] utility
          the computed utility of each state under the given policy
 
Constructor Summary
PolicyEval(Mdp mdp, double discount, int[] pi)
          The constructor for this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

utility

public double[] utility
the computed utility of each state under the given policy


precision

public static double precision
the precision used to determine when to stop iterating (called epsilon in lecture)

Constructor Detail

PolicyEval

public PolicyEval(Mdp mdp,
                  double discount,
                  int[] pi)
The constructor for this class. Computes the utility of policy pi for the given mdp with given discount factor, and stores the answer in utility.