jmdp.basic
Class Policy<S extends State,A extends Action>

java.lang.Object
  extended by jmdp.basic.Policy<S,A>

public final class Policy<S extends State,A extends Action>
extends java.lang.Object

Policy is a set of "Decision Rules". It contains the Decision Rule for every stage t. When the problem has infinite horizon, only one decision rule is stored.

Author:
Andres Sarmiento, German Riano

Constructor Summary
Policy(DecisionRule d)
          Creates a Markov policy wit the given decition rule
Policy(int stages)
          Creates a set with the given horizon.
 
Method Summary
 DecisionRule<S,A> decisionRule(int t)
          Returns the decision rule for this t
 A getAction(S i, int t)
          Gets the action to be taken in state i at this stage t
 DecisionRule<S,A> getDecisionRule()
           
 DecisionRule<S,A> getDecisionRule(int t)
           
 int getHorizon()
           
 void print()
          Prints the policy to the standard output
 void print(java.io.PrintWriter pw)
          Prints the policy to the given PrintWriter.
 void setDecisionRule(DecisionRule<S,A> pol)
          Sets a unique decision rule for the policy, for infinite horizon problems.
 void setDecisionRule(DecisionRule<S,A> pol, int t)
          Sets a decision rule for stage t in the policy
 java.lang.String toString()
          Gives the sting representation of this Policy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Policy

public Policy(int stages)
Creates a set with the given horizon.


Policy

public Policy(DecisionRule d)
Creates a Markov policy wit the given decition rule

Method Detail

getHorizon

public int getHorizon()
Returns:
last stage where actions can be taken

setDecisionRule

public void setDecisionRule(DecisionRule<S,A> pol,
                            int t)
Sets a decision rule for stage t in the policy


setDecisionRule

public void setDecisionRule(DecisionRule<S,A> pol)
Sets a unique decision rule for the policy, for infinite horizon problems.

Parameters:
pol -

getDecisionRule

public DecisionRule<S,A> getDecisionRule()
Returns:
the unique decision rule, for infinite horizon problems.

getDecisionRule

public DecisionRule<S,A> getDecisionRule(int t)
Parameters:
t - stage
Returns:
the decision rule for stage t.

decisionRule

public DecisionRule<S,A> decisionRule(int t)
Returns the decision rule for this t


getAction

public A getAction(S i,
                   int t)
Gets the action to be taken in state i at this stage t


toString

public java.lang.String toString()
Gives the sting representation of this Policy

Overrides:
toString in class java.lang.Object

print

public void print()
Prints the policy to the standard output


print

public void print(java.io.PrintWriter pw)
Prints the policy to the given PrintWriter.

Parameters:
pw - print writer