diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 7dc98cdee..5fef661bf 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -836,7 +836,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = @CMAKE_CURRENT_BIN_DIR@/LOG +WARN_LOGFILE = @CMAKE_CURRENT_BINARY_DIR@/LOG #--------------------------------------------------------------------------- # Configuration options related to the input files diff --git a/src/compatibleVehicles/compatibleVehicles_driver.cpp b/src/compatibleVehicles/compatibleVehicles_driver.cpp index c3dd6a1c1..19ec45729 100644 --- a/src/compatibleVehicles/compatibleVehicles_driver.cpp +++ b/src/compatibleVehicles/compatibleVehicles_driver.cpp @@ -34,15 +34,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_types/compatibleVehicles_rt.h" -#include "cpp_common/assert.hpp" #include "cpp_common/alloc.hpp" +#include "cpp_common/assert.hpp" #include "cpp_common/orders_t.hpp" #include "cpp_common/vehicle_t.hpp" #include "problem/pickDeliver.hpp" #include "problem/matrix.hpp" - /** * * @param[in] customers_arr A C Array of pickup and dropoff orders @@ -54,6 +53,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * @param[in] multipliers_arr A C Array of the multipliers * @param[in] total_multipliers size of the multipliers_arr * @param[in] factor A global multiplier for the (time) matrix cells + * * @param[out] return_tuples C array of contents to be returned to postgres * @param[out] return_count number of tuples returned * @param[out] log_msg special log message pointer @@ -65,30 +65,26 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * @pre The C array: return_tuples must be empty * @pre Only matrix cells (i, i) can be missing and are considered as 0 (time units) * - * @post The C arrays: customers_arr, vehicles_arr, matrix_cells_arr Do not change * @post The C array: return_tuples contains the result for the problem given * @post The return_tuples array size is return_count - * @post The return_tuples array size is return_count * @post err_msg is empty if no throw from the process is catched * @post log_msg contains some logging * @post notice_msg is empty * - * @dot digraph G { node[fontsize=11, nodesep=0.75,ranksep=0.75]; start [shape=Mdiamond]; n1 [label="Verify preconditions",shape=rect]; - n3 [label="Verify matrix cells preconditions",shape=rect]; + n3 [label="Verify matrix preconditions",shape=rect]; n4 [label="Construct problem",shape=cds,color=blue]; n7 [label="Prepare results",shape=rect]; end [shape=Mdiamond]; error [shape=Mdiamond,color=red] start -> n1 -> n3 -> n4 -> n7 -> end; - n1 -> error [ label="Caller error",color=red]; - n3 -> error [ label="User error",color=red]; - + n1 -> error [ label="throw",color=red]; + n3 -> error [ label="throw",color=red]; } @enddot @@ -96,17 +92,10 @@ digraph G { */ void vrp_do_compatibleVehicles( - Orders_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, + Orders_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, @@ -193,9 +182,8 @@ vrp_do_compatibleVehicles( err << pd_problem.msg.get_error(); if (!err.str().empty()) { - log << pd_problem.msg.get_log(); - *log_msg = to_pg_msg(log.str()); - *err_msg = to_pg_msg(err.str()); + *log_msg = to_pg_msg(pd_problem.msg.get_log()); + *err_msg = to_pg_msg(pd_problem.msg.get_error()); return; } log << pd_problem.msg.get_log(); diff --git a/src/optimize/optimize_driver.cpp b/src/optimize/optimize_driver.cpp index dc503f84a..d30a5f5cd 100644 --- a/src/optimize/optimize_driver.cpp +++ b/src/optimize/optimize_driver.cpp @@ -38,6 +38,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/alloc.hpp" #include "cpp_common/assert.hpp" + #include "cpp_common/interruption.hpp" #include "cpp_common/messages.hpp" @@ -52,12 +53,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. namespace { +using Short_vehicle = vrprouting::Short_vehicle; + /** @brief Executes an optimization with the input data * * @param[in] shipments_arr A C Array of pickup and dropoff shipments * @param[in] total_shipments size of the shipments_arr * @param[in] vehicles_arr A C Array of vehicles * @param[in] total_vehicles size of the vehicles_arr + * * @param[in] new_stops stops that override the original stops. * @param[in] time_matrix The unique time matrix * @param[in] max_cycles number of cycles to perform during the optimization phase @@ -292,26 +296,24 @@ subdivide_processing( * @param[in] total_cells size of the matrix_cells_arr * @param[in] multipliers_arr A C Array of the multipliers * @param[in] total_multipliers size of the multipliers_arr + * * @param[in] factor A global multiplier for the (time) matrix cells * @param[in] max_cycles number of cycles to perform during the optimization phase * @param[in] check_triangle_inequality When true tirangle inequality will be checked * @param[in] subdivide @todo * @param[in] subdivide_by_vehicle @todo * @param[in] execution_date Value used for not moving shipments that are before this date + * * @param[out] return_tuples C array of contents to be returned to postgres * @param[out] return_count number of tuples returned * @param[out] log_msg special log message pointer * @param[out] notice_msg special message pointer to be returned as NOTICE * @param[out] err_msg special message pointer to be returned as ERROR - * @return void - * * * @pre The messages: log_msg, notice_msg, err_msg must be empty (=nullptr) - * @pre The C arrays: shipments_arr, vehicles_arr, matrix_cells_arr must not be empty * @pre The C array: return_tuples must be empty * @pre Only matrix cells (i, i) can be missing and are considered as 0 (time units) * - * @post The C arrays: shipments_arr, vehicles_arr, matrix_cells_arr Do not change * @post The C array: return_tuples contains the result for the problem given * @post The return_tuples array size is return_count * @post err_msg is empty if no throw from the process is catched @@ -338,8 +340,6 @@ subdivide_processing( } @enddot - - * */ void vrp_do_optimize( diff --git a/src/pgr_pickDeliver/pgr_pickDeliverEuclidean_driver.cpp b/src/pgr_pickDeliver/pgr_pickDeliverEuclidean_driver.cpp index d1494423d..f064173a7 100644 --- a/src/pgr_pickDeliver/pgr_pickDeliverEuclidean_driver.cpp +++ b/src/pgr_pickDeliver/pgr_pickDeliverEuclidean_driver.cpp @@ -46,6 +46,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "problem/pickDeliver.hpp" namespace { + vrprouting::problem::Solution get_initial_solution(vrprouting::problem::PickDeliver* problem_ptr, int m_initial_id) { using Solution = vrprouting::problem::Solution; diff --git a/src/pickDeliver/pickDeliver_driver.cpp b/src/pickDeliver/pickDeliver_driver.cpp index 05ed6c128..d21f69e16 100644 --- a/src/pickDeliver/pickDeliver_driver.cpp +++ b/src/pickDeliver/pickDeliver_driver.cpp @@ -38,6 +38,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/alloc.hpp" #include "cpp_common/assert.hpp" +#include "cpp_common/timeconversion.hpp" #include "cpp_common/orders_t.hpp" #include "cpp_common/vehicle_t.hpp" @@ -67,8 +68,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * @param[out] log_msg special log message pointer * @param[out] notice_msg special message pointer to be returned as NOTICE * @param[out] err_msg special message pointer to be returned as ERROR - * @return void - * * * @pre The messages: log_msg, notice_msg, err_msg must be empty (=nullptr) * @pre The C arrays: customers_arr, vehicles_arr, matrix_cells_arr must not be empty @@ -82,7 +81,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * @post log_msg contains some logging * @post notice_msg is empty * - * @dot digraph G { node[fontsize=11, nodesep=0.75,ranksep=0.75]; @@ -102,8 +100,6 @@ digraph G { } @enddot - - * */ void vrp_do_pickDeliver( @@ -152,9 +148,10 @@ vrp_do_pickDeliver( Identifiers order_ids; for (size_t i = 0; i < total_customers; ++i) { - node_ids += customers_arr[i].pick_node_id; - node_ids += customers_arr[i].deliver_node_id; - order_ids += customers_arr[i].id; + auto o = customers_arr[i]; + node_ids += o.pick_node_id; + node_ids += o.deliver_node_id; + order_ids += o.id; } bool missing = false; @@ -240,7 +237,6 @@ vrp_do_pickDeliver( using Optimize = vrprouting::optimizers::tabu::Optimize; sol = Optimize(sol, static_cast(max_cycles), stop_on_all_served, optimize); - log << pd_problem.msg.get_log(); pd_problem.msg.clear(); log << "Finish solve\n"; diff --git a/src/vroom/vroom_driver.cpp b/src/vroom/vroom_driver.cpp index c88fcce68..529d77281 100644 --- a/src/vroom/vroom_driver.cpp +++ b/src/vroom/vroom_driver.cpp @@ -48,7 +48,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. /** @file vroom_driver.cpp * @brief Handles actual calling of function in the `vrp_vroom.hpp` file. - * */ /** @brief Performs exception handling and converts the results to postgres. @@ -79,9 +78,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * @param[in] total_breaks_tws The total number of total breaks timewindows * @param[in] matrix_rows Pointer to the array of matrix rows * @param[in] total_matrix_rows The total number of matrix rows + * * @param[in] exploration_level Exploration level to use while solving. * @param[in] timeout Timeout value to stop the solving process (seconds). * @param[in] loading_time Additional time spent in loading the data from SQL Query (seconds). + * * @param[out] return_tuples The rows in the result * @param[out] return_count The count of rows in the result * @param[out] log_msg Stores the log message @@ -106,9 +107,9 @@ vrp_do_vroom( Vroom_rt **return_tuples, size_t *return_count, - char ** log_msg, - char ** notice_msg, - char ** err_msg) { + char **log_msg, + char **notice_msg, + char **err_msg) { using vrprouting::alloc; using vrprouting::free; using vrprouting::to_pg_msg; @@ -200,13 +201,9 @@ vrp_do_vroom( vrprouting::problem::Vroom problem; problem.add_matrix(matrix); - problem.add_vehicles(vehicles, total_vehicles, - breaks, total_breaks, - breaks_tws, total_breaks_tws); - problem.add_jobs(jobs, total_jobs, - jobs_tws, total_jobs_tws); - problem.add_shipments(shipments, total_shipments, - shipments_tws, total_shipments_tws); + problem.add_vehicles(vehicles, total_vehicles, breaks, total_breaks, breaks_tws, total_breaks_tws); + problem.add_jobs(jobs, total_jobs, jobs_tws, total_jobs_tws); + problem.add_shipments(shipments, total_shipments, shipments_tws, total_shipments_tws); auto end_time = std::chrono::high_resolution_clock::now(); loading_time += static_cast(