Class RegularLimit
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.SearchMonitor
com.google.ortools.constraintsolver.SearchLimit
com.google.ortools.constraintsolver.RegularLimit
Usual limit based on wall_time, number of explored branches and
number of failures in the search tree
number of failures in the search tree
-
Field Summary
Fields inherited from class com.google.ortools.constraintsolver.SearchMonitor
kNoProgressFields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn -
Constructor Summary
ConstructorsConstructorDescriptionRegularLimit(long cPtr, boolean cMemoryOwn) RegularLimit(Solver s, SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ModelVisitor visitor) Accepts the given model visitor.longbranches()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.voiddelete()voidEnd of the search.longfailures()protected voidfinalize()static longgetCPtr(RegularLimit 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.booleanReturns true if the limit of solutions has been reached including
unchecked solutions.Allocates a clone of the limit.intReturns a percentage representing the propress of the search before
reaching limits.longstatic longswigRelease(RegularLimit obj) toString()voidUpdateLimits(SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions) longMethods inherited from class com.google.ortools.constraintsolver.SearchLimit
beginNextDecision, check, crossed, enterSearch, getCPtr, keepAliveDecisionBuilder, periodicCheck, refuteDecision, swigReleaseMethods inherited from class com.google.ortools.constraintsolver.SearchMonitor
acceptDelta, acceptNeighbor, acceptSolution, AcceptUncheckedNeighbor, afterDecision, applyDecision, atSolution, beginFail, beginInitialPropagation, endFail, endInitialPropagation, endNextDecision, getCPtr, localOptimum, noMoreSolutions, restartSearch, solver, swigDirectorDisconnect, swigRelease, swigReleaseOwnership, swigTakeOwnershipMethods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease
-
Constructor Details
-
RegularLimit
public RegularLimit(long cPtr, boolean cMemoryOwn) -
RegularLimit
public RegularLimit(Solver s, SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative)
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalizein classSearchLimit
-
delete
public void delete()- Overrides:
deletein classSearchLimit
-
copy
Description copied from class:SearchLimitCopy 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.- Overrides:
copyin classSearchLimit
-
makeClone
Description copied from class:SearchLimitAllocates a clone of the limit.- Overrides:
makeClonein classSearchLimit
-
MakeIdenticalClone
-
CheckWithOffset
Description copied from class:SearchLimitSame as Check() but adds the 'offset' value to the current time when time
is considered in the limit.- Overrides:
CheckWithOffsetin classSearchLimit
-
init
public void init()Description copied from class:SearchLimitThis method is called when the search limit is initialized.- Overrides:
initin classSearchLimit
-
exitSearch
public void exitSearch()Description copied from class:SearchMonitorEnd of the search.- Overrides:
exitSearchin classSearchMonitor
-
UpdateLimits
public void UpdateLimits(SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions) -
wall_time
public long wall_time() -
branches
public long branches() -
failures
public long failures() -
solutions
public long solutions() -
IsUncheckedSolutionLimitReached
public boolean IsUncheckedSolutionLimitReached()Description copied from class:SearchMonitorReturns true if the limit of solutions has been reached including
unchecked solutions.- Overrides:
IsUncheckedSolutionLimitReachedin classSearchMonitor
-
progressPercent
public int progressPercent()Description copied from class:SearchMonitorReturns a percentage representing the propress of the search before
reaching limits.- Overrides:
progressPercentin classSearchMonitor
-
toString
- Overrides:
toStringin classSearchLimit
-
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 classSearchLimit
-
accept
Description copied from class:SearchMonitorAccepts the given model visitor.- Overrides:
acceptin classSearchMonitor
-