net.sourceforge.jsl
Interface SearchNode

All Known Implementing Classes:
AbstractSearchNode

public interface SearchNode

General notion of a node in a search graph. Nodes are connected to each other by SearchEdges. Each node in a search is associated to an object in the domain that is searched.


Method Summary
 boolean cutoff()
          Indicates if this node should be pruned, i.e. excluded from further calculations.
 Collection expand()
          Expands this node and returns the search nodes following this one.
 int getBreadth()
          Returns the breadth of this node in the search graph (tree).
 double getCost()
          Gets the cost it has taken to get to this node.
 int getDepth()
          Returns the depth of this node in the search graph (tree).
 Object getDomainObject()
          Gets the domain object associated to this search node.
 double getEstimatedRestCost()
          Estimates the cost expected to need to reach a goal from this node.
 Collection getIncomingEdges()
          Gets all incoming edges.
 Collection getOutgoingEdges()
          Gets all outgoing edges.
 boolean isGoal()
          Returns if the this node is a goal of the serach.
 void setDomainObject(Object domainObject)
          Sets the domain object associated to this search node.
 void setIncomingEdges(Collection incomingEdges)
          Sets the incoming edges.
 void setOutgoingEdges(Collection outgoingEdges)
          Sets the outgoing edges.
 

Method Detail

getIncomingEdges

public Collection getIncomingEdges()
Gets all incoming edges.

Returns:
the unordered collection of all incoming SearchEdges.

getOutgoingEdges

public Collection getOutgoingEdges()
Gets all outgoing edges.

Returns:
the unordered collection of all outgoing SearchEdges.

setIncomingEdges

public void setIncomingEdges(Collection incomingEdges)
Sets the incoming edges.

Parameters:
incomingEdges - the unordered collection of all incoming SearchEdges.

setOutgoingEdges

public void setOutgoingEdges(Collection outgoingEdges)
Sets the outgoing edges.

Parameters:
outgoingEdges - the unordered collection of all outgoing SearchEdges.

getDomainObject

public Object getDomainObject()
Gets the domain object associated to this search node.

Returns:
the domain object associated to this search egde

setDomainObject

public void setDomainObject(Object domainObject)
Sets the domain object associated to this search node.

Parameters:
domainObject - the domain object associated to this search egde

getDepth

public int getDepth()
Returns the depth of this node in the search graph (tree).

Returns:
the depth of this node

getBreadth

public int getBreadth()
Returns the breadth of this node in the search graph (tree).

Returns:
the breadth of this node

isGoal

public boolean isGoal()
Returns if the this node is a goal of the serach.

Returns:
true if this node is a goal of the search, false otherwise

getEstimatedRestCost

public double getEstimatedRestCost()
Estimates the cost expected to need to reach a goal from this node. The total cost to reach the goal traversing this node would be this value plus the value returned by getCost(). This is needed for scoring searches like A*.

Returns:
the estimated rest cost from this node to the goal in double precision

getCost

public double getCost()
Gets the cost it has taken to get to this node.

Returns:
the accumulated costs to get from the seed to this node in double precision

cutoff

public boolean cutoff()
Indicates if this node should be pruned, i.e. excluded from further calculations.

Returns:
true if this node shall be excluded from further search, false otherwise

expand

public Collection expand()
Expands this node and returns the search nodes following this one. Newly created nodes must be connected to this one using edges.

Returns:
the expanded successors of this node


Copyright 2003-2004 Henrik Heine, Oliver Zeigermann. All Rights Reserved.