Class SearchLimit
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.SearchMonitor
com.google.ortools.constraintsolver.SearchLimit
- Direct Known Subclasses:
ImprovementSearchLimit,RegularLimit
Base class of all search limits.
-
Field Summary
Fields inherited from class com.google.ortools.constraintsolver.SearchMonitor
kNoProgressFields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBefore calling DecisionBuilder::Next.booleancheck()This method is called to check the status of the limit.booleanSame as Check() but adds the 'offset' value to the current time when time
is considered in the limit.voidcopy(SearchLimit limit) Copy a limit.booleancrossed()Returns true if the limit has been crossed.voiddelete()voidInternal methods.protected voidfinalize()static longgetCPtr(SearchLimit obj) voidinit()This method is called when the search limit is initialized.voidinstall()Registers itself on the solver such that it gets notified of the search
and propagation events.voidAllocates a clone of the limit.voidPeriodic call to check limits in long running methods.voidBefore refuting the decision.static longswigRelease(SearchLimit obj) toString()Methods inherited from class com.google.ortools.constraintsolver.SearchMonitor
accept, acceptDelta, acceptNeighbor, acceptSolution, AcceptUncheckedNeighbor, afterDecision, applyDecision, atSolution, beginFail, beginInitialPropagation, endFail, endInitialPropagation, endNextDecision, exitSearch, getCPtr, IsUncheckedSolutionLimitReached, localOptimum, noMoreSolutions, progressPercent, restartSearch, solver, swigDirectorDisconnect, swigRelease, swigReleaseOwnership, swigTakeOwnershipMethods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease
-
Constructor Details
-
SearchLimit
public SearchLimit(long cPtr, boolean cMemoryOwn)
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalizein classSearchMonitor
-
delete
public void delete()- Overrides:
deletein classSearchMonitor
-
keepAliveDecisionBuilder
- Overrides:
keepAliveDecisionBuilderin classSearchMonitor
-
crossed
public boolean crossed()Returns true if the limit has been crossed. -
check
public boolean check()This method is called to check the status of the limit. A return
value of true indicates that we have indeed crossed the limit. In
that case, this method will not be called again and the remaining
search will be discarded. -
CheckWithOffset
Same as Check() but adds the 'offset' value to the current time when time
is considered in the limit. -
init
public void init()This method is called when the search limit is initialized. -
copy
Copy a limit. Warning: leads to a direct (no check) downcasting of 'limit'
so one needs to be sure both SearchLimits are of the same type. -
makeClone
Allocates a clone of the limit. -
enterSearch
-
beginNextDecision
Description copied from class:SearchMonitorBefore calling DecisionBuilder::Next.- Overrides:
beginNextDecisionin classSearchMonitor
-
periodicCheck
public void periodicCheck()Description copied from class:SearchMonitorPeriodic call to check limits in long running methods.- Overrides:
periodicCheckin classSearchMonitor
-
refuteDecision
Description copied from class:SearchMonitorBefore refuting the decision.- Overrides:
refuteDecisionin classSearchMonitor
-
toString
- Overrides:
toStringin classBaseObject
-
install
public void install()Description copied from class:SearchMonitorRegisters itself on the solver such that it gets notified of the search
and propagation events. Override to incrementally install listeners for
specific events.- Overrides:
installin classSearchMonitor
-