Java Reference
Java Reference
Detailed Description
This class is the root class of all solution collectors.
It implements a basic query API to be used independently of the collector used.
Definition at line 14 of file SolutionCollector.java.
Public Member Functions | |
| synchronized void | delete () |
| SolutionCollector (Solver solver, Assignment assignment) | |
| SolutionCollector (Solver solver) | |
| String | toString () |
| void | add (IntVar var) |
| Add API. More... | |
| void | add (IntVar[] vars) |
| void | add (IntervalVar var) |
| void | add (IntervalVar[] vars) |
| void | add (SequenceVar var) |
| void | add (SequenceVar[] vars) |
| void | addObjective (IntVar objective) |
| void | enterSearch () |
| Beginning of the search. More... | |
| int | solutionCount () |
| Returns how many solutions were stored during the search. More... | |
| Assignment | solution (int n) |
| Returns the nth solution. More... | |
| long | wallTime (int n) |
| Returns the wall time in ms for the nth solution. More... | |
| long | branches (int n) |
| Returns the number of branches when the nth solution was found. More... | |
| long | failures (int n) |
| Returns the number of failures encountered at the time of the nth solution. More... | |
| long | objectiveValue (int n) |
| Returns the objective value of the nth solution. More... | |
| long | value (int n, IntVar var) |
| This is a shortcut to get the Value of 'var' in the nth solution. More... | |
| long | startValue (int n, IntervalVar var) |
| This is a shortcut to get the StartValue of 'var' in the nth solution. More... | |
| long | endValue (int n, IntervalVar var) |
| This is a shortcut to get the EndValue of 'var' in the nth solution. More... | |
| long | durationValue (int n, IntervalVar var) |
| This is a shortcut to get the DurationValue of 'var' in the nth solution. More... | |
| long | performedValue (int n, IntervalVar var) |
| This is a shortcut to get the PerformedValue of 'var' in the nth solution. More... | |
| int[] | forwardSequence (int n, SequenceVar var) |
| This is a shortcut to get the ForwardSequence of 'var' in the nth solution. More... | |
| int[] | backwardSequence (int n, SequenceVar var) |
| This is a shortcut to get the BackwardSequence of 'var' in the nth solution. More... | |
| int[] | unperformed (int n, SequenceVar var) |
| This is a shortcut to get the list of unperformed of 'var' in the nth solution. More... | |
| void | swigReleaseOwnership () |
| void | swigTakeOwnership () |
| void | restartSearch () |
| Restart the search. More... | |
| void | exitSearch () |
| End of the search. More... | |
| void | beginNextDecision (DecisionBuilder b) |
| Before calling DecisionBuilder::Next. More... | |
| void | endNextDecision (DecisionBuilder b, Decision d) |
| After calling DecisionBuilder::Next, along with the returned decision. More... | |
| void | applyDecision (Decision d) |
| Before applying the decision. More... | |
| void | refuteDecision (Decision d) |
| Before refuting the decision. More... | |
| void | afterDecision (Decision d, boolean apply) |
| Just after refuting or applying the decision, apply is true after Apply. More... | |
| void | beginFail () |
| Just when the failure occurs. More... | |
| void | endFail () |
| After completing the backtrack. More... | |
| void | beginInitialPropagation () |
| Before the initial propagation. More... | |
| void | endInitialPropagation () |
| After the initial propagation. More... | |
| boolean | acceptSolution () |
| This method is called when a solution is found. More... | |
| boolean | atSolution () |
| This method is called when a valid solution is found. More... | |
| void | noMoreSolutions () |
| When the search tree is finished. More... | |
| boolean | localOptimum () |
| When a local optimum is reached. More... | |
| boolean | acceptDelta (Assignment delta, Assignment deltadelta) |
| void | acceptNeighbor () |
| After accepting a neighbor during local search. More... | |
| void | AcceptUncheckedNeighbor () |
| After accepting an unchecked neighbor during local search. More... | |
| boolean | IsUncheckedSolutionLimitReached () |
| Returns true if the limit of solutions has been reached including unchecked solutions. More... | |
| Solver | solver () |
| void | periodicCheck () |
| Periodic call to check limits in long running methods. More... | |
| int | progressPercent () |
| Returns a percentage representing the propress of the search before reaching limits. More... | |
| void | accept (ModelVisitor visitor) |
| Accepts the given model visitor. More... | |
| void | install () |
| Registers itself on the solver such that it gets notified of the search and propagation events. More... | |
Static Public Attributes | |
| static final int | kNoProgress = mainJNI.SearchMonitor_kNoProgress_get() |
Protected Member Functions | |
| SolutionCollector (long cPtr, boolean cMemoryOwn) | |
| void | swigDirectorDisconnect () |
Constructor & Destructor Documentation
◆ SolutionCollector() [1/3]
|
inlineprotected |
Definition at line 17 of file SolutionCollector.java.
◆ SolutionCollector() [2/3]
|
inline |
Definition at line 42 of file SolutionCollector.java.
◆ SolutionCollector() [3/3]
|
inline |
Definition at line 46 of file SolutionCollector.java.
Member Function Documentation
◆ accept()
|
inlineinherited |
Accepts the given model visitor.
Reimplemented in RegularLimit, and OptimizeVar.
Definition at line 221 of file SearchMonitor.java.
◆ acceptDelta()
|
inlineinherited |
Reimplemented in OptimizeVar.
Definition at line 174 of file SearchMonitor.java.
◆ acceptNeighbor()
|
inlineinherited |
After accepting a neighbor during local search.
Definition at line 181 of file SearchMonitor.java.
◆ acceptSolution()
|
inlineinherited |
This method is called when a solution is found.
It asserts whether the solution is valid. A value of false indicates that the solution should be discarded.
Reimplemented in OptimizeVar.
Definition at line 149 of file SearchMonitor.java.
◆ AcceptUncheckedNeighbor()
|
inlineinherited |
After accepting an unchecked neighbor during local search.
Reimplemented in SearchLog.
Definition at line 188 of file SearchMonitor.java.
◆ add() [1/6]
|
inline |
Definition at line 65 of file SolutionCollector.java.
◆ add() [2/6]
|
inline |
Definition at line 69 of file SolutionCollector.java.
◆ add() [3/6]
|
inline |
Add API.
Definition at line 57 of file SolutionCollector.java.
◆ add() [4/6]
|
inline |
Definition at line 61 of file SolutionCollector.java.
◆ add() [5/6]
|
inline |
Definition at line 73 of file SolutionCollector.java.
◆ add() [6/6]
|
inline |
Definition at line 77 of file SolutionCollector.java.
◆ addObjective()
|
inline |
Definition at line 81 of file SolutionCollector.java.
◆ afterDecision()
|
inlineinherited |
Just after refuting or applying the decision, apply is true after Apply.
This is called only if the Apply() or Refute() methods have not failed.
Definition at line 114 of file SearchMonitor.java.
◆ applyDecision()
|
inlineinherited |
Before applying the decision.
Reimplemented in SearchLog.
Definition at line 100 of file SearchMonitor.java.
◆ atSolution()
|
inlineinherited |
This method is called when a valid solution is found.
If the return value is true, then search will resume after. If the result is false, then search will stop there.
Reimplemented in OptimizeVar, and SearchLog.
Definition at line 156 of file SearchMonitor.java.
◆ backwardSequence()
|
inline |
This is a shortcut to get the BackwardSequence of 'var' in the nth solution.
The backward sequence is the list of ranked interval variables starting from the end of the sequence.
Definition at line 180 of file SolutionCollector.java.
◆ beginFail()
|
inlineinherited |
Just when the failure occurs.
Reimplemented in SearchLog.
Definition at line 121 of file SearchMonitor.java.
◆ beginInitialPropagation()
|
inlineinherited |
Before the initial propagation.
Reimplemented in SearchLog.
Definition at line 135 of file SearchMonitor.java.
◆ beginNextDecision()
|
inlineinherited |
Before calling DecisionBuilder::Next.
Reimplemented in OptimizeVar, and SearchLimit.
Definition at line 86 of file SearchMonitor.java.
◆ branches()
|
inline |
Returns the number of branches when the nth solution was found.
Definition at line 117 of file SolutionCollector.java.
◆ delete()
|
inline |
Reimplemented from SearchMonitor.
Definition at line 31 of file SolutionCollector.java.
◆ durationValue()
|
inline |
This is a shortcut to get the DurationValue of 'var' in the nth solution.
Definition at line 159 of file SolutionCollector.java.
◆ endFail()
|
inlineinherited |
After completing the backtrack.
Definition at line 128 of file SearchMonitor.java.
◆ endInitialPropagation()
|
inlineinherited |
After the initial propagation.
Reimplemented in SearchLog.
Definition at line 142 of file SearchMonitor.java.
◆ endNextDecision()
|
inlineinherited |
After calling DecisionBuilder::Next, along with the returned decision.
Definition at line 93 of file SearchMonitor.java.
◆ endValue()
|
inline |
This is a shortcut to get the EndValue of 'var' in the nth solution.
Definition at line 152 of file SolutionCollector.java.
◆ enterSearch()
|
inline |
Beginning of the search.
Reimplemented from SearchMonitor.
Definition at line 88 of file SolutionCollector.java.
◆ exitSearch()
|
inlineinherited |
End of the search.
Reimplemented in RegularLimit, and SearchLog.
Definition at line 79 of file SearchMonitor.java.
◆ failures()
|
inline |
Returns the number of failures encountered at the time of the nth solution.
Definition at line 124 of file SolutionCollector.java.
◆ forwardSequence()
|
inline |
This is a shortcut to get the ForwardSequence of 'var' in the nth solution.
The forward sequence is the list of ranked interval variables starting from the start of the sequence.
Definition at line 173 of file SolutionCollector.java.
◆ install()
|
inlineinherited |
Registers itself on the solver such that it gets notified of the search and propagation events.
Reimplemented in PropagationMonitor, and LocalSearchMonitor.
Definition at line 228 of file SearchMonitor.java.
◆ IsUncheckedSolutionLimitReached()
|
inlineinherited |
Returns true if the limit of solutions has been reached including unchecked solutions.
Reimplemented in RegularLimit.
Definition at line 195 of file SearchMonitor.java.
◆ localOptimum()
|
inlineinherited |
When a local optimum is reached.
If 'true' is returned, the last solution is discarded and the search proceeds with the next one.
Definition at line 170 of file SearchMonitor.java.
◆ noMoreSolutions()
|
inlineinherited |
When the search tree is finished.
Reimplemented in SearchLog.
Definition at line 163 of file SearchMonitor.java.
◆ objectiveValue()
|
inline |
Returns the objective value of the nth solution.
Definition at line 131 of file SolutionCollector.java.
◆ performedValue()
|
inline |
This is a shortcut to get the PerformedValue of 'var' in the nth solution.
Definition at line 166 of file SolutionCollector.java.
◆ periodicCheck()
|
inlineinherited |
Periodic call to check limits in long running methods.
Reimplemented in SearchLimit.
Definition at line 207 of file SearchMonitor.java.
◆ progressPercent()
|
inlineinherited |
Returns a percentage representing the propress of the search before reaching limits.
Reimplemented in RegularLimit.
Definition at line 214 of file SearchMonitor.java.
◆ refuteDecision()
|
inlineinherited |
Before refuting the decision.
Reimplemented in SearchLog, SearchLimit, and OptimizeVar.
Definition at line 107 of file SearchMonitor.java.
◆ restartSearch()
|
inlineinherited |
Restart the search.
Definition at line 72 of file SearchMonitor.java.
◆ solution()
|
inline |
Returns the nth solution.
Definition at line 102 of file SolutionCollector.java.
◆ solutionCount()
|
inline |
Returns how many solutions were stored during the search.
Definition at line 95 of file SolutionCollector.java.
◆ solver()
|
inlineinherited |
Definition at line 199 of file SearchMonitor.java.
◆ startValue()
|
inline |
This is a shortcut to get the StartValue of 'var' in the nth solution.
Definition at line 145 of file SolutionCollector.java.
◆ swigDirectorDisconnect()
|
inlineprotectedinherited |
Definition at line 42 of file SearchMonitor.java.
◆ swigReleaseOwnership()
|
inlineinherited |
Definition at line 47 of file SearchMonitor.java.
◆ swigTakeOwnership()
|
inlineinherited |
Definition at line 52 of file SearchMonitor.java.
◆ toString()
|
inline |
Reimplemented from BaseObject.
Definition at line 50 of file SolutionCollector.java.
◆ unperformed()
|
inline |
This is a shortcut to get the list of unperformed of 'var' in the nth solution.
Definition at line 187 of file SolutionCollector.java.
◆ value()
|
inline |
This is a shortcut to get the Value of 'var' in the nth solution.
Definition at line 138 of file SolutionCollector.java.
◆ wallTime()
|
inline |
Returns the wall time in ms for the nth solution.
Definition at line 110 of file SolutionCollector.java.
Member Data Documentation
◆ kNoProgress
|
staticinherited |
Definition at line 232 of file SearchMonitor.java.
The documentation for this class was generated from the following file: