jopt.csp.spi.search.goal
Class MinMaxSearchGoal

java.lang.Object
  extended byjopt.csp.spi.search.goal.MinMaxSearchGoal
All Implemented Interfaces:
java.lang.Cloneable, jopt.csp.search.SearchGoal
Direct Known Subclasses:
StrictlyMaximizeGoal, StrictlyMinimizeGoal

public abstract class MinMaxSearchGoal
extends java.lang.Object
implements jopt.csp.search.SearchGoal

Base class for maximization and minimization goals.


Constructor Summary
MinMaxSearchGoal()
          Initializes internal goal variables
MinMaxSearchGoal(jopt.csp.variable.CspVariableFactory varFact, ConstraintStore store, jopt.csp.variable.CspNumExpr expr, boolean isCurrentASolution)
          Initializes internal goal variables
 
Method Summary
 double bestObjectiveValue()
           
abstract  java.lang.Object clone()
           
 jopt.csp.search.SearchNodeReference getSolutionReference(int n)
           
 int getSolutionReferenceCount()
           
 boolean isOkToActivate(jopt.csp.search.SearchNode node)
           
 void returnBoundToObjectiveValue(double objective)
           
 boolean solutionFound(jopt.csp.search.SearchNodeReference treeLocationRef)
          Called when searches encounter a solution to determine the proper course of action.
 void updateBoundForOpenNode()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinMaxSearchGoal

public MinMaxSearchGoal(jopt.csp.variable.CspVariableFactory varFact,
                        ConstraintStore store,
                        jopt.csp.variable.CspNumExpr expr,
                        boolean isCurrentASolution)
Initializes internal goal variables

Parameters:
varFact - The variable factory used in variable creation
store - The constraint store associated with the problem
expr - The expression to be maximized or minimized

MinMaxSearchGoal

public MinMaxSearchGoal()
Initializes internal goal variables

Method Detail

isOkToActivate

public boolean isOkToActivate(jopt.csp.search.SearchNode node)
Specified by:
isOkToActivate in interface jopt.csp.search.SearchGoal

solutionFound

public boolean solutionFound(jopt.csp.search.SearchNodeReference treeLocationRef)
Called when searches encounter a solution to determine the proper course of action. The tree location reference is passed in, but there is no need to pass in the state of the problem because this object already knows the expression it is trying to maximize or minimize. It can look to that expression to see how good (or bad) the current solution is.

Specified by:
solutionFound in interface jopt.csp.search.SearchGoal
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()
Specified by:
bestObjectiveValue in interface jopt.csp.search.SearchGoal

returnBoundToObjectiveValue

public void returnBoundToObjectiveValue(double objective)
Specified by:
returnBoundToObjectiveValue in interface jopt.csp.search.SearchGoal

updateBoundForOpenNode

public void updateBoundForOpenNode()
                            throws jopt.csp.variable.PropagationFailureException
Specified by:
updateBoundForOpenNode in interface jopt.csp.search.SearchGoal
Throws:
jopt.csp.variable.PropagationFailureException

getSolutionReferenceCount

public int getSolutionReferenceCount()
Specified by:
getSolutionReferenceCount in interface jopt.csp.search.SearchGoal

getSolutionReference

public jopt.csp.search.SearchNodeReference getSolutionReference(int n)
Specified by:
getSolutionReference in interface jopt.csp.search.SearchGoal

clone

public abstract java.lang.Object clone()
Specified by:
clone in interface jopt.csp.search.SearchGoal