|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmdp.basic.DecisionRule<S,A>
public final class DecisionRule<S extends State,A extends Action>
This class represents a deterministic decision rule which assigns an action to every state.
Constructor Summary | |
---|---|
DecisionRule()
Creates a new empty decision rule |
|
DecisionRule(DecisionRule<S,A> dr)
Creates a decision rule from a given one |
Method Summary | |
---|---|
A |
getAction(S s)
|
java.util.Map |
getDecisionRule()
|
java.util.Iterator<java.util.Map.Entry<S,A>> |
iterator()
|
void |
print()
Prints the Rule to the sandard output |
void |
print(java.io.PrintWriter pw)
Prints the policiy to the given PrintWriter. |
void |
print(java.io.PrintWriter pw,
java.lang.String statesFormat,
java.lang.String actionFormat)
Prints the policiy to the given PrintWriter. |
void |
set(S s,
A a)
Maps a given action to a given state |
int |
size()
|
java.lang.String |
toString()
Gives the sting representation of this Rule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DecisionRule()
public DecisionRule(DecisionRule<S,A> dr)
dr
- decision ruleMethod Detail |
---|
public void set(S s, A a)
s
- statea
- actionpublic A getAction(S s)
s
- state
public java.util.Map getDecisionRule()
public int size()
public java.util.Iterator<java.util.Map.Entry<S,A>> iterator()
iterator
in interface java.lang.Iterable<java.util.Map.Entry<S extends State,A extends Action>>
public java.lang.String toString()
toString
in class java.lang.Object
public void print()
public void print(java.io.PrintWriter pw)
pw
- PrintWriter to usepublic void print(java.io.PrintWriter pw, java.lang.String statesFormat, java.lang.String actionFormat)
pw
- PrintWriter to usestatesFormat
- format for the states , for example "%-10S" to have 10 width left
aligned states.actionFormat
- format for the actions , for example "%-10S" to have 10 width left
aligned actions.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |