Class CatMouseAnimator

java.lang.Object
  extended byCatMouseAnimator

public class CatMouseAnimator
extends java.lang.Object

This class can be used to "animate" the interaction between a cat and mouse. When the animate method is called, the MDP is simulated with the mouse's movements being determined by the given policy. The results are printed to standard output.


Constructor Summary
CatMouseAnimator(Mdp mdp)
          The constructor for this class for printing results to standard output.
CatMouseAnimator(Mdp mdp, java.io.PrintStream out)
          The constructor for this class for printing results to a given print stream.
 
Method Summary
 void animate(int[] pi, int numSteps)
          This method will animate the mdp provided to the constructor for numSteps steps, following policy pi.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatMouseAnimator

public CatMouseAnimator(Mdp mdp)
The constructor for this class for printing results to standard output. This constructor takes as input an mdp, which must correspond to a cat and mouse world; otherwise, the constructor will almost certainly crash. The results are printed to standard output.


CatMouseAnimator

public CatMouseAnimator(Mdp mdp,
                        java.io.PrintStream out)
The constructor for this class for printing results to a given print stream. This constructor takes as input an mdp, which must correspond to a cat and mouse world; otherwise, the constructor will almost certainly crash. The constructor also takes a second argument specifying a PrintStream to which all of the results are to be printed.

Method Detail

animate

public void animate(int[] pi,
                    int numSteps)
This method will animate the mdp provided to the constructor for numSteps steps, following policy pi. The results are printed to standard output.