Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.constraintsolver.PathOperator Class Reference
Inheritance diagram for com.google.ortools.constraintsolver.PathOperator:
com.google.ortools.constraintsolver.IntVarLocalSearchOperator com.google.ortools.constraintsolver.LocalSearchOperator com.google.ortools.constraintsolver.BaseObject

Public Member Functions

synchronized void delete ()
 
void swigReleaseOwnership ()
 
void swigTakeOwnership ()
 
 PathOperator (IntVar[] next_vars, IntVar[] path_vars, SWIGTYPE_p_operations_research__PathOperator__IterationParameters iteration_parameters)
 
 PathOperator (IntVar[] next_vars, IntVar[] path_vars, int number_of_base_nodes, boolean skip_locally_optimal_paths, boolean accept_path_end_base, LongToIntFunction start_empty_path_class, SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t get_neighbors)
 
boolean neighbor ()
 
void reset ()
 
long Prev (long node)
 
- 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)
 
boolean HasFragments ()
 
- Public Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
 BaseObject ()
 
String toString ()
 

Protected Member Functions

 PathOperator (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 
void swigDirectorDisconnect ()
 
boolean oneNeighbor ()
 
void OnNodeInitialization ()
 
boolean restartAtPathStartOnSynchronize ()
 
boolean onSamePathAsPreviousBase (long base_index)
 
long getBaseNodeRestartPosition (int base_index)
 
void setNextBaseToIncrement (long base_index)
 
boolean ConsiderAlternatives (long base_index)
 
boolean initPosition ()
 
- Protected Member Functions inherited from com.google.ortools.constraintsolver.IntVarLocalSearchOperator
 IntVarLocalSearchOperator (long cPtr, boolean cMemoryOwn)
 
- 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 (PathOperator obj)
 
static long swigRelease (PathOperator 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
 

Detailed Description

Base class of the local search operators dedicated to path modifications
(a path is a set of nodes linked together by arcs).
This family of neighborhoods supposes they are handling next variables
representing the arcs (var[i] represents the node immediately after i on
a path).
Several services are provided:

  • arc manipulators (SetNext(), ReverseChain(), MoveChain())
  • path inspectors (Next(), Prev(), IsPathEnd())
  • path iterators: operators need a given number of nodes to define a
    neighbor; this class provides the iteration on a given number of (base)
    nodes which can be used to define a neighbor (through the BaseNode method)
    Subclasses only need to override MakeNeighbor to create neighbors using
    the services above (no direct manipulation of assignments).

Definition at line 30 of file PathOperator.java.

Constructor & Destructor Documentation

◆ PathOperator() [1/3]

com.google.ortools.constraintsolver.PathOperator.PathOperator ( long cPtr,
boolean cMemoryOwn )
protected

Definition at line 33 of file PathOperator.java.

◆ PathOperator() [2/3]

com.google.ortools.constraintsolver.PathOperator.PathOperator ( IntVar[] next_vars,
IntVar[] path_vars,
SWIGTYPE_p_operations_research__PathOperator__IterationParameters iteration_parameters )

Builds an instance of PathOperator from next and path variables.

Definition at line 88 of file PathOperator.java.

◆ PathOperator() [3/3]

com.google.ortools.constraintsolver.PathOperator.PathOperator ( IntVar[] next_vars,
IntVar[] path_vars,
int number_of_base_nodes,
boolean skip_locally_optimal_paths,
boolean accept_path_end_base,
LongToIntFunction start_empty_path_class,
SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t get_neighbors )

Definition at line 93 of file PathOperator.java.

Member Function Documentation

◆ ConsiderAlternatives()

boolean com.google.ortools.constraintsolver.PathOperator.ConsiderAlternatives ( long base_index)
protected

Indicates if alternatives should be considered when iterating over base
nodes.

Definition at line 174 of file PathOperator.java.

◆ delete()

synchronized void com.google.ortools.constraintsolver.PathOperator.delete ( )

◆ finalize()

void com.google.ortools.constraintsolver.PathOperator.finalize ( )
protected

◆ getBaseNodeRestartPosition()

long com.google.ortools.constraintsolver.PathOperator.getBaseNodeRestartPosition ( int base_index)
protected

Returns the index of the node to which the base node of index base_index
must be set to when it reaches the end of a path.
By default, it is set to the start of the current path.
When this method is called, one can only assume that base nodes with
indices < base_index have their final position.

Definition at line 158 of file PathOperator.java.

◆ getCPtr()

static long com.google.ortools.constraintsolver.PathOperator.getCPtr ( PathOperator obj)
staticprotected

Definition at line 38 of file PathOperator.java.

◆ initPosition()

boolean com.google.ortools.constraintsolver.PathOperator.initPosition ( )
protected

Returns true if the operator needs to restart its initial position at each
call to Start()

Definition at line 182 of file PathOperator.java.

◆ neighbor()

boolean com.google.ortools.constraintsolver.PathOperator.neighbor ( )

Definition at line 98 of file PathOperator.java.

◆ oneNeighbor()

boolean com.google.ortools.constraintsolver.PathOperator.oneNeighbor ( )
protected

This method should not be overridden. Override MakeNeighbor() instead.

Reimplemented from com.google.ortools.constraintsolver.IntVarLocalSearchOperator.

Definition at line 116 of file PathOperator.java.

◆ OnNodeInitialization()

void com.google.ortools.constraintsolver.PathOperator.OnNodeInitialization ( )
protected

Called by OnStart() after initializing node information. Should be
overridden instead of OnStart() to avoid calling PathOperator::OnStart
explicitly.

Definition at line 125 of file PathOperator.java.

◆ onSamePathAsPreviousBase()

boolean com.google.ortools.constraintsolver.PathOperator.onSamePathAsPreviousBase ( long base_index)
protected

Returns true if a base node has to be on the same path as the "previous"
base node (base node of index base_index - 1).
Useful to limit neighborhood exploration to nodes on the same path.
it's currently way more complicated to implement.

Definition at line 147 of file PathOperator.java.

◆ Prev()

long com.google.ortools.constraintsolver.PathOperator.Prev ( long node)

Returns the node before node in the current delta.

Definition at line 109 of file PathOperator.java.

◆ reset()

void com.google.ortools.constraintsolver.PathOperator.reset ( )

Reimplemented from com.google.ortools.constraintsolver.LocalSearchOperator.

Definition at line 102 of file PathOperator.java.

◆ restartAtPathStartOnSynchronize()

boolean com.google.ortools.constraintsolver.PathOperator.restartAtPathStartOnSynchronize ( )
protected

When the operator is being synchronized with a new solution (when Start()
is called), returns true to restart the exploration of the neighborhood
from the start of the last paths explored; returns false to restart the
exploration at the last nodes visited.
This is used to avoid restarting on base nodes which have changed paths,
leading to potentially skipping neighbors.

Definition at line 137 of file PathOperator.java.

◆ setNextBaseToIncrement()

void com.google.ortools.constraintsolver.PathOperator.setNextBaseToIncrement ( long base_index)
protected

Set the next base to increment on next iteration. All base > base_index
will be reset to their start value.

Definition at line 166 of file PathOperator.java.

◆ swigDirectorDisconnect()

void com.google.ortools.constraintsolver.PathOperator.swigDirectorDisconnect ( )
protected

◆ swigRelease()

static long com.google.ortools.constraintsolver.PathOperator.swigRelease ( PathOperator obj)
staticprotected

Definition at line 42 of file PathOperator.java.

◆ swigReleaseOwnership()

void com.google.ortools.constraintsolver.PathOperator.swigReleaseOwnership ( )

◆ swigTakeOwnership()

void com.google.ortools.constraintsolver.PathOperator.swigTakeOwnership ( )

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