S
- The states classA
- Tha Action classpublic final class Policy<S extends State,A extends Action>
extends java.lang.Object
Constructor and Description |
---|
Policy(DecisionRule d)
Creates a stationary policy with the given decition rule
|
Policy(int stages)
Creates a set with the given horizon.
|
Modifier and Type | Method and Description |
---|---|
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)
Returns the decision rule for statge t
|
int |
getHorizon()
Return the time horizon for this Ploicy.
|
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> dr,
int t)
Sets a decision rule for stage t in the policy
|
java.lang.String |
toString()
Gives the sting representation of this Policy
|
public Policy(int stages)
stages
- The number of stagespublic Policy(DecisionRule d)
d
- The rulepublic int getHorizon()
public void setDecisionRule(DecisionRule<S,A> dr, int t)
dr
- decision rulet
- stagepublic void setDecisionRule(DecisionRule<S,A> pol)
pol
- public DecisionRule<S,A> getDecisionRule()
public DecisionRule<S,A> getDecisionRule(int t)
t
- stage.public A getAction(S i, int t)
i
- The statet
- The stage (time) at which action is to be taken.public java.lang.String toString()
toString
in class java.lang.Object
public void print()
public void print(java.io.PrintWriter pw)
pw
- print writer