41#ifndef OR_TOOLS_ROUTING_PARSERS_LILIM_PARSER_H_
42#define OR_TOOLS_ROUTING_PARSERS_LILIM_PARSER_H_
51#include "absl/strings/string_view.h"
69 bool LoadFile(absl::string_view file_name);
72 bool LoadFile(absl::string_view file_name, absl::string_view archive_name);
81 const std::vector<Coordinates2<int64_t>>&
coordinates()
const {
87 std::optional<int>
GetPickup(
int node)
const;
91 const std::vector<int64_t>&
demands()
const {
return demands_; }
93 const std::vector<SimpleTimeWindow<int64_t>>&
time_windows()
const {
97 const std::vector<int64_t>&
service_times()
const {
return service_times_; }
102 const double xd = from_coords.
x - to_coords.
x;
103 const double yd = from_coords.
y - to_coords.
y;
104 return sqrt(xd * xd + yd * yd);
113 bool ParseFile(absl::string_view file_name);
116 std::vector<Coordinates2<int64_t>> coordinates_;
117 std::vector<int> pickups_;
118 std::vector<int> deliveries_;
119 int64_t capacity_ = 0;
121 std::vector<int64_t> demands_;
122 std::vector<SimpleTimeWindow<int64_t>> time_windows_;
123 std::vector<int64_t> service_times_;
double GetTravelTime(int from, int to) const
Returns the travel time between two nodes.
std::optional< int > GetPickup(int node) const
Returns the pickup of a delivery.
const std::vector< SimpleTimeWindow< int64_t > > & time_windows() const
Returns the time windows of the nodes in the current routing problem.
int Depot() const
Returns the index of the depot.
double GetDistance(int from, int to) const
Returns the distance between two nodes.
const LiLimParser & operator=(const LiLimParser &)=delete
const std::vector< int64_t > & demands() const
Returns the demand of the nodes in the current routing problem.
int NumberOfVehicles() const
Returns the maximum number of vehicles to use.
int64_t capacity() const
Returns the capacity of the vehicles.
const std::vector< int64_t > & service_times() const
Returns the service times of the nodes in the current routing problem.
int NumberOfNodes() const
Returns the number of nodes in the current routing problem.
bool LoadFile(absl::string_view file_name)
Loads instance from a file.
const std::vector< Coordinates2< int64_t > > & coordinates() const
Returns the coordinates of the nodes in the current routing problem.
LiLimParser(LiLimParser &)=delete
std::optional< int > GetDelivery(int node) const
Returns the delivery of a pickup.
Common utilities for parsing routing instances.
trees with all degrees equal to