jopt.csp.search
Interface SearchGoal

All Superinterfaces:
java.lang.Cloneable

public interface SearchGoal
extends java.lang.Cloneable

Interface implemented by classes that are used to guide searches towards specific solutions such as solutions that minimizes a specified expression.


Method Summary
 double bestObjectiveValue()
          Returns the best objective value known given the current problem state and previous solutions that have been found
 java.lang.Object clone()
           
 SearchNodeReference getSolutionReference(int n)
          Returns the reference to a solution node for this goal at the specified offset.
 int getSolutionReferenceCount()
          Returns the number of search nodes this goal has marked as valid solutions acceptable to the goal.
 boolean isOkToActivate(SearchNode node)
          This function must return true if the specified open node is acceptable to activate.
 void returnBoundToObjectiveValue(double objective)
          Called by search to notify goal that the bound should be returned to a previous objective value
 boolean solutionFound(SearchNodeReference treeLocationRef)
          Called when searches encounter a solution to determine the proper course of action based on whether the goal has been reached.
 void updateBoundForOpenNode()
          Called by search to notify goal that any changes to the problem to update the bounds before an open node is activated should be performed at this time.
 

Method Detail

isOkToActivate

public boolean isOkToActivate(SearchNode node)
This function must return true if the specified open node is acceptable to activate. Used by first-solution goal to prevent further exploration; may be used for others at some point.

Parameters:
node - Node to check for ability to activate
Returns:
True if search node is valid to activate

solutionFound

public boolean solutionFound(SearchNodeReference treeLocationRef)
Called when searches encounter a solution to determine the proper course of action based on whether the goal has been reached.

Parameters:
treeLocationRef - Reference to a node in the search tree where solution was located
Returns:
True if solution is acceptable for goal, false if it should be discarded

bestObjectiveValue

public double bestObjectiveValue()
Returns the best objective value known given the current problem state and previous solutions that have been found

Returns:
Best known objective value

returnBoundToObjectiveValue

public void returnBoundToObjectiveValue(double objective)
Called by search to notify goal that the bound should be returned to a previous objective value


updateBoundForOpenNode

public void updateBoundForOpenNode()
                            throws PropagationFailureException
Called by search to notify goal that any changes to the problem to update the bounds before an open node is activated should be performed at this time.

Throws:
PropagationFailureException - If a failure occurred attempting to update problem

getSolutionReferenceCount

public int getSolutionReferenceCount()
Returns the number of search nodes this goal has marked as valid solutions acceptable to the goal.


getSolutionReference

public SearchNodeReference getSolutionReference(int n)
Returns the reference to a solution node for this goal at the specified offset. If no such solution exists, null is returned.


clone

public java.lang.Object clone()