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
public class RegularLimit extends SearchLimit
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
Constructors Modifier Constructor Description protectedRegularLimit(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 Type Method Description voidaccept(ModelVisitor visitor)Accepts the given model visitor.longbranches()booleancheck()This method is called to check the status of the limit.voidcopy(SearchLimit limit)Copy a limit.voiddelete()voidexitSearch()End of the search.longfailures()protected voidfinalize()protected static longgetCPtr(RegularLimit obj)voidinit()This method is called when the search limit is initialized.booleanIsUncheckedSolutionLimitReached()Returns true if the limit of solutions has been reached including
unchecked solutions.SearchLimitmakeClone()Allocates a clone of the limit.RegularLimitMakeIdenticalClone()intprogressPercent()Returns a percentage representing the propress of the search before
reaching limits.longsolutions()java.lang.StringtoString()voidUpdateLimits(SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions)longwall_time()Methods inherited from class com.google.ortools.constraintsolver.SearchLimit
beginNextDecision, crossed, enterSearch, getCPtr, periodicCheck, refuteDecisionMethods inherited from class com.google.ortools.constraintsolver.SearchMonitor
acceptDelta, acceptNeighbor, acceptSolution, AcceptUncheckedNeighbor, afterDecision, applyDecision, atSolution, beginFail, beginInitialPropagation, endFail, endInitialPropagation, endNextDecision, getCPtr, install, localOptimum, noMoreSolutions, restartSearch, solver, swigDirectorDisconnect, swigReleaseOwnership, swigTakeOwnershipMethods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtrMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
RegularLimit
protected 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
-
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
-
check
public boolean check()Description copied from class:SearchLimitThis 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.- Overrides:
checkin 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
public java.lang.String toString()- Overrides:
toStringin classSearchLimit
-
accept
Description copied from class:SearchMonitorAccepts the given model visitor.- Overrides:
acceptin classSearchMonitor
-