 |
vrpRouting
0.3
|
Go to the documentation of this file.
100 size_t total_customers,
103 size_t total_vehicles,
109 size_t total_multipliers,
114 size_t *return_count,
119 std::ostringstream log;
120 std::ostringstream notice;
121 std::ostringstream err;
134 log <<
"do_compatibleVehicles\n";
139 for (
size_t i = 0; i < total_customers; ++i) {
144 for (
size_t i = 0; i < total_vehicles; ++i) {
153 matrix_cells_arr, total_cells,
154 multipliers_arr, total_multipliers,
161 log <<
"[Compatible Vehicles] Fixing Matrix that does not obey triangle inequality ";
165 log <<
"[Compatible Vehicles] Matrix Still does not obey triangle inequality";
170 err <<
"An Infinity value was found on the Matrix";
178 log <<
"Initialize problem\n";
180 customers_arr, total_customers,
181 vehicles_arr, total_vehicles,
185 if (!err.str().empty()) {
192 log <<
"Finish Reading data\n";
199 log <<
"solution size: " << solution.size() <<
"\n";
200 log <<
"solution empty: " << solution.empty() <<
"\n";
202 if (!solution.empty()) {
203 log <<
"solution empty " <<
"\n";
204 (*return_tuples) =
pgr_alloc(solution.size(), (*return_tuples));
206 for (
const auto &row : solution) {
207 (*return_tuples)[seq] = row;
211 (*return_count) = solution.size();
215 *log_msg = log.str().empty()?
218 *notice_msg = notice.str().empty()?
222 if (*return_tuples) free(*return_tuples);
224 err << except.
what();
227 }
catch (std::exception& except) {
228 if (*return_tuples) free(*return_tuples);
230 err << except.what();
234 if (*return_tuples) free(*return_tuples);
236 err <<
"Caught unknown exception!";
Id deliver_node_id
Deliver y coordinate: used in stand alone program for benchmarks.
T * pgr_alloc(std::size_t size, T *ptr)
allocates memory
Id start_node_id
Stops size.
void do_compatibleVehicles(PickDeliveryOrders_t customers_arr[], size_t total_customers, Vehicle_t *vehicles_arr, size_t total_vehicles, Matrix_cell_t *matrix_cells_arr, size_t total_cells, Time_multipliers_t *multipliers_arr, size_t total_multipliers, double factor, CompatibleVehicles_rt **return_tuples, size_t *return_count, char **log_msg, char **notice_msg, char **err_msg)
Driver for processing a "compatible vehicles" problem.
char * pgr_msg(const std::string &msg)
virtual const char * what() const
Time Dependant Multipliers.
std::vector< CompatibleVehicles_rt > get_pg_compatibleVehicles() const
get the vehicles compatibility results as C++ container
#define pgassert(expr)
Uses the standard assert syntax.
Pgr_messages msg
message controller for all classes
Id pick_node_id
Pick y coordinate: used in stand alone program for benchmarks.
std::string get_log() const
gets the contents of log message
An assert functionality that uses C++ throw().
bool has_no_infinity() const
does the matrix values not given by the user?
size_t fix_triangle_inequality(size_t depth=0)
Fix Triangle Inequality Theorem.
std::string get_error() const
gets the contents of error message
void clear()
Clears all the messages.
order-vehicle compatability relationship
bool obeys_triangle_inequality() const
does the matrix obeys the triangle inequality?
Extends std::exception and is the exception that we throw if an assert fails.