Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::LocationContainer Class Reference

#include <cvrptw_lib.h>

Public Member Functions

 LocationContainer (int64_t speed, bool use_deterministic_seed)
 
void AddLocation (int64_t x, int64_t y)
 
void AddRandomLocation (int64_t x_max, int64_t y_max)
 
void AddRandomLocation (int64_t x_max, int64_t y_max, int duplicates)
 
int64_t ManhattanDistance (RoutingIndexManager::NodeIndex from, RoutingIndexManager::NodeIndex to) const
 
int64_t NegManhattanDistance (RoutingIndexManager::NodeIndex from, RoutingIndexManager::NodeIndex to) const
 
int64_t ManhattanTime (RoutingIndexManager::NodeIndex from, RoutingIndexManager::NodeIndex to) const
 
bool SameLocation (RoutingIndexManager::NodeIndex node1, RoutingIndexManager::NodeIndex node2) const
 
int64_t SameLocationFromIndex (int64_t node1, int64_t node2) const
 

Detailed Description

Location container, contains positions of orders and can be used to obtain Manhattan distances/times between locations.

Definition at line 37 of file cvrptw_lib.h.

Constructor & Destructor Documentation

◆ LocationContainer()

operations_research::LocationContainer::LocationContainer ( int64_t speed,
bool use_deterministic_seed )

Definition at line 44 of file cvrptw_lib.cc.

Member Function Documentation

◆ AddLocation()

void operations_research::LocationContainer::AddLocation ( int64_t x,
int64_t y )
inline

Definition at line 40 of file cvrptw_lib.h.

◆ AddRandomLocation() [1/2]

void operations_research::LocationContainer::AddRandomLocation ( int64_t x_max,
int64_t y_max )

Definition at line 49 of file cvrptw_lib.cc.

◆ AddRandomLocation() [2/2]

void operations_research::LocationContainer::AddRandomLocation ( int64_t x_max,
int64_t y_max,
int duplicates )

Definition at line 53 of file cvrptw_lib.cc.

◆ ManhattanDistance()

int64_t operations_research::LocationContainer::ManhattanDistance ( RoutingIndexManager::NodeIndex from,
RoutingIndexManager::NodeIndex to ) const

Definition at line 62 of file cvrptw_lib.cc.

◆ ManhattanTime()

int64_t operations_research::LocationContainer::ManhattanTime ( RoutingIndexManager::NodeIndex from,
RoutingIndexManager::NodeIndex to ) const

Definition at line 72 of file cvrptw_lib.cc.

◆ NegManhattanDistance()

int64_t operations_research::LocationContainer::NegManhattanDistance ( RoutingIndexManager::NodeIndex from,
RoutingIndexManager::NodeIndex to ) const

Definition at line 67 of file cvrptw_lib.cc.

◆ SameLocation()

bool operations_research::LocationContainer::SameLocation ( RoutingIndexManager::NodeIndex node1,
RoutingIndexManager::NodeIndex node2 ) const

Definition at line 76 of file cvrptw_lib.cc.

◆ SameLocationFromIndex()

int64_t operations_research::LocationContainer::SameLocationFromIndex ( int64_t node1,
int64_t node2 ) const

The direct conversion from constraint model indices to routing model nodes is correct because the depot is node 0.

Todo
(user): Fetch proper indices from routing model.

Definition at line 82 of file cvrptw_lib.cc.


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