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
-
-
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 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ModelVisitor visitor)Accepts the given model visitor.longbranches()booleanCheckWithOffset(SWIGTYPE_p_absl__Duration offset)Same 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()voidexitSearch()End of the search.longfailures()protected voidfinalize()protected 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.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()protected static longswigRelease(RegularLimit obj)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, check, crossed, enterSearch, getCPtr, keepAliveDecisionBuilder, periodicCheck, refuteDecision, swigRelease
-
Methods 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, swigTakeOwnership
-
Methods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease
-
-
-
-
Constructor Detail
-
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 Detail
-
getCPtr
protected static long getCPtr(RegularLimit obj)
-
swigRelease
protected static long swigRelease(RegularLimit obj)
-
finalize
protected void finalize()
- Overrides:
finalizein classSearchLimit
-
delete
public void delete()
- Overrides:
deletein classSearchLimit
-
copy
public void copy(SearchLimit limit)
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
public SearchLimit makeClone()
Description copied from class:SearchLimitAllocates a clone of the limit.- Overrides:
makeClonein classSearchLimit
-
MakeIdenticalClone
public RegularLimit MakeIdenticalClone()
-
CheckWithOffset
public boolean CheckWithOffset(SWIGTYPE_p_absl__Duration offset)
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
public java.lang.String 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
public void accept(ModelVisitor visitor)
Description copied from class:SearchMonitorAccepts the given model visitor.- Overrides:
acceptin classSearchMonitor
-
-