C++ Reference: class PathOperator

Note: This documentation is automatically generated.

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).
Method
MakeNeighbor

Return type: virtual bool

Next

Return type: int64_t

Arguments: int64_t node

Returns the node after node in the current delta.

number_of_nexts

Return type: int

Number of next variables.

Path

Return type: int64_t

Arguments: int64_t node

Returns the index of the path to which node belongs in the current delta. Only returns a valid value if path variables are taken into account.

PathOperator

Arguments: const std::vector<IntVar*>& next_vars, const std::vector<IntVar*>& path_vars, IterationParameters iteration_parameters

Builds an instance of PathOperator from next and path variables.

PathOperator

Arguments: const std::vector<IntVar*>& next_vars, const std::vector<IntVar*>& path_vars, int number_of_base_nodes, bool skip_locally_optimal_paths, bool accept_path_end_base, std::function<int(int64_t)> start_empty_path_class

~PathOperator

Prev

Return type: int64_t

Arguments: int64_t node

Returns the node before node in the current delta.

Reset

Return type: void

SkipUnchanged

Return type: bool

Arguments: int index

TODO(user): Make the following methods protected.