Class LocalSearchOperator
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.LocalSearchOperator
- Direct Known Subclasses:
IntVarLocalSearchOperatorTemplate,SequenceVarLocalSearchOperatorTemplate
public class LocalSearchOperator extends BaseObject
This class represent a reversible FIFO structure.
The main difference w.r.t a standard FIFO structure is that a Solver is
given as parameter to the modifiers such that the solver can store the
backtrack information
Iterator's traversing order should not be changed, as some algorithm
depend on it to be consistent.
It's main use is to store a list of demons in the various classes of
variables.
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.
The main difference w.r.t a standard FIFO structure is that a Solver is
given as parameter to the modifiers such that the solver can store the
backtrack information
Iterator's traversing order should not be changed, as some algorithm
depend on it to be consistent.
It's main use is to store a list of demons in the various classes of
variables.
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.
-
Field Summary
Fields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn -
Constructor Summary
Constructors Modifier Constructor Description LocalSearchOperator()protectedLocalSearchOperator(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and Type Method Description voiddelete()protected voidfinalize()protected static longgetCPtr(LocalSearchOperator obj)booleanHasFragments()booleanHoldsDelta()booleannextNeighbor(Assignment delta, Assignment deltadelta)voidreset()voidstart(Assignment assignment)protected voidswigDirectorDisconnect()voidswigReleaseOwnership()voidswigTakeOwnership()Methods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, toStringMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
LocalSearchOperator
protected LocalSearchOperator(long cPtr, boolean cMemoryOwn) -
LocalSearchOperator
public LocalSearchOperator()
-
-
Method Details
-
getCPtr
-
finalize
protected void finalize()- Overrides:
finalizein classBaseObject
-
delete
public void delete()- Overrides:
deletein classBaseObject
-
swigDirectorDisconnect
protected void swigDirectorDisconnect() -
swigReleaseOwnership
public void swigReleaseOwnership() -
swigTakeOwnership
public void swigTakeOwnership() -
nextNeighbor
-
start
-
reset
public void reset() -
HasFragments
public boolean HasFragments() -
HoldsDelta
public boolean HoldsDelta()
-