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
kNoProgress
Fields 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 TypeMethodDescriptionvoid
accept
(ModelVisitor visitor) Accepts the given model visitor.long
branches()
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.void
delete()
void
End of the search.long
failures()
protected void
finalize()
static long
getCPtr
(RegularLimit 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.boolean
Returns true if the limit of solutions has been reached including
unchecked solutions.Allocates a clone of the limit.int
Returns a percentage representing the propress of the search before
reaching limits.long
static long
swigRelease
(RegularLimit obj) toString()
void
UpdateLimits
(SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions) long
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 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:
finalize
in classSearchLimit
-
delete
public void delete()- Overrides:
delete
in classSearchLimit
-
copy
Description copied from class:SearchLimit
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.- Overrides:
copy
in classSearchLimit
-
makeClone
Description copied from class:SearchLimit
Allocates a clone of the limit.- Overrides:
makeClone
in classSearchLimit
-
MakeIdenticalClone
-
CheckWithOffset
Description copied from class:SearchLimit
Same as Check() but adds the 'offset' value to the current time when time
is considered in the limit.- Overrides:
CheckWithOffset
in classSearchLimit
-
init
public void init()Description copied from class:SearchLimit
This method is called when the search limit is initialized.- Overrides:
init
in classSearchLimit
-
exitSearch
public void exitSearch()Description copied from class:SearchMonitor
End of the search.- Overrides:
exitSearch
in 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:SearchMonitor
Returns true if the limit of solutions has been reached including
unchecked solutions.- Overrides:
IsUncheckedSolutionLimitReached
in classSearchMonitor
-
progressPercent
public int progressPercent()Description copied from class:SearchMonitor
Returns a percentage representing the propress of the search before
reaching limits.- Overrides:
progressPercent
in classSearchMonitor
-
toString
- Overrides:
toString
in classSearchLimit
-
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 classSearchLimit
-
accept
Description copied from class:SearchMonitor
Accepts the given model visitor.- Overrides:
accept
in classSearchMonitor
-