Class PartiallyKnownOptimizer
java.lang.Object
org.clafer.compiler.PartiallyKnownOptimizer
- All Implemented Interfaces:
ClaferOptimizer, ClaferSearch, InstanceIterator, OptimalInstanceIterator
An optimizer where at least one objective is known to be optimal.
For example, if there are two objectives but one objective is always equal to
one, then only need to optimize the second objective, therefore reducing a
bi-objective problem to a single-objective problem.
- Author:
- jimmy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn all the remaining instances.booleanfind()Find the next instance.org.chocosolver.solver.SolverReturns the internal Choco solver.instance()Return the instance from the lastInstanceIterator.find()operation, if successful.intReturn the number of instances found so far.int[]Returns the optimal values.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ClaferSearch
limitTime
-
Constructor Details
-
PartiallyKnownOptimizer
-
-
Method Details
-
find
Description copied from interface:ClaferSearchFind the next instance.- Specified by:
findin interfaceClaferSearch- Specified by:
findin interfaceInstanceIterator- Returns:
trueif and only if another solution is found,falseotherwise- Throws:
ReachedLimitException- if resource limit reached
-
instance
Description copied from interface:InstanceIteratorReturn the instance from the lastInstanceIterator.find()operation, if successful.- Specified by:
instancein interfaceInstanceIterator- Returns:
- the instance
-
allInstances
Description copied from interface:InstanceIteratorReturn all the remaining instances.- Specified by:
allInstancesin interfaceInstanceIterator- Returns:
- all the remaining instances
- Throws:
ReachedLimitException- if resource limit reached
-
optimalValues
Description copied from interface:OptimalInstanceIteratorReturns the optimal values. The order of the values corresponds to the order of the objectives.- Specified by:
optimalValuesin interfaceOptimalInstanceIterator- Returns:
- the optimal value
-
instanceCount
Description copied from interface:InstanceIteratorReturn the number of instances found so far.- Specified by:
instanceCountin interfaceInstanceIterator- Returns:
- the number of instances found so far
-
getInternalSolver
Description copied from interface:ClaferSearchReturns the internal Choco solver. For debugging purposes only.- Specified by:
getInternalSolverin interfaceClaferSearch- Returns:
- the internal Choco solver
-