PGROUTING  3.2
pgr_pickDeliver.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: pgr_pickDeliver.h
4 
5 Copyright (c) 2017 pgRouting developers
7 
8 ------
9 
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14 
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 
24  ********************************************************************PGR-GNU*/
25 
28 #ifndef INCLUDE_VRP_PGR_PICKDELIVER_H_
29 #define INCLUDE_VRP_PGR_PICKDELIVER_H_
30 #pragma once
31 
32 
33 
34 #include <vector>
35 #include <memory>
36 #include <utility>
37 
41 #include "vrp/pd_problem.h"
42 #include "cpp_common/Dmatrix.h"
43 #include "vrp/fleet.h"
44 #include "vrp/pd_orders.h"
45 #include "vrp/solution.h"
46 
47 namespace pgrouting {
48 namespace vrp {
49 
50 class Order;
51 class Vehicle_node;
52 
53 class Dnode;
54 class Solution;
55 class Initial_solution;
56 
57 class Pgr_pickDeliver : public PD_problem {
58  friend Fleet;
59  friend Dnode;
60  friend PD_Orders;
61  friend Solution;
63 
64  public:
65 
67  const std::vector<PickDeliveryOrders_t> &pd_orders,
68  const std::vector<Vehicle_t> &vehicles,
69  const pgrouting::tsp::Dmatrix &cost_matrix,
70  double factor,
71  size_t max_cycles,
72  int initial);
73 
74  void solve();
75 
76  std::vector<General_vehicle_orders_t>
77  get_postgres_result() const;
78 
79 
80  size_t max_cycles() const {return m_max_cycles;}
81 
82  void add_node(const Vehicle_node &node);
83 
85  return (Initials_code) m_initial_id;
86  }
87 
88  std::vector<Vehicle_node> get_nodes() const {
89  return m_nodes;
90  }
91 
93  return m_cost_matrix;
94  }
95 
96  Fleet trucks() const {return m_trucks;}
97 
103  private:
106 
108  size_t m_max_cycles;
109 
110  std::vector<Vehicle_node> m_nodes;
112 
115  std::vector<Solution> solutions;
116 };
117 
118 } // namespace vrp
119 } // namespace pgrouting
120 
121 #endif // INCLUDE_VRP_PGR_PICKDELIVER_H_
pgrouting::Pgr_messages
Definition: pgr_messages.h:39
pgrouting::vrp::Pgr_pickDeliver::m_max_cycles
size_t m_max_cycles
maximum cycles in the optimization
Definition: pgr_pickDeliver.h:108
pgrouting::vrp::Fleet
Definition: fleet.h:47
pgrouting::vrp::Pgr_pickDeliver::solutions
std::vector< Solution > solutions
Definition: pgr_pickDeliver.h:115
pgrouting::vrp::Pgr_pickDeliver::m_trucks
Fleet m_trucks
Definition: pgr_pickDeliver.h:114
pickDeliveryOrders_t.h
vehicle_t.h
general_vehicle_orders_t.h
pgrouting::vrp::Pgr_pickDeliver::Solution
friend Solution
Definition: pgr_pickDeliver.h:61
pgrouting::vrp::Vehicle_node
Extend Tw_node to evaluate the vehicle at node level.
Definition: vehicle_node.h:48
pgrouting::vrp::Pgr_pickDeliver::get_nodes
std::vector< Vehicle_node > get_nodes() const
Definition: pgr_pickDeliver.h:88
pd_orders.h
pgrouting::vrp::Pgr_pickDeliver::Dnode
friend Dnode
Definition: pgr_pickDeliver.h:59
pgrouting::vrp::Pgr_pickDeliver::msg
Pgr_messages msg
message controller for all classes
Definition: pgr_pickDeliver.h:99
pgrouting::vrp::Pgr_pickDeliver::m_cost_matrix
pgrouting::tsp::Dmatrix m_cost_matrix
Definition: pgr_pickDeliver.h:111
pgrouting::vrp::Pgr_pickDeliver::get_cost_matrix
pgrouting::tsp::Dmatrix get_cost_matrix() const
Definition: pgr_pickDeliver.h:92
pgrouting::vrp::Pgr_pickDeliver::m_nodes
std::vector< Vehicle_node > m_nodes
Definition: pgr_pickDeliver.h:110
pgrouting::vrp::Pgr_pickDeliver
Definition: pgr_pickDeliver.h:57
pgrouting::vrp::Pgr_pickDeliver::Fleet
friend Fleet
Definition: pgr_pickDeliver.h:58
pgrouting::vrp::Pgr_pickDeliver::max_cycles
size_t max_cycles() const
Definition: pgr_pickDeliver.h:80
pgrouting::vrp::Pgr_pickDeliver::PD_Orders
friend PD_Orders
Definition: pgr_pickDeliver.h:60
pgrouting::vrp::Pgr_pickDeliver::Initial_solution
friend Initial_solution
Definition: pgr_pickDeliver.h:62
pgrouting::vrp::Pgr_pickDeliver::get_kind
Initials_code get_kind() const
Definition: pgr_pickDeliver.h:84
pgrouting::vrp::Pgr_pickDeliver::get_postgres_result
std::vector< General_vehicle_orders_t > get_postgres_result() const
Definition: pgr_pickDeliver.cpp:94
pgrouting::vrp::Pgr_pickDeliver::trucks
Fleet trucks() const
Definition: pgr_pickDeliver.h:96
Dmatrix.h
solution.h
pgrouting::vrp::Pgr_pickDeliver::m_orders
PD_Orders m_orders
Definition: pgr_pickDeliver.h:113
pgrouting::vrp::PD_Orders
Definition: pd_orders.h:48
pd_problem.h
pgrouting::vrp::Pgr_pickDeliver::solve
void solve()
Definition: pgr_pickDeliver.cpp:51
pgrouting::vrp::Pgr_pickDeliver::add_node
void add_node(const Vehicle_node &node)
Definition: pgr_pickDeliver.cpp:128
pgrouting::vrp::PD_problem
Definition: pd_problem.h:42
pgrouting::tsp::Dmatrix
Definition: Dmatrix.h:43
pgrouting::vrp::Initials_code
Initials_code
Different kinds to insert an order into the vehicle.
Definition: initials_code.h:36
pgrouting::vrp::Pgr_pickDeliver::m_initial_id
int m_initial_id
used define the initial solution algorithm to be used
Definition: pgr_pickDeliver.h:105
pgrouting
Book keeping class for swapping orders between vehicles.
Definition: pgr_alphaShape.cpp:56
pgrouting::vrp::Pgr_pickDeliver::Pgr_pickDeliver
Pgr_pickDeliver(const std::vector< PickDeliveryOrders_t > &pd_orders, const std::vector< Vehicle_t > &vehicles, const pgrouting::tsp::Dmatrix &cost_matrix, double factor, size_t max_cycles, int initial)
Constructor for the matrix version.
Definition: pgr_pickDeliver.cpp:135
fleet.h