PGROUTING  2.6
dnode.cpp
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: dnode.cpp
4 
5 Copyright (c) 2015 pgRouting developers
6 Mail: project@pgrouting.org
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 
26 #include "vrp/dnode.h"
27 
28 #include "vrp/pgr_pickDeliver.h"
29 
30 namespace pgrouting {
31 namespace vrp {
32 
33 
34 std::ostream& operator << (std::ostream &log, const Dnode &node) {
35  log << node.id()
36  << "(" << node.idx() << ")";
37  return log;
38 }
39 
40 
41 double
42 Dnode::distance(const Base_node *other) const {
45  problem->m_cost_matrix.get_index(other->id()));
46 }
47 
48 
49 Dnode::Dnode(size_t id, int64_t original_id, double, double)
50  : Base_node(id, original_id) {
51  }
52 
53 } // namespace vrp
54 } // namespace pgrouting
55 
56 
static Pgr_pickDeliver * problem
Definition: pd_problem.h:51
int64_t id() const
Definition: identifier.cpp:42
The Base_node class defines the operations that can be performed in a 2D node.
Definition: base_node.h:47
std::ostream & operator<<(std::ostream &log, const Base_node &node)
Definition: base_node.cpp:32
double distance(int64_t i, int64_t j) const
Definition: Dmatrix.h:106
pgrouting::tsp::Dmatrix m_cost_matrix
size_t get_index(int64_t id) const
original id -> idx
Definition: Dmatrix.cpp:90
Book keeping class for swapping orders between vehicles.
Definition: basic_edge.cpp:28
double distance(const Base_node *) const
Definition: dnode.cpp:42
The Dnode class defines a the basic operations when data is a matrix.
Definition: dnode.h:45
size_t idx() const
Definition: identifier.cpp:37