Class LocalSearchOperator
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.LocalSearchOperator
- Direct Known Subclasses:
IntVarLocalSearchOperator
The base class for all local search operators.
A local search operator is an object that defines the neighborhood of a
solution. In other words, a neighborhood is the set of solutions which can
be reached from a given solution using an operator.
The behavior of the LocalSearchOperator class is similar to iterators.
The operator is synchronized with an assignment (gives the
current values of the variables); this is done in the Start() method.
Then one can iterate over the neighbors using the MakeNextNeighbor method.
This method returns an assignment which represents the incremental changes
to the current solution. It also returns a second assignment representing
the changes to the last solution defined by the neighborhood operator; this
assignment is empty if the neighborhood operator cannot track this
information.
A local search operator is an object that defines the neighborhood of a
solution. In other words, a neighborhood is the set of solutions which can
be reached from a given solution using an operator.
The behavior of the LocalSearchOperator class is similar to iterators.
The operator is synchronized with an assignment (gives the
current values of the variables); this is done in the Start() method.
Then one can iterate over the neighbors using the MakeNextNeighbor method.
This method returns an assignment which represents the incremental changes
to the current solution. It also returns a second assignment representing
the changes to the last solution defined by the neighborhood operator; this
assignment is empty if the neighborhood operator cannot track this
information.
-
Field Summary
Fields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
void
protected void
finalize()
static long
boolean
boolean
boolean
nextNeighbor
(Assignment delta, Assignment deltadelta) void
reset()
void
start
(Assignment assignment) protected void
static long
void
void
Methods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease, toString
-
Constructor Details
-
LocalSearchOperator
public LocalSearchOperator(long cPtr, boolean cMemoryOwn) -
LocalSearchOperator
public LocalSearchOperator()
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classBaseObject
-
delete
public void delete()- Overrides:
delete
in classBaseObject
-
swigDirectorDisconnect
protected void swigDirectorDisconnect() -
swigReleaseOwnership
public void swigReleaseOwnership() -
swigTakeOwnership
public void swigTakeOwnership() -
nextNeighbor
-
EnterSearch
public void EnterSearch() -
start
-
reset
public void reset() -
HasFragments
public boolean HasFragments() -
HoldsDelta
public boolean HoldsDelta()
-