Java Reference

Java Reference

OptimizeVar

Detailed Description

This class encapsulates an objective.

It requires the direction (minimize or maximize), the variable to optimize, and the improvement step.

Definition at line 14 of file OptimizeVar.java.

Public Member Functions

synchronized void delete ()
 
 OptimizeVar (Solver s, boolean maximize, IntVar a, long step)
 
long best ()
 Returns the best value found during search. More...
 
IntVar var ()
 Returns the variable that is optimized. More...
 
boolean acceptDelta (Assignment delta, Assignment deltadelta)
 Internal methods. More...
 
void enterSearch ()
 Beginning of the search. More...
 
void beginNextDecision (DecisionBuilder db)
 Before calling DecisionBuilder::Next. More...
 
void refuteDecision (Decision d)
 Before refuting the decision. More...
 
boolean atSolution ()
 This method is called when a valid solution is found. More...
 
boolean acceptSolution ()
 This method is called when a solution is found. More...
 
String print ()
 
String toString ()
 
void accept (ModelVisitor visitor)
 Accepts the given model visitor. More...
 
void applyBound ()
 
void swigReleaseOwnership ()
 
void swigTakeOwnership ()
 
void restartSearch ()
 Restart the search. More...
 
void exitSearch ()
 End of the search. 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 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...
 
void noMoreSolutions ()
 When the search tree is finished. More...
 
boolean localOptimum ()
 When a local optimum is reached. More...
 
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 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

 OptimizeVar (long cPtr, boolean cMemoryOwn)
 
void swigDirectorDisconnect ()
 

Constructor & Destructor Documentation

◆ OptimizeVar() [1/2]

OptimizeVar ( long  cPtr,
boolean  cMemoryOwn 
)
inlineprotected

Definition at line 17 of file OptimizeVar.java.

◆ OptimizeVar() [2/2]

OptimizeVar ( Solver  s,
boolean  maximize,
IntVar  a,
long  step 
)
inline

Definition at line 42 of file OptimizeVar.java.

Member Function Documentation

◆ accept()

void accept ( ModelVisitor  visitor)
inline

Accepts the given model visitor.

Reimplemented from SearchMonitor.

Definition at line 96 of file OptimizeVar.java.

◆ acceptDelta()

boolean acceptDelta ( Assignment  delta,
Assignment  deltadelta 
)
inline

Internal methods.

Reimplemented from SearchMonitor.

Definition at line 64 of file OptimizeVar.java.

◆ acceptNeighbor()

void acceptNeighbor ( )
inlineinherited

After accepting a neighbor during local search.

Definition at line 181 of file SearchMonitor.java.

◆ acceptSolution()

boolean acceptSolution ( )
inline

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 from SearchMonitor.

Definition at line 84 of file OptimizeVar.java.

◆ AcceptUncheckedNeighbor()

void AcceptUncheckedNeighbor ( )
inlineinherited

After accepting an unchecked neighbor during local search.

Reimplemented in SearchLog.

Definition at line 188 of file SearchMonitor.java.

◆ afterDecision()

void afterDecision ( Decision  d,
boolean  apply 
)
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.

◆ applyBound()

void applyBound ( )
inline

Definition at line 100 of file OptimizeVar.java.

◆ applyDecision()

void applyDecision ( Decision  d)
inlineinherited

Before applying the decision.

Reimplemented in SearchLog.

Definition at line 100 of file SearchMonitor.java.

◆ atSolution()

boolean atSolution ( )
inline

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 from SearchMonitor.

Definition at line 80 of file OptimizeVar.java.

◆ beginFail()

void beginFail ( )
inlineinherited

Just when the failure occurs.

Reimplemented in SearchLog.

Definition at line 121 of file SearchMonitor.java.

◆ beginInitialPropagation()

void beginInitialPropagation ( )
inlineinherited

Before the initial propagation.

Reimplemented in SearchLog.

Definition at line 135 of file SearchMonitor.java.

◆ beginNextDecision()

void beginNextDecision ( DecisionBuilder  b)
inline

Before calling DecisionBuilder::Next.

Reimplemented from SearchMonitor.

Definition at line 72 of file OptimizeVar.java.

◆ best()

long best ( )
inline

Returns the best value found during search.

Definition at line 49 of file OptimizeVar.java.

◆ delete()

synchronized void delete ( )
inline

Reimplemented from SearchMonitor.

Definition at line 31 of file OptimizeVar.java.

◆ endFail()

void endFail ( )
inlineinherited

After completing the backtrack.

Definition at line 128 of file SearchMonitor.java.

◆ endInitialPropagation()

void endInitialPropagation ( )
inlineinherited

After the initial propagation.

Reimplemented in SearchLog.

Definition at line 142 of file SearchMonitor.java.

◆ endNextDecision()

void endNextDecision ( DecisionBuilder  b,
Decision  d 
)
inlineinherited

After calling DecisionBuilder::Next, along with the returned decision.

Definition at line 93 of file SearchMonitor.java.

◆ enterSearch()

void enterSearch ( )
inline

Beginning of the search.

Reimplemented from SearchMonitor.

Definition at line 68 of file OptimizeVar.java.

◆ exitSearch()

void exitSearch ( )
inlineinherited

End of the search.

Reimplemented in RegularLimit, and SearchLog.

Definition at line 79 of file SearchMonitor.java.

◆ install()

void 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()

boolean 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()

boolean 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()

void noMoreSolutions ( )
inlineinherited

When the search tree is finished.

Reimplemented in SearchLog.

Definition at line 163 of file SearchMonitor.java.

◆ periodicCheck()

void periodicCheck ( )
inlineinherited

Periodic call to check limits in long running methods.

Reimplemented in SearchLimit.

Definition at line 207 of file SearchMonitor.java.

◆ print()

String print ( )
inline

Definition at line 88 of file OptimizeVar.java.

◆ progressPercent()

int 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()

void refuteDecision ( Decision  d)
inline

Before refuting the decision.

Reimplemented from SearchMonitor.

Definition at line 76 of file OptimizeVar.java.

◆ restartSearch()

void restartSearch ( )
inlineinherited

Restart the search.

Definition at line 72 of file SearchMonitor.java.

◆ solver()

Solver solver ( )
inlineinherited

Definition at line 199 of file SearchMonitor.java.

◆ swigDirectorDisconnect()

void swigDirectorDisconnect ( )
inlineprotectedinherited

Definition at line 42 of file SearchMonitor.java.

◆ swigReleaseOwnership()

void swigReleaseOwnership ( )
inlineinherited

Definition at line 47 of file SearchMonitor.java.

◆ swigTakeOwnership()

void swigTakeOwnership ( )
inlineinherited

Definition at line 52 of file SearchMonitor.java.

◆ toString()

String toString ( )
inline

Reimplemented from BaseObject.

Definition at line 92 of file OptimizeVar.java.

◆ var()

IntVar var ( )
inline

Returns the variable that is optimized.

Definition at line 56 of file OptimizeVar.java.

Member Data Documentation

◆ kNoProgress

final int kNoProgress = mainJNI.SearchMonitor_kNoProgress_get()
staticinherited

Definition at line 232 of file SearchMonitor.java.


The documentation for this class was generated from the following file: