21#ifndef OR_TOOLS_ROUTING_PARSERS_TSPTW_PARSER_H_
22#define OR_TOOLS_ROUTING_PARSERS_TSPTW_PARSER_H_
28#include "absl/strings/string_view.h"
38 bool LoadFile(absl::string_view file_name);
44 return distance_function_;
49 return time_function_;
52 int depot()
const {
return depot_; }
54 int size()
const {
return size_; }
58 const std::vector<Coordinates2<double>>&
coordinates()
const {
62 const std::vector<SimpleTimeWindow<double>>&
time_windows()
const {
66 const std::vector<double>&
service_times()
const {
return service_times_; }
73 bool ParseLopezIbanezBlum(absl::string_view file_name);
74 bool ParseDaSilvaUrrutia(absl::string_view file_name);
78 double total_service_time_;
79 std::function<double(
int,
int)> distance_function_;
80 std::function<double(
int,
int)> time_function_;
81 std::vector<Coordinates2<double>> coords_;
82 std::vector<SimpleTimeWindow<double>> time_windows_;
83 std::vector<double> service_times_;
84 std::vector<double> distance_matrix_;
const std::vector< double > & service_times() const
Returns the service times of the nodes in the current routing problem.
int depot() const
Returns the index of the depot.
const std::vector< Coordinates2< double > > & coordinates() const
Returns the coordinates of the nodes in the current routing problem.
const std::function< double(int, int)> & time_function() const
double total_service_time() const
Returns the total service time already included in distance_function.
bool LoadFile(absl::string_view file_name)
Loads and parses a routing problem from a given file.
int size() const
Returns the number of nodes in the current routing problem.
const std::function< double(int, int)> & distance_function() const
const std::vector< SimpleTimeWindow< double > > & time_windows() const
Returns the time windows of the nodes in the current routing problem.
Common utilities for parsing routing instances.