Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ constraint_solver/

operations_research::PairRelocateOperator Class Reference

Operator which moves a pair of nodes to another position. More...

Inheritance diagram for operations_research::PairRelocateOperator:

operations_research::PathOperator operations_research::IntVarLocalSearchOperator operations_research::LocalSearchOperator operations_research::BaseObject

List of all members.

Public Member Functions

 PairRelocateOperator (const IntVar *const *vars, const IntVar *const *secondary_vars, const RoutingModel::NodePairs &pairs, int size)
virtual ~PairRelocateOperator ()
virtual bool MakeNeighbor ()

Protected Member Functions

virtual bool OnSamePathAsPreviousBase (int64 base_index)
 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).
virtual int64 GetBaseNodeRestartPosition (int base_index)
 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.


Detailed Description

Operator which moves a pair of nodes to another position.

Possible neighbors for the path 1 -> A -> B -> 2 -> 3 (where (1, 3) are first and last nodes of the path and can therefore not be moved, and (A, B) is a pair of nodes): 1 -> [A] -> 2 -> [B] -> 3 1 -> 2 -> [A] -> [B] -> 3 1 -> [B] -> [A] -> 2 -> 3 1 -> [B] -> 2 -> [A] -> 3 1 -> 2 -> [B] -> [A] -> 3

Definition at line 237 of file routing.cc.


Constructor & Destructor Documentation

operations_research::PairRelocateOperator::PairRelocateOperator ( const IntVar *const *  vars,
const IntVar *const *  secondary_vars,
const RoutingModel::NodePairs pairs,
int  size 
) [inline]

Definition at line 239 of file routing.cc.

virtual operations_research::PairRelocateOperator::~PairRelocateOperator (  )  [inline, virtual]

Definition at line 261 of file routing.cc.


Member Function Documentation

bool operations_research::PairRelocateOperator::MakeNeighbor (  )  [virtual]

Implements operations_research::PathOperator.

Definition at line 296 of file routing.cc.

virtual bool operations_research::PairRelocateOperator::OnSamePathAsPreviousBase ( int64  base_index  )  [inline, protected, virtual]

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.

Todo:
TODO(user): ideally this should be OnSamePath(int64 node1, int64 node2); it's currently way more complicated to implement.

Reimplemented from operations_research::PathOperator.

Definition at line 265 of file routing.cc.

virtual int64 operations_research::PairRelocateOperator::GetBaseNodeRestartPosition ( int  base_index  )  [inline, protected, virtual]

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.

Reimplemented from operations_research::PathOperator.

Definition at line 271 of file routing.cc.


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