Java Reference

Java Reference

CPFeasibilityFilter

Detailed Description

This filter accepts deltas for which the assignment satisfies the constraints of the Solver.

This is verified by keeping an internal copy of the assignment with all Next vars and their updated values, and calling RestoreAssignment() on the assignment+delta. exception of Next Vars (woud fail on large instances). WARNING: In the case of mandatory nodes, when all vehicles are currently being used in the solution but uninserted nodes still remain, this filter will reject the solution, even if the node could be inserted on one of these routes, because all Next vars of vehicle starts are already instantiated.

Definition at line 14 of file CPFeasibilityFilter.java.

Public Member Functions

synchronized void delete ()
 
 CPFeasibilityFilter (RoutingModel routing_model)
 
String toString ()
 
boolean accept (Assignment delta, Assignment deltadelta, long objective_min, long objective_max)
 Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds the variables which have been modified and their new value. More...
 
void onSynchronize (Assignment delta)
 
void swigReleaseOwnership ()
 
void swigTakeOwnership ()
 
void synchronize (Assignment assignment, Assignment delta)
 This method should not be overridden. More...
 
void addVars (IntVar[] vars)
 Add variables to "track" to the filter. More...
 
int size ()
 
IntVar var (int index)
 
long value (int index)
 
int index (IntVar var)
 
void Relax (Assignment delta, Assignment deltadelta)
 Lets the filter know what delta and deltadelta will be passed in the next Accept(). More...
 
boolean isIncremental ()
 
void Revert ()
 Cancels the changes made by the last Relax()/Accept() calls. More...
 
long getSynchronizedObjectiveValue ()
 Objective value from last time Synchronize() was called. More...
 
long getAcceptedObjectiveValue ()
 Objective value from the last time Accept() was called and returned true. More...
 

Protected Member Functions

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

Constructor & Destructor Documentation

◆ CPFeasibilityFilter() [1/2]

CPFeasibilityFilter ( long  cPtr,
boolean  cMemoryOwn 
)
inlineprotected

Definition at line 17 of file CPFeasibilityFilter.java.

◆ CPFeasibilityFilter() [2/2]

CPFeasibilityFilter ( RoutingModel  routing_model)
inline

Definition at line 42 of file CPFeasibilityFilter.java.

Member Function Documentation

◆ accept()

boolean accept ( Assignment  delta,
Assignment  deltadelta,
long  objective_min,
long  objective_max 
)
inline

Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds the variables which have been modified and their new value.

If the filter represents a part of the global objective, its contribution must be between objective_min and objective_max. Sample: supposing one wants to maintain a[0,1] + b[0,1] <= 1, for the assignment (a,1), (b,0), the delta (b,1) will be rejected but the delta (a,0) will be accepted. TODO(user): Remove arguments when there are no more need for those.

Reimplemented from LocalSearchFilter.

Definition at line 50 of file CPFeasibilityFilter.java.

◆ addVars()

void addVars ( IntVar[]  vars)
inlineinherited

Add variables to "track" to the filter.

Definition at line 73 of file IntVarLocalSearchFilter.java.

◆ delete()

synchronized void delete ( )
inline

Reimplemented from IntVarLocalSearchFilter.

Definition at line 31 of file CPFeasibilityFilter.java.

◆ getAcceptedObjectiveValue()

long getAcceptedObjectiveValue ( )
inlineinherited

Objective value from the last time Accept() was called and returned true.

Definition at line 99 of file LocalSearchFilter.java.

◆ getSynchronizedObjectiveValue()

long getSynchronizedObjectiveValue ( )
inlineinherited

Objective value from last time Synchronize() was called.

Definition at line 92 of file LocalSearchFilter.java.

◆ index()

int index ( IntVar  var)
inlineinherited

Definition at line 94 of file IntVarLocalSearchFilter.java.

◆ isIncremental()

boolean isIncremental ( )
inlineinherited

Definition at line 71 of file LocalSearchFilter.java.

◆ onSynchronize()

void onSynchronize ( Assignment  delta)
inline

Reimplemented from IntVarLocalSearchFilter.

Definition at line 54 of file CPFeasibilityFilter.java.

◆ Relax()

void Relax ( Assignment  delta,
Assignment  deltadelta 
)
inlineinherited

Lets the filter know what delta and deltadelta will be passed in the next Accept().

Definition at line 60 of file LocalSearchFilter.java.

◆ Revert()

void Revert ( )
inlineinherited

Cancels the changes made by the last Relax()/Accept() calls.

Definition at line 85 of file LocalSearchFilter.java.

◆ size()

int size ( )
inlineinherited

Definition at line 77 of file IntVarLocalSearchFilter.java.

◆ swigDirectorDisconnect()

void swigDirectorDisconnect ( )
inlineprotectedinherited

Reimplemented from LocalSearchFilter.

Definition at line 43 of file IntVarLocalSearchFilter.java.

◆ swigReleaseOwnership()

void swigReleaseOwnership ( )
inlineinherited

Reimplemented from LocalSearchFilter.

Definition at line 48 of file IntVarLocalSearchFilter.java.

◆ swigTakeOwnership()

void swigTakeOwnership ( )
inlineinherited

Reimplemented from LocalSearchFilter.

Definition at line 53 of file IntVarLocalSearchFilter.java.

◆ synchronize()

void synchronize ( Assignment  assignment,
Assignment  delta 
)
inlineinherited

This method should not be overridden.

Override OnSynchronize() instead which is called before exiting this method.

Reimplemented from LocalSearchFilter.

Definition at line 66 of file IntVarLocalSearchFilter.java.

◆ toString()

String toString ( )
inline

Reimplemented from BaseObject.

Definition at line 46 of file CPFeasibilityFilter.java.

◆ value()

long value ( int  index)
inlineinherited

Definition at line 86 of file IntVarLocalSearchFilter.java.

◆ var()

IntVar var ( int  index)
inlineinherited

Definition at line 81 of file IntVarLocalSearchFilter.java.


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