diff --git a/include/c_common/vroom/breaks_input.h b/include/c_common/vroom/breaks_input.h index 2f6af1b37..a5d2f85b4 100644 --- a/include/c_common/vroom/breaks_input.h +++ b/include/c_common/vroom/breaks_input.h @@ -30,16 +30,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_C_COMMON_VROOM_BREAKS_INPUT_H_ #pragma once +#include #include -#include "cpp_common/get_check_data.hpp" -#include "cpp_common/info.hpp" -#include "cpp_common/vroom_break_t.hpp" - -#ifdef PROFILE -#include "c_common/debug_macro.h" -#include "c_common/time_msg.h" -#endif +typedef struct Vroom_break_t Vroom_break_t; /** @brief Reads the VROOM breaks */ void diff --git a/include/c_common/vroom/jobs_input.h b/include/c_common/vroom/jobs_input.h index e9bf1067d..7ec4c0cb5 100644 --- a/include/c_common/vroom/jobs_input.h +++ b/include/c_common/vroom/jobs_input.h @@ -30,16 +30,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_C_COMMON_VROOM_JOBS_INPUT_H_ #pragma once +#include #include -#include "cpp_common/get_check_data.hpp" -#include "cpp_common/info.hpp" -#include "cpp_common/vroom_job_t.hpp" - -#ifdef PROFILE -#include "c_common/debug_macro.h" -#include "c_common/time_msg.h" -#endif +typedef struct Vroom_job_t Vroom_job_t; /** @brief Reads the VROOM jobs */ void diff --git a/include/c_common/vroom/matrix_input.h b/include/c_common/vroom/matrix_input.h index a2b17cbcd..67c10756e 100644 --- a/include/c_common/vroom/matrix_input.h +++ b/include/c_common/vroom/matrix_input.h @@ -30,16 +30,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_C_COMMON_VROOM_MATRIX_INPUT_H_ #pragma once +#include #include -#include "cpp_common/get_check_data.hpp" -#include "cpp_common/info.hpp" -#include "cpp_common/vroom_matrix_t.hpp" - -#ifdef PROFILE -#include "c_common/debug_macro.h" -#include "c_common/time_msg.h" -#endif +typedef struct Vroom_matrix_t Vroom_matrix_t; /** @brief Reads the VROOM matrix */ void diff --git a/include/c_common/vroom/shipments_input.h b/include/c_common/vroom/shipments_input.h index 1e6859c6d..22008b461 100644 --- a/include/c_common/vroom/shipments_input.h +++ b/include/c_common/vroom/shipments_input.h @@ -30,16 +30,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_C_COMMON_VROOM_SHIPMENTS_INPUT_H_ #pragma once +#include #include -#include "cpp_common/get_check_data.hpp" -#include "cpp_common/info.hpp" -#include "cpp_common/vroom_shipment_t.hpp" - -#ifdef PROFILE -#include "c_common/debug_macro.h" -#include "c_common/time_msg.h" -#endif +typedef struct Vroom_shipment_t Vroom_shipment_t; /** @brief Reads the VROOM shipments */ void diff --git a/include/c_common/vroom/time_windows_input.h b/include/c_common/vroom/time_windows_input.h index 7703ce67d..f139bd592 100644 --- a/include/c_common/vroom/time_windows_input.h +++ b/include/c_common/vroom/time_windows_input.h @@ -33,14 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include -#include "cpp_common/get_check_data.hpp" -#include "cpp_common/info.hpp" -#include "cpp_common/vroom_time_window_t.hpp" - -#ifdef PROFILE -#include "c_common/debug_macro.h" -#include "c_common/time_msg.h" -#endif +typedef struct Vroom_time_window_t Vroom_time_window_t; /** @brief Reads the VROOM time windows */ void diff --git a/include/c_common/vroom/vehicles_input.h b/include/c_common/vroom/vehicles_input.h index fe9781b2f..3e27e22e3 100644 --- a/include/c_common/vroom/vehicles_input.h +++ b/include/c_common/vroom/vehicles_input.h @@ -30,16 +30,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_C_COMMON_VROOM_VEHICLES_INPUT_H_ #pragma once +#include #include -#include "cpp_common/get_check_data.hpp" -#include "cpp_common/info.hpp" -#include "cpp_common/vroom_vehicle_t.hpp" - -#ifdef PROFILE -#include "c_common/debug_macro.h" -#include "c_common/time_msg.h" -#endif +typedef struct Vroom_vehicle_t Vroom_vehicle_t; /** @brief Reads the VROOM vehicles */ void diff --git a/include/c_types/short_vehicle_rt.h b/include/c_types/short_vehicle_rt.h index d21faadc9..6e561a5e4 100644 --- a/include/c_types/short_vehicle_rt.h +++ b/include/c_types/short_vehicle_rt.h @@ -1,5 +1,5 @@ /*PGR-GNU***************************************************************** -File: Short_vehiclei_rt.h +File: Short_vehicle_rt.h Copyright (c) 2015 Celia Virginia Vergara Castillo Mail: vicky_vergara@hotmail.com diff --git a/include/c_types/typedefs.h b/include/c_types/typedefs.h index 9552621a4..e15e92b42 100644 --- a/include/c_types/typedefs.h +++ b/include/c_types/typedefs.h @@ -47,19 +47,6 @@ using Priority = uint32_t; using Distance = uint32_t; using Skill = uint32_t; using StepType = int32_t; -using Orders_t = struct Orders_t; -using Vehicle_t = struct Vehicle_t; -using Matrix_cell_t = struct Matrix_cell_t; -using Time_multipliers_t = struct Time_multipliers_t; -using Solution_rt = struct Solution_rt; -using Short_vehicle_rt = struct Short_vehicle_rt; -using Vroom_job_t = struct Vroom_job_t; -using Vroom_shipment_t = struct Vroom_shipment_t; -using Vroom_vehicle_t = struct Vroom_vehicle_t; -using Vroom_matrix_t = struct Vroom_matrix_t; -using Vroom_break_t = struct Vroom_break_t; -using Vroom_time_window_t = struct Vroom_time_window_t; -using Vroom_rt = struct Vroom_rt; /* * Index on a container */ @@ -84,19 +71,6 @@ typedef uint32_t Priority; typedef uint32_t Distance; typedef uint32_t Skill; typedef int32_t StepType; -typedef struct Orders_t Orders_t; -typedef struct Vehicle_t Vehicle_t; -typedef struct Matrix_cell_t Matrix_cell_t; -typedef struct Time_multipliers_t Time_multipliers_t; -typedef struct Solution_rt Solution_rt; -typedef struct Short_vehicle_rt Short_vehicle_rt; -typedef struct Vroom_job_t Vroom_job_t; -typedef struct Vroom_shipment_t Vroom_shipment_t; -typedef struct Vroom_vehicle_t Vroom_vehicle_t; -typedef struct Vroom_matrix_t Vroom_matrix_t; -typedef struct Vroom_break_t Vroom_break_t; -typedef struct Vroom_time_window_t Vroom_time_window_t; -typedef struct Vroom_rt Vroom_rt; #endif /*************************************************************************/ diff --git a/include/cpp_common/vroom_matrix.hpp b/include/cpp_common/vroom_matrix.hpp index 881f362d4..69a94ee02 100644 --- a/include/cpp_common/vroom_matrix.hpp +++ b/include/cpp_common/vroom_matrix.hpp @@ -41,7 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/identifiers.hpp" -typedef struct Matrix_cell_t Matrix_cell_t; +using Vroom_matrix_t = struct Vroom_matrix_t; +using Matrix_cell_t = struct Matrix_cell_t; namespace vrprouting { namespace vroom { diff --git a/include/drivers/optimize_driver.h b/include/drivers/optimize_driver.h index a9925a7e9..a2431f15b 100644 --- a/include/drivers/optimize_driver.h +++ b/include/drivers/optimize_driver.h @@ -32,7 +32,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_DRIVERS_OPTIMIZE_DRIVER_H_ #pragma once -#include "c_types/typedefs.h" +#ifdef __cplusplus +#include +#include +using Orders_t = struct Orders_t; +using Vehicle_t = struct Vehicle_t; +using Matrix_cell_t = struct Matrix_cell_t; +using Time_multipliers_t = struct Time_multipliers_t; +using Short_vehicle_rt = struct Short_vehicle_rt; +#else +#include +#include +#include +typedef struct Orders_t Orders_t; +typedef struct Vehicle_t Vehicle_t; +typedef struct Matrix_cell_t Matrix_cell_t; +typedef struct Time_multipliers_t Time_multipliers_t; +typedef struct Short_vehicle_rt Short_vehicle_rt; +#endif #ifdef __cplusplus extern "C" { diff --git a/include/drivers/pgr_pickDeliverEuclidean_driver.h b/include/drivers/pgr_pickDeliverEuclidean_driver.h index 84776ffd5..934f38acf 100644 --- a/include/drivers/pgr_pickDeliverEuclidean_driver.h +++ b/include/drivers/pgr_pickDeliverEuclidean_driver.h @@ -30,16 +30,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_DRIVERS_PGR_PICKDELIVEREUCLIDEAN_DRIVER_H_ #pragma once -/* for size-t */ #ifdef __cplusplus -# include +#include +#include +using Orders_t = struct Orders_t; +using Vehicle_t = struct Vehicle_t; +using Solution_rt = struct Solution_rt; #else -# include -#endif - +#include +#include +#include typedef struct Orders_t Orders_t; -typedef struct Solution_rt Solution_rt; typedef struct Vehicle_t Vehicle_t; +typedef struct Solution_rt Solution_rt; +#endif + #ifdef __cplusplus extern "C" { diff --git a/include/drivers/pgr_pickDeliver_driver.h b/include/drivers/pgr_pickDeliver_driver.h index e10a9bf07..ea5bd81dc 100644 --- a/include/drivers/pgr_pickDeliver_driver.h +++ b/include/drivers/pgr_pickDeliver_driver.h @@ -32,18 +32,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_DRIVERS_PGR_PICKDELIVER_DRIVER_H_ #pragma once -/* for size-t */ #ifdef __cplusplus -# include +#include +#include +using Orders_t = struct Orders_t; +using Vehicle_t = struct Vehicle_t; +using Matrix_cell_t = struct Matrix_cell_t; +using Solution_rt = struct Solution_rt; #else -# include -#endif - -#include "cpp_common/vehicle_t.hpp" -#include "cpp_common/matrix_cell_t.hpp" - +#include +#include +#include typedef struct Orders_t Orders_t; +typedef struct Vehicle_t Vehicle_t; +typedef struct Matrix_cell_t Matrix_cell_t; typedef struct Solution_rt Solution_rt; +#endif #ifdef __cplusplus extern "C" { diff --git a/include/drivers/pickDeliver_driver.h b/include/drivers/pickDeliver_driver.h index f74156fb4..3ccb54a48 100644 --- a/include/drivers/pickDeliver_driver.h +++ b/include/drivers/pickDeliver_driver.h @@ -32,7 +32,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_DRIVERS_PICKDELIVER_DRIVER_H_ #pragma once -#include "c_types/typedefs.h" +#ifdef __cplusplus +#include +#include +using Orders_t = struct Orders_t; +using Vehicle_t = struct Vehicle_t; +using Matrix_cell_t = struct Matrix_cell_t; +using Time_multipliers_t = struct Time_multipliers_t; +using Solution_rt = struct Solution_rt; +#else +#include +#include +#include +typedef struct Orders_t Orders_t; +typedef struct Vehicle_t Vehicle_t; +typedef struct Matrix_cell_t Matrix_cell_t; +typedef struct Time_multipliers_t Time_multipliers_t; +typedef struct Solution_rt Solution_rt; +#endif #ifdef __cplusplus extern "C" { diff --git a/include/drivers/vroom_driver.h b/include/drivers/vroom_driver.h index 4d3158d9e..70f151f0b 100644 --- a/include/drivers/vroom_driver.h +++ b/include/drivers/vroom_driver.h @@ -30,7 +30,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #define INCLUDE_DRIVERS_VROOM_DRIVER_H_ #pragma once -#include "c_types/typedefs.h" +#ifdef __cplusplus +#include +#include +using Vroom_job_t = struct Vroom_job_t; +using Vroom_time_window_t = struct Vroom_time_window_t; +using Vroom_shipment_t = struct Vroom_shipment_t; +using Vroom_vehicle_t = struct Vroom_vehicle_t; +using Vroom_break_t = struct Vroom_break_t; +using Vroom_matrix_t = struct Vroom_matrix_t; +using Vroom_rt = struct Vroom_rt; +#else +#include +#include +#include +typedef struct Vroom_job_t Vroom_job_t; +typedef struct Vroom_time_window_t Vroom_time_window_t; +typedef struct Vroom_shipment_t Vroom_shipment_t; +typedef struct Vroom_vehicle_t Vroom_vehicle_t; +typedef struct Vroom_break_t Vroom_break_t; +typedef struct Vroom_matrix_t Vroom_matrix_t; +typedef struct Vroom_rt Vroom_rt; +#endif #ifdef __cplusplus extern "C" { diff --git a/include/problem/pickDeliver.hpp b/include/problem/pickDeliver.hpp index 5140cd5b1..8072aa163 100644 --- a/include/problem/pickDeliver.hpp +++ b/include/problem/pickDeliver.hpp @@ -57,14 +57,14 @@ class PickDeliver { PickDeliver( Orders_t* p_orders, size_t p_orders_size, Vehicle_t* p_vehicles, size_t p_vehicles_size, - const Matrix &p_cost_matrix); + const Matrix &); /** @brief Override stops constructor */ PickDeliver( Orders_t* p_orders, size_t p_orders_size, Vehicle_t* p_vehicles, size_t p_vehicles_size, - std::vector new_stops, - const Matrix &p_cost_matrix); + std::vector, + const Matrix &); virtual ~PickDeliver() = default; diff --git a/include/problem/tw_node.hpp b/include/problem/tw_node.hpp index e495a1ba5..35ef880d0 100644 --- a/include/problem/tw_node.hpp +++ b/include/problem/tw_node.hpp @@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/identifier.hpp" #include "problem/node_types.hpp" +using Orders_t = struct Orders_t; +using Vehicle_t = struct Vehicle_t; namespace vrprouting { namespace problem { diff --git a/include/vroom/vroom.hpp b/include/vroom/vroom.hpp index 0569f248c..03cca5630 100644 --- a/include/vroom/vroom.hpp +++ b/include/vroom/vroom.hpp @@ -43,6 +43,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/vroom_matrix.hpp" #include "cpp_common/messages.hpp" +using Vroom_break_t = struct Vroom_break_t; +using Vroom_job_t = struct Vroom_job_t; +using Vroom_shipment_t = struct Vroom_shipment_t; +using Vroom_time_window_t = struct Vroom_time_window_t; +using Vroom_vehicle_t = struct Vroom_vehicle_t; using Vroom_rt = struct Vroom_rt; namespace vrprouting { @@ -75,7 +80,7 @@ class Vroom : public vrprouting::Messages { void add_matrix(const vrprouting::vroom::Matrix&); /** @brief solves the vroom problem */ - std::vector solve(int32_t, int32_t, int32_t); + std::vector solve(int32_t, int32_t, int64_t); private: std::vector<::vroom::TimeWindow> get_vroom_time_windows(const std::vector&) const; diff --git a/src/common/e_report.c b/src/common/e_report.c index ba33dcce0..f94f48893 100644 --- a/src/common/e_report.c +++ b/src/common/e_report.c @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * ~~~~{.c} * std::ostringstream log; * log << "the message"; - * *log_msg = to_pg_msg(log.str().c_str()); + * *log_msg = to_pg_msg(log.str()); * ~~~~ * * Then on the C side diff --git a/src/common/vroom/breaks_input.c b/src/common/vroom/breaks_input.c index 290732d50..5e0a62619 100644 --- a/src/common/vroom/breaks_input.c +++ b/src/common/vroom/breaks_input.c @@ -28,6 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/vroom/breaks_input.h" +#include "cpp_common/vroom_break_t.hpp" +#include "cpp_common/info.hpp" + +#include "c_common/debug_macro.h" +#include "cpp_common/get_check_data.hpp" + static void fetch_breaks( HeapTuple *tuple, diff --git a/src/common/vroom/jobs_input.c b/src/common/vroom/jobs_input.c index 4894379b8..f23b64f92 100644 --- a/src/common/vroom/jobs_input.c +++ b/src/common/vroom/jobs_input.c @@ -28,6 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/vroom/jobs_input.h" +#include "cpp_common/vroom_job_t.hpp" +#include "cpp_common/info.hpp" + +#include "c_common/debug_macro.h" +#include "cpp_common/get_check_data.hpp" + static void fetch_jobs( HeapTuple *tuple, diff --git a/src/common/vroom/matrix_input.c b/src/common/vroom/matrix_input.c index 7f3a66db7..4452ee5f3 100644 --- a/src/common/vroom/matrix_input.c +++ b/src/common/vroom/matrix_input.c @@ -28,6 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/vroom/matrix_input.h" +#include "cpp_common/vroom_matrix_t.hpp" +#include "cpp_common/info.hpp" + +#include "c_common/debug_macro.h" +#include "cpp_common/get_check_data.hpp" + void fetch_matrix( HeapTuple *tuple, TupleDesc *tupdesc, diff --git a/src/common/vroom/shipments_input.c b/src/common/vroom/shipments_input.c index 1c66602fb..88e9d90db 100644 --- a/src/common/vroom/shipments_input.c +++ b/src/common/vroom/shipments_input.c @@ -28,6 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/vroom/shipments_input.h" +#include "cpp_common/vroom_shipment_t.hpp" +#include "cpp_common/info.hpp" + +#include "c_common/debug_macro.h" +#include "cpp_common/get_check_data.hpp" + static void fetch_shipments( HeapTuple *tuple, diff --git a/src/common/vroom/time_windows_input.c b/src/common/vroom/time_windows_input.c index 245dccea8..3d6ece02a 100644 --- a/src/common/vroom/time_windows_input.c +++ b/src/common/vroom/time_windows_input.c @@ -28,6 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/vroom/time_windows_input.h" +#include "cpp_common/vroom_time_window_t.hpp" +#include "cpp_common/info.hpp" + +#include "c_common/debug_macro.h" +#include "cpp_common/get_check_data.hpp" + static void fetch_time_windows( HeapTuple *tuple, diff --git a/src/common/vroom/vehicles_input.c b/src/common/vroom/vehicles_input.c index b04e7f7d7..d406fda49 100644 --- a/src/common/vroom/vehicles_input.c +++ b/src/common/vroom/vehicles_input.c @@ -28,6 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/vroom/vehicles_input.h" +#include "cpp_common/vroom_vehicle_t.hpp" +#include "cpp_common/info.hpp" + +#include "c_common/debug_macro.h" +#include "cpp_common/get_check_data.hpp" + static void fetch_vehicles( HeapTuple *tuple, diff --git a/src/pgr_pickDeliver/pgr_pickDeliver_driver.cpp b/src/pgr_pickDeliver/pgr_pickDeliver_driver.cpp index 8dc4c4e6c..cefa32dc3 100644 --- a/src/pgr_pickDeliver/pgr_pickDeliver_driver.cpp +++ b/src/pgr_pickDeliver/pgr_pickDeliver_driver.cpp @@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/assert.hpp" #include "cpp_common/orders_t.hpp" +#include "cpp_common/vehicle_t.hpp" #include "initialsol/initials_code.hpp" #include "initialsol/simple.hpp" #include "optimizers/simple.hpp" diff --git a/src/problem/vroom.cpp b/src/problem/vroom.cpp index 1389d8c85..8c05dac17 100644 --- a/src/problem/vroom.cpp +++ b/src/problem/vroom.cpp @@ -476,7 +476,7 @@ std::vector Vroom::solve( int32_t exploration_level, int32_t timeout, - int32_t loading_time) { + int64_t loading_time) { std::vector results; /* abort in case an interruption occurs (e.g. the query is being cancelled) */