|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The TreeNode.java
is an interface implemented by search nodes that are
used in searching.
Method Summary | |
SearchTechniqueChange |
activate(jopt.csp.search.SearchGoal goal)
Called by search when node should be activated. |
void |
deactivate()
Called by search if child and state data should be discarded. |
void |
disconnect()
Called by search to disconnect a child node from a parent node. |
jopt.csp.search.SearchAction |
getAction()
Returns the search action associated with this node |
java.util.BitSet |
getBinaryPath()
Returns a bitset representing the path from the root to this node as a series of left-right movements. |
TreeNode |
getChild(int index)
Returns the child at the specified index |
int |
getChildCount()
Returns the number of children this node contains |
int |
getChildNumberWithinParent()
Returns the number of the child within the parent |
jopt.csp.search.SearchGoal |
getGoal()
Gets the goal value associated with this node |
TreeNode |
getNextOpenChild()
Returns the next open child in the tree |
double |
getObjectiveVal()
Gets the objective value associated with this node |
TreeNode |
getParent()
Retrieves the parent of this search node |
java.util.List |
getPath()
Returns a list of Integers containing the list of movements followed to reach this node. |
java.lang.Object |
getStateData()
Returns state data associated with this node |
boolean |
isBinary()
Returns true if this node is binary |
boolean |
isClosed()
Returns true if node is closed or pruned or deactivated. |
boolean |
isDeactivated()
Returns true if node is closed and the deactivate()
method has been called on this node |
boolean |
isDisconnected()
Returns true if node is opened but is disconnected from it's parent node |
boolean |
isPruned()
Returns true if node has been pruned |
void |
prune()
Called by search to prune node which will discard all child nodes and state information. |
void |
reactivate(TreeNode parent)
Called by search if child and state data should be recalculated. |
void |
reconnect(TreeNode parent)
Called by search to reconnect a child node to a parent node. |
void |
setGoal(jopt.csp.search.SearchGoal goal)
Sets the goal value associated with this node |
void |
setObjectiveVal(double objectiveVal)
Sets the objective value associated with this node |
void |
setStateData(java.lang.Object stateData)
Sets state data associated with this node |
Methods inherited from interface jopt.csp.search.SearchNode |
getDepth |
Method Detail |
public int getChildNumberWithinParent()
public TreeNode getParent()
public SearchTechniqueChange activate(jopt.csp.search.SearchGoal goal) throws jopt.csp.variable.PropagationFailureException
goal
- Optional goal to that is being sought after
jopt.csp.variable.PropagationFailureException
public void deactivate()
prune(), but it does not set
the isPruned flag. This is used in re-calculating trees to
allow a node to be reactivated later. All references to other nodes
including child and parents are removed to allow node to be
reconnected at a later time.
A node can only be deactivated if it was already closed and is
not pruned.
public void reactivate(TreeNode parent)
parent
- Parent node to reconnect node to treepublic void disconnect()
RecalculatingStateManager
does sometimes
call disconnect on a pruned node. For this reason, the requirement
that only an open node can be disconnected has been temporarily
removed. Is this right in the long term?
public void reconnect(TreeNode parent)
public void prune()
public boolean isClosed()
public boolean isPruned()
public boolean isDeactivated()
deactivate()
method has been called on this node
public boolean isDisconnected()
public int getChildCount()
public TreeNode getChild(int index)
public TreeNode getNextOpenChild()
public java.util.List getPath()
public java.util.BitSet getBinaryPath()
public java.lang.Object getStateData()
public void setStateData(java.lang.Object stateData)
public boolean isBinary()
public void setGoal(jopt.csp.search.SearchGoal goal)
public jopt.csp.search.SearchGoal getGoal()
public void setObjectiveVal(double objectiveVal)
public double getObjectiveVal()
public jopt.csp.search.SearchAction getAction()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |