Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Public Member Functions | |
synchronized void | delete () |
void | swigReleaseOwnership () |
void | swigTakeOwnership () |
BaseLns (IntVar[] vars) | |
void | initFragments () |
boolean | nextFragment () |
void | appendToFragment (int index) |
int | fragmentSize () |
boolean | HasFragments () |
Public Member Functions inherited from com.google.ortools.constraintsolver.IntVarLocalSearchOperator | |
IntVarLocalSearchOperator (IntVar[] vars, boolean keep_inverse_values) | |
IntVarLocalSearchOperator (IntVar[] vars) | |
boolean | HoldsDelta () |
void | start (Assignment assignment) |
boolean | isIncremental () |
int | size () |
long | value (long index) |
IntVar | var (long index) |
boolean | SkipUnchanged (int index) |
long | oldValue (long index) |
long | PrevValue (long index) |
void | setValue (long index, long value) |
boolean | activated (long index) |
void | activate (long index) |
void | deactivate (long index) |
boolean | ApplyChanges (Assignment delta, Assignment deltadelta) |
void | RevertChanges (boolean change_was_incremental) |
void | addVars (IntVar[] vars) |
void | onStart () |
Public Member Functions inherited from com.google.ortools.constraintsolver.LocalSearchOperator | |
LocalSearchOperator () | |
boolean | nextNeighbor (Assignment delta, Assignment deltadelta) |
void | reset () |
Public Member Functions inherited from com.google.ortools.constraintsolver.BaseObject | |
BaseObject () | |
String | toString () |
Protected Member Functions | |
BaseLns (long cPtr, boolean cMemoryOwn) | |
void | finalize () |
void | swigDirectorDisconnect () |
Protected Member Functions inherited from com.google.ortools.constraintsolver.IntVarLocalSearchOperator | |
IntVarLocalSearchOperator (long cPtr, boolean cMemoryOwn) | |
boolean | oneNeighbor () |
Protected Member Functions inherited from com.google.ortools.constraintsolver.LocalSearchOperator | |
LocalSearchOperator (long cPtr, boolean cMemoryOwn) | |
Protected Member Functions inherited from com.google.ortools.constraintsolver.BaseObject | |
BaseObject (long cPtr, boolean cMemoryOwn) | |
Static Protected Member Functions | |
static long | getCPtr (BaseLns obj) |
static long | swigRelease (BaseLns obj) |
Static Protected Member Functions inherited from com.google.ortools.constraintsolver.IntVarLocalSearchOperator | |
static long | getCPtr (IntVarLocalSearchOperator obj) |
static long | swigRelease (IntVarLocalSearchOperator obj) |
Static Protected Member Functions inherited from com.google.ortools.constraintsolver.LocalSearchOperator | |
static long | getCPtr (LocalSearchOperator obj) |
static long | swigRelease (LocalSearchOperator obj) |
Static Protected Member Functions inherited from com.google.ortools.constraintsolver.BaseObject | |
static long | getCPtr (BaseObject obj) |
static long | swigRelease (BaseObject obj) |
Additional Inherited Members | |
Protected Attributes inherited from com.google.ortools.constraintsolver.BaseObject | |
transient boolean | swigCMemOwn |
This is the base class for building an Lns operator. An Lns fragment is a
collection of variables which will be relaxed. Fragments are built with
NextFragment(), which returns false if there are no more fragments to build.
Optionally one can override InitFragments, which is called from
LocalSearchOperator::Start to initialize fragment data.
Here's a sample relaxing one variable at a time:
class OneVarLns : public BaseLns {
public:
OneVarLns(const std::vector<IntVar*>& vars) : BaseLns(vars), index_(0) {}
virtual ~OneVarLns() {}
virtual void InitFragments() { index_ = 0; }
virtual bool NextFragment() {
const int size = Size();
if (index_ < size) {
AppendToFragment(index_);
++index_;
return true;
} else {
return false;
}
}
private:
int index_;
};
Definition at line 40 of file BaseLns.java.
|
protected |
Definition at line 43 of file BaseLns.java.
com.google.ortools.constraintsolver.BaseLns.BaseLns | ( | IntVar[] | vars | ) |
Definition at line 95 of file BaseLns.java.
void com.google.ortools.constraintsolver.BaseLns.appendToFragment | ( | int | index | ) |
Definition at line 108 of file BaseLns.java.
synchronized void com.google.ortools.constraintsolver.BaseLns.delete | ( | ) |
Reimplemented from com.google.ortools.constraintsolver.IntVarLocalSearchOperator.
Definition at line 69 of file BaseLns.java.
|
protected |
Reimplemented from com.google.ortools.constraintsolver.IntVarLocalSearchOperator.
Definition at line 65 of file BaseLns.java.
int com.google.ortools.constraintsolver.BaseLns.fragmentSize | ( | ) |
Definition at line 112 of file BaseLns.java.
|
staticprotected |
Definition at line 48 of file BaseLns.java.
boolean com.google.ortools.constraintsolver.BaseLns.HasFragments | ( | ) |
Reimplemented from com.google.ortools.constraintsolver.LocalSearchOperator.
Definition at line 116 of file BaseLns.java.
void com.google.ortools.constraintsolver.BaseLns.initFragments | ( | ) |
Definition at line 100 of file BaseLns.java.
boolean com.google.ortools.constraintsolver.BaseLns.nextFragment | ( | ) |
Definition at line 104 of file BaseLns.java.
|
protected |
Reimplemented from com.google.ortools.constraintsolver.IntVarLocalSearchOperator.
Definition at line 80 of file BaseLns.java.
|
staticprotected |
Definition at line 52 of file BaseLns.java.
void com.google.ortools.constraintsolver.BaseLns.swigReleaseOwnership | ( | ) |
Reimplemented from com.google.ortools.constraintsolver.IntVarLocalSearchOperator.
Definition at line 85 of file BaseLns.java.
void com.google.ortools.constraintsolver.BaseLns.swigTakeOwnership | ( | ) |
Reimplemented from com.google.ortools.constraintsolver.IntVarLocalSearchOperator.
Definition at line 90 of file BaseLns.java.