Skip to content

Commit

Permalink
(drivers) using vrp_ prefix on driver names
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvergara committed Aug 20, 2024
1 parent 105e049 commit 4580137
Show file tree
Hide file tree
Showing 18 changed files with 85 additions and 145 deletions.
22 changes: 9 additions & 13 deletions include/drivers/compatibleVehicles_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,17 @@ typedef struct CompatibleVehicles_rt CompatibleVehicles_rt;
extern "C" {
#endif

/** @brief Driver for processing a "compatible vehicles" problem */
void 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,
/** @brief Driver for processing a "compatible vehicles" problem */
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,

double factor,
double,

CompatibleVehicles_rt **return_tuples,
size_t *return_count,

char **log_msg,
char **notice_msg,
char **err_msg);
CompatibleVehicles_rt **, size_t*,
char**, char**, char**);


#ifdef __cplusplus
Expand Down
28 changes: 9 additions & 19 deletions include/drivers/optimize_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
extern "C" {
#endif

/** @brief Driver for processing a pickupDeliver problem */
void do_optimize(
Orders_t customers_arr[], size_t,
Vehicle_t *vehicles_arr, size_t,
Matrix_cell_t *, size_t,
Time_multipliers_t *, size_t,

double,
int,
int64_t,

bool, bool, bool,

Short_vehicle_rt**,
size_t*,

char**,
char**,
char**);
void vrp_do_optimize(
Orders_t customers_arr[], size_t,
Vehicle_t *vehicles_arr, size_t,
Matrix_cell_t *, size_t,
Time_multipliers_t *, size_t,
double, int, int64_t, bool, bool, bool,

Short_vehicle_rt**, size_t*,
char**, char**, char**);


#ifdef __cplusplus
Expand Down
29 changes: 7 additions & 22 deletions include/drivers/pgr_pickDeliverEuclidean_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
********************************************************************PGR-GNU*/

/*! @file pickDeliverEuclidean_driver.h */

#ifndef INCLUDE_DRIVERS_PGR_PICKDELIVEREUCLIDEAN_DRIVER_H_
#define INCLUDE_DRIVERS_PGR_PICKDELIVEREUCLIDEAN_DRIVER_H_
#pragma once
Expand All @@ -47,26 +45,13 @@ typedef struct Vehicle_t Vehicle_t;
extern "C" {
#endif

/*********************************************************
orders_sql TEXT,
max_vehicles INTEGER,
capacity FLOAT,
max_cycles INTEGER,
********************************************************/
void do_pgr_pickDeliverEuclidean(
Orders_t *pd_orders_arr, size_t total_pd_orders,
Vehicle_t *vehicles_arr, size_t total_vehicles,

double factor,
int max_cycles,
int initial_solution_id,

Solution_rt **return_tuples,
size_t *return_count,

char **log_msg,
char **notice_msg,
char **err_msg);
void vrp_do_pgr_pickDeliverEuclidean(
Orders_t *pd_orders_arr, size_t total_pd_orders,
Vehicle_t *vehicles_arr, size_t total_vehicles,
double, int, int,

Solution_rt**, size_t*,
char**, char**, char**);


#ifdef __cplusplus
Expand Down
29 changes: 8 additions & 21 deletions include/drivers/pgr_pickDeliver_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,14 @@ typedef struct Solution_rt Solution_rt;
extern "C" {
#endif

/*********************************************************
orders_sql TEXT,
max_vehicles INTEGER,
capacity FLOAT,
max_cycles INTEGER,
********************************************************/
void do_pgr_pickDeliver(
Orders_t *pd_orders_arr, size_t total_pd_orders,
Vehicle_t *vehicles_arr, size_t total_vehicles,
Matrix_cell_t *matrix_cells_arr, size_t total_cells,

double factor,
int max_cycles,
int initial_solution_id,

Solution_rt **return_tuples,
size_t *return_count,

char **log_msg,
char **notice_msg,
char **err_msg);
void vrp_do_pgr_pickDeliver(
Orders_t *pd_orders_arr, size_t total_pd_orders,
Vehicle_t *vehicles_arr, size_t total_vehicles,
Matrix_cell_t *matrix_cells_arr, size_t total_cells,
double, int, int,

Solution_rt**, size_t*,
char**, char**, char**);


#ifdef __cplusplus
Expand Down
28 changes: 9 additions & 19 deletions include/drivers/pickDeliver_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
extern "C" {
#endif

/** @brief Driver for processing a pickupDeliver problem */
void do_pickDeliver(
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,

bool,
double factor,
int max_cycles,
bool stop_on_all_served,
int64_t execution_date,

Solution_rt **return_tuples,
size_t *return_count,

char **log_msg,
char **notice_msg,
char **err_msg);
void vrp_do_pickDeliver(
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,
bool, double, int, bool, int64_t,

Solution_rt**, size_t*,
char**, char**, char**);


#ifdef __cplusplus
Expand Down
15 changes: 4 additions & 11 deletions include/drivers/vroom_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
extern "C" {
#endif

void do_vrp_vroom(
void vrp_do_vroom(
Vroom_job_t *jobs, size_t total_jobs,
Vroom_time_window_t *jobs_tws, size_t total_jobs_tws,
Vroom_shipment_t *shipments, size_t total_shipments,
Expand All @@ -45,17 +45,10 @@ extern "C" {
Vroom_break_t *breaks, size_t total_breaks,
Vroom_time_window_t *breaks_tws, size_t total_breaks_tws,
Vroom_matrix_t *matrix_cells_arr, size_t total_cells,
int32_t, int32_t, int32_t,

int32_t exploration_level,
int32_t timeout,
int32_t loading_time,

Vroom_rt **return_tuples,
size_t *return_count,

char ** log_msg,
char ** notice_msg,
char ** err_msg);
Vroom_rt**, size_t*,
char**, char**, char**);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion src/compatibleVehicles/compatibleVehicles.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ process(
char *notice_msg = NULL;
char *err_msg = NULL;

do_compatibleVehicles(
vrp_do_compatibleVehicles(
pd_orders_arr, total_pd_orders,
vehicles_arr, total_vehicles,
matrix_cells_arr, total_cells,
Expand Down
2 changes: 1 addition & 1 deletion src/compatibleVehicles/compatibleVehicles_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ digraph G {
*
*/
void
do_compatibleVehicles(
vrp_do_compatibleVehicles(
Orders_t customers_arr[],
size_t total_customers,

Expand Down
2 changes: 1 addition & 1 deletion src/optimize/optimize.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ process(
char *notice_msg = NULL;
char *err_msg = NULL;

do_optimize(
vrp_do_optimize(
pd_orders_arr, total_pd_orders,
vehicles_arr, total_vehicles,
matrix_cells_arr, total_cells,
Expand Down
9 changes: 4 additions & 5 deletions src/optimize/optimize_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,11 @@ 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] optimize flag to control optimization
* @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] stop_on_all_served Indicator to stop optimization when all shipments are served
* @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
Expand Down Expand Up @@ -344,10 +345,8 @@ subdivide_processing(
*
*/


void
do_optimize(
vrp_do_optimize(
Orders_t *shipments_arr, size_t total_shipments,
Vehicle_t *vehicles_arr, size_t total_vehicles,
Matrix_cell_t *matrix_cells_arr, size_t total_cells,
Expand Down
2 changes: 1 addition & 1 deletion src/pgr_pickDeliver/pgr_pickDeliverEuclidean_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ are_shipments_ok(
} // namespace

void
do_pgr_pickDeliverEuclidean(
vrp_do_pgr_pickDeliverEuclidean(
Orders_t *customers_arr,
size_t total_customers,

Expand Down
2 changes: 1 addition & 1 deletion src/pgr_pickDeliver/pgr_pickDeliver_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ vrprouting::problem::Solution
} // namespace

void
do_pgr_pickDeliver(
vrp_do_pgr_pickDeliver(
struct Orders_t customers_arr[],
size_t total_customers,

Expand Down
2 changes: 1 addition & 1 deletion src/pgr_pickDeliver/pickDeliver.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ process(
char *notice_msg = NULL;
char *err_msg = NULL;

do_pgr_pickDeliver(
vrp_do_pgr_pickDeliver(
pd_orders_arr, total_pd_orders,
vehicles_arr, total_vehicles,
matrix_cells_arr, total_cells,
Expand Down
2 changes: 1 addition & 1 deletion src/pgr_pickDeliver/pickDeliverEuclidean.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ process(
char *log_msg = NULL;
char *notice_msg = NULL;
char *err_msg = NULL;
do_pgr_pickDeliverEuclidean(
vrp_do_pgr_pickDeliverEuclidean(
pd_orders_arr, total_pd_orders,
vehicles_arr, total_vehicles,

Expand Down
2 changes: 1 addition & 1 deletion src/pickDeliver/pickDeliver.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ process(
char *notice_msg = NULL;
char *err_msg = NULL;

do_pickDeliver(
vrp_do_pickDeliver(
pd_orders_arr, total_pd_orders,
vehicles_arr, total_vehicles,
matrix_cells_arr, total_cells,
Expand Down
2 changes: 1 addition & 1 deletion src/pickDeliver/pickDeliver_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ digraph G {
*
*/
void
do_pickDeliver(
vrp_do_pickDeliver(
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,
Expand Down
2 changes: 1 addition & 1 deletion src/vroom/vroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ process(

int32_t loading_time = (int)((clock() - start_loading) / CLOCKS_PER_SEC) * 1000;

do_vrp_vroom(
vrp_do_vroom(
jobs, total_jobs,
jobs_tws, total_jobs_tws,
shipments, total_shipments,
Expand Down
50 changes: 25 additions & 25 deletions src/vroom/vroom_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,33 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* function `vrp_vroom` which calls the main function defined in the
* C++ Header file. It also does exception handling.
*
* @param jobs Pointer to the array of jobs
* @param total_jobs The total number of jobs
* @param jobs_tws Pointer to the array of jobs time windows
* @param total_jobs_tws The total number of jobs time windows
* @param shipments Pointer to the array of shipments
* @param total_shipments The total number of shipments
* @param shipments_tws Pointer to the array of shipments time windows
* @param total_shipments_tws The total number of shipments time windows
* @param vehicles Pointer to the array of vehicles
* @param total_vehicles The total number of total vehicles
* @param breaks Pointer to the array of breaks
* @param total_breaks The total number of total breaks
* @param matrix_rows Pointer to the array of matrix rows
* @param total_matrix_rows The total number of matrix rows
* @param exploration_level Exploration level to use while solving.
* @param timeout Timeout value to stop the solving process (seconds).
* @param loading_timeout Additional time spent in loading the data from SQL Query (seconds).
* @param result_tuples The rows in the result
* @param result_count The count of rows in the result
* @param log_msg Stores the log message
* @param notice_msg Stores the notice message
* @param err_msg Stores the error message
*
* @returns void
* @param[in] jobs Pointer to the array of jobs
* @param[in] total_jobs The total number of jobs
* @param[in] jobs_tws Pointer to the array of jobs time windows
* @param[in] total_jobs_tws The total number of jobs time windows
* @param[in] shipments Pointer to the array of shipments
* @param[in] total_shipments The total number of shipments
* @param[in] shipments_tws Pointer to the array of shipments time windows
* @param[in] total_shipments_tws The total number of shipments time windows
* @param[in] vehicles Pointer to the array of vehicles
* @param[in] total_vehicles The total number of total vehicles
* @param[in] breaks Pointer to the array of breaks
* @param[in] total_breaks The total number of total breaks
* @param[in] breaks_tws Pointer to the array of break timewindows
* @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
* @param[out] notice_msg Stores the notice message
* @param[out] err_msg Stores the error message
*/
void
do_vrp_vroom(
vrp_do_vroom(
Vroom_job_t *jobs, size_t total_jobs,
Vroom_time_window_t *jobs_tws, size_t total_jobs_tws,
Vroom_shipment_t *shipments, size_t total_shipments,
Expand Down

0 comments on commit 4580137

Please sign in to comment.