Class OptimizeVar
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.SearchMonitor
com.google.ortools.constraintsolver.BaseObjectiveMonitor
com.google.ortools.constraintsolver.ObjectiveMonitor
com.google.ortools.constraintsolver.OptimizeVar
This class encapsulates an objective. It requires the direction
(minimize or maximize), the variable to optimize, and the
improvement step.
(minimize or maximize), the variable to optimize, and the
improvement step.
-
Field Summary
Fields inherited from class com.google.ortools.constraintsolver.SearchMonitor
kNoProgressFields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn -
Constructor Summary
ConstructorsConstructorDescriptionOptimizeVar(long cPtr, boolean cMemoryOwn) OptimizeVar(Solver solver, boolean maximize, IntVar var, long step) OptimizeVar(Solver solver, SWIGTYPE_p_std__vectorT_bool_t maximize, IntVar[] vars, long[] steps) -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis method is called when a solution is found.voidbooleanThis method is called when a valid solution is found.voidInternal methods.longbest()Returns the best value found during search.voiddelete()protected voidfinalize()static longgetCPtr(OptimizeVar obj) voidName()voidBefore refuting the decision.static longswigRelease(OptimizeVar obj) toString()var()Returns the variable that is optimized.Methods inherited from class com.google.ortools.constraintsolver.ObjectiveMonitor
accept, acceptDelta, BestValue, enterSearch, getCPtr, Maximize, MinimizationVar, ObjectiveVar, Size, Step, swigReleaseMethods inherited from class com.google.ortools.constraintsolver.BaseObjectiveMonitor
getCPtr, is_active, set_active, swigReleaseMethods inherited from class com.google.ortools.constraintsolver.SearchMonitor
acceptNeighbor, AcceptUncheckedNeighbor, afterDecision, applyDecision, beginFail, beginInitialPropagation, endFail, endInitialPropagation, endNextDecision, exitSearch, getCPtr, install, IsUncheckedSolutionLimitReached, localOptimum, noMoreSolutions, periodicCheck, progressPercent, restartSearch, solver, swigDirectorDisconnect, swigRelease, swigReleaseOwnership, swigTakeOwnershipMethods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease
-
Constructor Details
-
OptimizeVar
public OptimizeVar(long cPtr, boolean cMemoryOwn) -
OptimizeVar
-
OptimizeVar
public OptimizeVar(Solver solver, SWIGTYPE_p_std__vectorT_bool_t maximize, IntVar[] vars, long[] steps)
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalizein classObjectiveMonitor
-
delete
public void delete()- Overrides:
deletein classObjectiveMonitor
-
keepAliveDecisionBuilder
- Overrides:
keepAliveDecisionBuilderin classSearchMonitor
-
best
public long best()Returns the best value found during search. -
var
Returns the variable that is optimized. -
beginNextDecision
Internal methods.- Overrides:
beginNextDecisionin classSearchMonitor
-
refuteDecision
Description copied from class:SearchMonitorBefore refuting the decision.- Overrides:
refuteDecisionin classSearchMonitor
-
atSolution
public boolean atSolution()Description copied from class:SearchMonitorThis method is called when a valid solution is found. If the
return value is true, then search will resume after. If the result
is false, then search will stop there.- Overrides:
atSolutionin classObjectiveMonitor
-
acceptSolution
public boolean acceptSolution()Description copied from class:SearchMonitorThis method is called when a solution is found. It asserts whether the
solution is valid. A value of false indicates that the solution
should be discarded.- Overrides:
acceptSolutionin classSearchMonitor
-
Name
-
toString
- Overrides:
toStringin classBaseObject
-
applyBound
public void applyBound()
-