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
kNoProgress
Fields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Before calling DecisionBuilder::Next.boolean
check()
This method is called to check the status of the limit.boolean
Same as Check() but adds the 'offset' value to the current time when time
is considered in the limit.void
copy
(SearchLimit limit) Copy a limit.boolean
crossed()
Returns true if the limit has been crossed.void
delete()
void
Internal methods.protected void
finalize()
static long
getCPtr
(SearchLimit obj) void
init()
This method is called when the search limit is initialized.void
install()
Registers itself on the solver such that it gets notified of the search
and propagation events.void
Allocates a clone of the limit.void
Periodic call to check limits in long running methods.void
Before refuting the decision.static long
swigRelease
(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, swigTakeOwnership
Methods 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:
finalize
in classSearchMonitor
-
delete
public void delete()- Overrides:
delete
in classSearchMonitor
-
keepAliveDecisionBuilder
- Overrides:
keepAliveDecisionBuilder
in 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:SearchMonitor
Before calling DecisionBuilder::Next.- Overrides:
beginNextDecision
in classSearchMonitor
-
periodicCheck
public void periodicCheck()Description copied from class:SearchMonitor
Periodic call to check limits in long running methods.- Overrides:
periodicCheck
in classSearchMonitor
-
refuteDecision
Description copied from class:SearchMonitor
Before refuting the decision.- Overrides:
refuteDecision
in classSearchMonitor
-
toString
- Overrides:
toString
in classBaseObject
-
install
public void install()Description copied from class:SearchMonitor
Registers itself on the solver such that it gets notified of the search
and propagation events. Override to incrementally install listeners for
specific events.- Overrides:
install
in classSearchMonitor
-