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

#include <tsptw_parser.h>

Public Member Functions

 TspTWParser ()
 
bool LoadFile (const std::string &file_name)
 Loads and parses a routing problem from a given file.
 
const std::function< double(int, int)> & distance_function () const
 
const std::function< double(int, int)> & time_function () const
 
int depot () const
 Returns the index of the depot.
 
int size () const
 Returns the number of nodes in the current routing problem.
 
double total_service_time () const
 Returns the total service time already included in distance_function.
 
const std::vector< Coordinates2< double > > & coordinates () const
 Returns the coordinates of the nodes in the current routing problem.
 
const std::vector< SimpleTimeWindow< double > > & time_windows () const
 Returns the time windows of the nodes in the current routing problem.
 
const std::vector< double > & service_times () const
 Returns the service times of the nodes in the current routing problem.
 

Detailed Description

Definition at line 33 of file tsptw_parser.h.

Constructor & Destructor Documentation

◆ TspTWParser()

operations_research::TspTWParser::TspTWParser ( )

Definition at line 62 of file tsptw_parser.cc.

Member Function Documentation

◆ coordinates()

const std::vector< Coordinates2< double > > & operations_research::TspTWParser::coordinates ( ) const
inline

Returns the coordinates of the nodes in the current routing problem.

Definition at line 57 of file tsptw_parser.h.

◆ depot()

int operations_research::TspTWParser::depot ( ) const
inline

Returns the index of the depot.

Definition at line 51 of file tsptw_parser.h.

◆ distance_function()

const std::function< double(int, int)> & operations_research::TspTWParser::distance_function ( ) const
inline

Returns a function returning the distance between nodes. On some instances service times are already included in values returned by this function. The actual distance of a route can be obtained by removing total_service_time() from the sum of distances in that case.

Definition at line 42 of file tsptw_parser.h.

◆ LoadFile()

bool operations_research::TspTWParser::LoadFile ( const std::string & file_name)

Loads and parses a routing problem from a given file.

Definition at line 69 of file tsptw_parser.cc.

◆ service_times()

const std::vector< double > & operations_research::TspTWParser::service_times ( ) const
inline

Returns the service times of the nodes in the current routing problem.

Definition at line 65 of file tsptw_parser.h.

◆ size()

int operations_research::TspTWParser::size ( ) const
inline

Returns the number of nodes in the current routing problem.

Definition at line 53 of file tsptw_parser.h.

◆ time_function()

const std::function< double(int, int)> & operations_research::TspTWParser::time_function ( ) const
inline

Returns a function returning the time between nodes (equivalent to distance_function(i, j) + service_time(j)).

Definition at line 47 of file tsptw_parser.h.

◆ time_windows()

const std::vector< SimpleTimeWindow< double > > & operations_research::TspTWParser::time_windows ( ) const
inline

Returns the time windows of the nodes in the current routing problem.

Definition at line 61 of file tsptw_parser.h.

◆ total_service_time()

double operations_research::TspTWParser::total_service_time ( ) const
inline

Returns the total service time already included in distance_function.

Definition at line 55 of file tsptw_parser.h.


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