|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmarkov.basic.DecisionRule<S,A>
S - The states classA - Tha Action classpublic 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 | |
|---|---|
java.lang.String |
description()
Gives the sting representation of this Rule |
boolean |
equals(java.lang.Object o)
Determines if the given decision rules are equal. |
A |
getAction(S s)
Gets the prescribed action for the given State. |
java.util.Iterator<java.util.Map.Entry<S,A>> |
iterator()
Return an iterator over the State-Action pairs. |
java.lang.String |
label()
This method returns a short String used in the user interface to describe this element. |
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()
Returns the amount of states linked to actions in the decision rule. |
java.lang.String |
toString()
This method returns a short String used in the user interface to describe this element. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DecisionRule()
public DecisionRule(DecisionRule<S,A> dr)
dr - decision rule| Method Detail |
|---|
public void set(S s,
A a)
s - statea - actionpublic A getAction(S s)
s - state
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()
JMarkovElement
public final String toString() {
return label();
}
toString in interface JMarkovElementtoString in class java.lang.ObjectJMarkovElement.label()public java.lang.String label()
JMarkovElement
label in interface JMarkovElementJMarkovElement.description()public boolean equals(java.lang.Object o)
equals in interface JMarkovElementequals in class java.lang.Objecto -
Object.equals(java.lang.Object)public java.lang.String description()
description in interface JMarkovElementJMarkovElement.label()public void print()
public void print(java.io.PrintWriter pw)
pw - PrintWriter to use
public 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 | |||||||||