PGROUTING  2.6-dev
rule.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: rule.h
4 
5 Copyright (c) 2017 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 aint64_t 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 #ifndef INCLUDE_TRSP_RULE_H_
27 #define INCLUDE_TRSP_RULE_H_
28 
29 
30 #include <vector>
31 #include <sstream>
32 #include "c_types/restriction_t.h"
33 
34 namespace pgrouting {
35 namespace trsp {
36 
37 
38 
39 class Rule {
40  public:
41  explicit Rule(Restriction_t r);
42 
43  inline double cost() const {
44  return m_cost;
45  }
46 
47  const std::vector<int64_t> precedencelist() const;
48 
49  inline int64_t dest_id() const {
50  return m_dest_id;
51  }
52 
53 
54  friend std::ostream& operator<<(std::ostream& log, const Rule &r);
55 
56  private:
57  int64_t m_dest_id;
58  double m_cost;
59  std::vector<int64_t> m_precedencelist;
60 };
61 
62 
63 
64 
65 } // namespace trsp
66 } // namespace pgrouting
67 
68 #endif // INCLUDE_TRSP_RULE_H_
Rule(Restriction_t r)
Definition: rule.cpp:35
std::vector< int64_t > m_precedencelist
Definition: rule.h:59
const std::vector< int64_t > precedencelist() const
Definition: rule.cpp:44
int64_t m_dest_id
Definition: rule.h:57
int64_t dest_id() const
Definition: rule.h:49
Book keeping class for swapping orders between vehicles.
Definition: basic_edge.cpp:28
double cost() const
Definition: rule.h:43
friend std::ostream & operator<<(std::ostream &log, const Rule &r)
Definition: rule.cpp:49