Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions include/c_common/vroom/breaks_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h>
#include <stddef.h>

#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
Expand Down
10 changes: 2 additions & 8 deletions include/c_common/vroom/jobs_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h>
#include <stddef.h>

#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
Expand Down
10 changes: 2 additions & 8 deletions include/c_common/vroom/matrix_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h>
#include <stddef.h>

#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
Expand Down
10 changes: 2 additions & 8 deletions include/c_common/vroom/shipments_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h>
#include <stddef.h>

#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
Expand Down
9 changes: 1 addition & 8 deletions include/c_common/vroom/time_windows_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <stdbool.h>
#include <stddef.h>

#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
Expand Down
10 changes: 2 additions & 8 deletions include/c_common/vroom/vehicles_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h>
#include <stddef.h>

#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
Expand Down
2 changes: 1 addition & 1 deletion include/c_types/short_vehicle_rt.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 0 additions & 26 deletions include/c_types/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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

/*************************************************************************/
Expand Down
3 changes: 2 additions & 1 deletion include/cpp_common/vroom_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
19 changes: 18 additions & 1 deletion include/drivers/optimize_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstddef>
#include <cstdint>
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 <stddef.h>
#include <stdint.h>
#include <stdbool.h>
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" {
Expand Down
17 changes: 11 additions & 6 deletions include/drivers/pgr_pickDeliverEuclidean_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstddef>
#include <cstddef>
#include <cstdint>
using Orders_t = struct Orders_t;
using Vehicle_t = struct Vehicle_t;
using Solution_rt = struct Solution_rt;
#else
# include <stddef.h>
#endif

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
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" {
Expand Down
20 changes: 12 additions & 8 deletions include/drivers/pgr_pickDeliver_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstddef>
#include <cstddef>
#include <cstdint>
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 <stddef.h>
#endif

#include "cpp_common/vehicle_t.hpp"
#include "cpp_common/matrix_cell_t.hpp"

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
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" {
Expand Down
19 changes: 18 additions & 1 deletion include/drivers/pickDeliver_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstddef>
#include <cstdint>
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 <stddef.h>
#include <stdint.h>
#include <stdbool.h>
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" {
Expand Down
23 changes: 22 additions & 1 deletion include/drivers/vroom_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstddef>
#include <cstdint>
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 <stddef.h>
#include <stdint.h>
#include <stdbool.h>
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" {
Expand Down
6 changes: 3 additions & 3 deletions include/problem/pickDeliver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Short_vehicle> new_stops,
const Matrix &p_cost_matrix);
std::vector<Short_vehicle>,
const Matrix &);

virtual ~PickDeliver() = default;

Expand Down
2 changes: 2 additions & 0 deletions include/problem/tw_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 6 additions & 1 deletion include/vroom/vroom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -75,7 +80,7 @@ class Vroom : public vrprouting::Messages {
void add_matrix(const vrprouting::vroom::Matrix&);

/** @brief solves the vroom problem */
std::vector<Vroom_rt> solve(int32_t, int32_t, int32_t);
std::vector<Vroom_rt> solve(int32_t, int32_t, int64_t);

private:
std::vector<::vroom::TimeWindow> get_vroom_time_windows(const std::vector<Vroom_time_window_t>&) const;
Expand Down
2 changes: 1 addition & 1 deletion src/common/e_report.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/common/vroom/breaks_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src/common/vroom/jobs_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading