public class GraphTF extends java.lang.Object implements TerminalFunction
TerminalFunction
for instances of GraphDefinedDomain
.
Lets the user specify the integer node ids of the terminal states in the graph.Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.lang.Integer> |
terminalStates
The set of nodes ids in the graph that are terminal states
|
Constructor and Description |
---|
GraphTF(int... nodes)
Initializes setting all states with the provide integer node ids to be terminal states
|
Modifier and Type | Method and Description |
---|---|
void |
addTerminals(int... nodes)
Adds additional terminal states
|
java.util.Set<java.lang.Integer> |
getTerminalStates() |
boolean |
isTerminal(State s) |
void |
removeTerminals(int... nodes)
Removes nodes as being marked as terminal states
|
void |
setTerminalStates(java.util.Set<java.lang.Integer> terminalStates) |
protected java.util.Set<java.lang.Integer> terminalStates
public GraphTF(int... nodes)
nodes
- the state node ids that are terminal statespublic boolean isTerminal(State s)
isTerminal
in interface TerminalFunction
public java.util.Set<java.lang.Integer> getTerminalStates()
public void setTerminalStates(java.util.Set<java.lang.Integer> terminalStates)
public void addTerminals(int... nodes)
nodes
- the additional state node ids that are to be marked as terminal statespublic void removeTerminals(int... nodes)
nodes
- the nodes to remove as terminal states