PGROUTING  3.2
pd_orders.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: pd_orders.h
4 
5 Copyright (c) 2015 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_PD_ORDERS_H_
29 #define INCLUDE_VRP_PD_ORDERS_H_
30 #pragma once
31 
32 #include <vector>
33 #include <memory>
34 #include <utility>
35 
38 
39 #include "vrp/pd_problem.h"
40 
41 
42 namespace pgrouting {
43 namespace vrp {
44 
45 class Order;
46 class Vehicle_node;
47 
48 class PD_Orders {
50  friend class PD_problem;
51 
52  typedef std::vector<Order> Orders;
53 
54  public:
55  typedef Orders::iterator o_iterator;
56  typedef Orders::const_iterator o_const_iterator;
57 
58  public:
62  PD_Orders() = default;
63  PD_Orders(const PD_Orders&) = default;
64  explicit PD_Orders(const std::vector<PickDeliveryOrders_t>&);
67  void set_compatibles(double speed);
68  size_t find_best_J(Identifiers<size_t> &within_this_set) const;
69  size_t find_best_I(Identifiers<size_t> &within_this_set) const;
70 
71 
72 
77  Order& operator[](size_t o);
78  const Order& operator[](size_t o) const;
79  size_t size() const {return m_orders.size();}
80  o_iterator begin() {return m_orders.begin();}
81  o_iterator end() {return m_orders.end();}
82  o_const_iterator begin() const {return m_orders.begin();}
83  o_const_iterator end() const {return m_orders.end();}
86  private:
87  void build_orders(
88  const std::vector<PickDeliveryOrders_t> &pd_orders);
89 
90  void add_order(
91  const PickDeliveryOrders_t &,
92  const Vehicle_node&,
93  const Vehicle_node&);
94 
95 
96  private:
98 
100  Pgr_messages& msg() const;
101 
104 
105 };
106 
107 } // namespace vrp
108 } // namespace pgrouting
109 
110 #endif // INCLUDE_VRP_PD_ORDERS_H_
pgrouting::Pgr_messages
Definition: pgr_messages.h:39
pgrouting::vrp::PD_Orders::m_orders
Orders m_orders
Definition: pd_orders.h:97
pgrouting::vrp::PD_Orders::size
size_t size() const
Definition: pd_orders.h:79
pickDeliveryOrders_t.h
PickDeliveryOrders_t
Definition: pickDeliveryOrders_t.h:43
pgrouting::vrp::PD_Orders::Orders
std::vector< Order > Orders
Definition: pd_orders.h:52
pgrouting::vrp::PD_Orders::end
o_iterator end()
Definition: pd_orders.h:81
pgrouting::vrp::Vehicle_node
Extend Tw_node to evaluate the vehicle at node level.
Definition: vehicle_node.h:48
pgrouting::vrp::PD_Orders::begin
o_const_iterator begin() const
Definition: pd_orders.h:82
pgrouting::vrp::PD_Orders::build_orders
void build_orders(const std::vector< PickDeliveryOrders_t > &pd_orders)
Definition: pd_orders.cpp:64
pgrouting::vrp::PD_Orders::msg
Pgr_messages & msg() const
Access to the problem's message.
pgrouting::vrp::Pgr_pickDeliver
Definition: pgr_pickDeliver.h:57
pgrouting::vrp::PD_Orders::find_best_J
size_t find_best_J(Identifiers< size_t > &within_this_set) const
Definition: pd_orders.cpp:125
pgrouting::vrp::PD_Orders::PD_Orders
PD_Orders()=default
pgrouting::vrp::PD_Orders::o_iterator
Orders::iterator o_iterator
Definition: pd_orders.h:55
pgrouting::vrp::PD_Orders::end
o_const_iterator end() const
Definition: pd_orders.h:83
pgrouting::vrp::Order
Definition: order.h:42
pgrouting::vrp::PD_Orders::problem
static Pgr_pickDeliver * problem
The problem.
Definition: pd_orders.h:103
pgrouting::vrp::PD_Orders
Definition: pd_orders.h:48
pd_problem.h
pgrouting::vrp::PD_Orders::add_order
void add_order(const PickDeliveryOrders_t &, const Vehicle_node &, const Vehicle_node &)
Definition: pd_orders.cpp:48
pgrouting::vrp::PD_Orders::o_const_iterator
Orders::const_iterator o_const_iterator
Definition: pd_orders.h:56
pgrouting::vrp::PD_Orders::set_compatibles
void set_compatibles(double speed)
Definition: pd_orders.cpp:116
pgrouting::vrp::PD_Orders::operator[]
Order & operator[](size_t o)
Definition: pd_orders.cpp:104
pgrouting::vrp::PD_Orders::begin
o_iterator begin()
Definition: pd_orders.h:80
pgrouting::vrp::PD_Orders::find_best_I
size_t find_best_I(Identifiers< size_t > &within_this_set) const
Definition: pd_orders.cpp:144
pgrouting::vrp::PD_problem
Definition: pd_problem.h:42
pgrouting
Book keeping class for swapping orders between vehicles.
Definition: pgr_alphaShape.cpp:56
identifiers.hpp
Identifiers< size_t >