PGROUTING  3.2
order.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: order.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_ORDER_H_
29 #define INCLUDE_VRP_ORDER_H_
30 #pragma once
31 
32 
33 #include <iosfwd>
34 #include "cpp_common/identifier.h"
36 #include "vrp/vehicle_node.h"
37 
38 namespace pgrouting {
39 namespace vrp {
40 
41 
42 class Order : public Identifier {
43  public:
47  Order(size_t p_id, int64_t p_idx,
48  const Vehicle_node &p_pickup,
49  const Vehicle_node &p_deliver);
50 
51  Order(const Order &) = default;
64  const Vehicle_node& delivery() const;
65 
70  const Vehicle_node& pickup() const;
71 
94  void set_compatibles(const Order order, double speed);
108  bool is_valid(double speed) const;
109 
110 
127  bool isCompatibleIJ(const Order &I, double speed) const;
136  friend std::ostream& operator << (std::ostream&, const Order &);
139  private:
146 
152 
169 
183 };
184 
185 } // namespace vrp
186 } // namespace pgrouting
187 
188 #endif // INCLUDE_VRP_ORDER_H_
pgrouting::vrp::Order::subsetI
Identifiers< size_t > subsetI(const Identifiers< size_t > &I) const
Definition: order.cpp:35
pgrouting::vrp::Order::is_valid
bool is_valid(double speed) const
validate a pickup/delivery order
Definition: order.cpp:94
pgrouting::vrp::Order::subsetJ
Identifiers< size_t > subsetJ(const Identifiers< size_t > &J) const
Get a subset of the orders that can be placed after this order.
Definition: order.cpp:40
pgrouting::vrp::Order::m_delivery
Vehicle_node m_delivery
The delivery node identifier.
Definition: order.h:151
pgrouting::vrp::Order::m_compatibleI
Identifiers< size_t > m_compatibleI
Stores all the orders that can be placed before this order.
Definition: order.h:182
pgrouting::vrp::Order::set_compatibles
void set_compatibles(const Order order, double speed)
Definition: order.cpp:111
vehicle_node.h
pgrouting::vrp::Vehicle_node
Extend Tw_node to evaluate the vehicle at node level.
Definition: vehicle_node.h:48
pgrouting::vrp::Order::m_pickup
Vehicle_node m_pickup
The pick up node identifier.
Definition: order.h:145
identifier.h
pgrouting::vrp::Order::pickup
const Vehicle_node & pickup() const
The delivery node identifier.
Definition: order.cpp:88
pgrouting::vrp::Order::delivery
const Vehicle_node & delivery() const
The delivery node identifier.
Definition: order.cpp:82
pgrouting::vrp::Order
Definition: order.h:42
pgrouting::vrp::Order::operator<<
friend std::ostream & operator<<(std::ostream &, const Order &)
Definition: order.cpp:55
pgrouting::Identifier
Definition: identifier.h:39
pgrouting
Book keeping class for swapping orders between vehicles.
Definition: pgr_alphaShape.cpp:56
identifiers.hpp
Identifiers< size_t >
pgrouting::vrp::Order::m_compatibleJ
Identifiers< size_t > m_compatibleJ
Stores all the orders that can be placed after this order.
Definition: order.h:168
pgrouting::vrp::Order::isCompatibleIJ
bool isCompatibleIJ(const Order &I, double speed) const
Can order I be placed before this order?
Definition: order.cpp:135
pgrouting::vrp::Order::Order
Order(size_t p_id, int64_t p_idx, const Vehicle_node &p_pickup, const Vehicle_node &p_deliver)
Definition: order.cpp:45