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

Solomon parser class. More...

#include <solomon_parser.h>

Public Member Functions

 SolomonParser ()
 
 SolomonParser (const SolomonParser &)=delete
 
const SolomonParseroperator= (const SolomonParser &)=delete
 
bool LoadFile (const std::string &file_name)
 Loads instance from a file.
 
bool LoadFile (absl::string_view file_name, const std::string &archive_name)
 
const std::string & name () const
 Returns the name of the instance being solved.
 
int Depot () const
 Returns the index of the depot.
 
int NumberOfNodes () const
 Returns the number of nodes in the current routing problem.
 
int NumberOfVehicles () const
 Returns the maximum number of vehicles to use.
 
const std::vector< Coordinates2< int64_t > > & coordinates () const
 Returns the coordinates of the nodes in the current routing problem.
 
int64_t capacity () const
 Returns the capacity of the vehicles.
 
const std::vector< int64_t > & demands () const
 Returns the demand of the nodes in the current routing problem.
 
const std::vector< SimpleTimeWindow< int64_t > > & time_windows () const
 Returns the time windows of the nodes in the current routing problem.
 
const std::vector< int64_t > & service_times () const
 Returns the service times of the nodes in the current routing problem.
 
double GetDistance (int from, int to) const
 Returns the distance between two nodes.
 
double GetTravelTime (int from, int to) const
 Returns the travel time between two nodes.
 

Detailed Description

Solomon parser class.

Definition at line 60 of file solomon_parser.h.

Constructor & Destructor Documentation

◆ SolomonParser() [1/2]

operations_research::SolomonParser::SolomonParser ( )

Definition at line 34 of file solomon_parser.cc.

◆ SolomonParser() [2/2]

operations_research::SolomonParser::SolomonParser ( const SolomonParser & )
delete

Member Function Documentation

◆ capacity()

int64_t operations_research::SolomonParser::capacity ( ) const
inline

Returns the capacity of the vehicles.

Definition at line 91 of file solomon_parser.h.

◆ coordinates()

const std::vector< Coordinates2< int64_t > > & operations_research::SolomonParser::coordinates ( ) const
inline

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

Definition at line 87 of file solomon_parser.h.

◆ demands()

const std::vector< int64_t > & operations_research::SolomonParser::demands ( ) const
inline

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

Definition at line 93 of file solomon_parser.h.

◆ Depot()

int operations_research::SolomonParser::Depot ( ) const
inline

Returns the index of the depot.

Definition at line 81 of file solomon_parser.h.

◆ GetDistance()

double operations_research::SolomonParser::GetDistance ( int from,
int to ) const
inline

Returns the distance between two nodes.

Definition at line 101 of file solomon_parser.h.

◆ GetTravelTime()

double operations_research::SolomonParser::GetTravelTime ( int from,
int to ) const
inline

Returns the travel time between two nodes.

Definition at line 109 of file solomon_parser.h.

◆ LoadFile() [1/2]

bool operations_research::SolomonParser::LoadFile ( absl::string_view file_name,
const std::string & archive_name )

Loads instance from a file contained in a zipped archive; the archive can contain multiple files.

Definition at line 44 of file solomon_parser.cc.

◆ LoadFile() [2/2]

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

Loads instance from a file.

Loading an instance. Both methods return false in case of failure to read the instance. Loading a new instance clears the previously loaded instance.

Definition at line 39 of file solomon_parser.cc.

◆ name()

const std::string & operations_research::SolomonParser::name ( ) const
inline

Returns the name of the instance being solved.

Definition at line 79 of file solomon_parser.h.

◆ NumberOfNodes()

int operations_research::SolomonParser::NumberOfNodes ( ) const
inline

Returns the number of nodes in the current routing problem.

Definition at line 83 of file solomon_parser.h.

◆ NumberOfVehicles()

int operations_research::SolomonParser::NumberOfVehicles ( ) const
inline

Returns the maximum number of vehicles to use.

Definition at line 85 of file solomon_parser.h.

◆ operator=()

const SolomonParser & operations_research::SolomonParser::operator= ( const SolomonParser & )
delete

◆ service_times()

const std::vector< int64_t > & operations_research::SolomonParser::service_times ( ) const
inline

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

Definition at line 99 of file solomon_parser.h.

◆ time_windows()

const std::vector< SimpleTimeWindow< int64_t > > & operations_research::SolomonParser::time_windows ( ) const
inline

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

Definition at line 95 of file solomon_parser.h.


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