javax.constraints.impl.search.goal
Class Dichotomize

java.lang.Object
  extended by javax.constraints.impl.search.goal.Dichotomize

public class Dichotomize
extends java.lang.Object

This class is used by the Solver's method "findOptimalSolutionDichotomize". Its method "execute" is trying to find a solution that minimizes the parameter "objective" using the current search strategy. The "tolerance" specifies a difference between different optimal solutions that can be ignored. It may be considered as a precision of the search algorithm.


Constructor Summary
Dichotomize(SolverWithGoals solver, Var objective)
           
 
Method Summary
 Solution execute()
          The actual minimization algorithm executes a dichotomized search.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dichotomize

public Dichotomize(SolverWithGoals solver,
                   Var objective)
Method Detail

execute

public Solution execute()
The actual minimization algorithm executes a dichotomized search. During the search it modifies an interval [objectiveMin; objectiveMax]. First it is trying to find a solution in the [objectiveMin; objectiveMid]. If it fails, it is looking at [objectiveMid+1; objectiveMax]. During this process it switches the search target: one time in looks at in the upper half of the selected interval, another time - to the lower half. Successful search stops when objectiveMax - objectiveMin <= tolerance.