SUMO - Simulation of Urban MObility
NBPTLine.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // The representation of one direction of a single pt line
17 /****************************************************************************/
18 #ifndef SUMO_NBPTLINE_H
19 #define SUMO_NBPTLINE_H
20 
21 
22 #include <string>
23 #include <vector>
24 #include <map>
25 #include "NBEdge.h" // Cherednychek
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
30 class OutputDevice;
31 class NBPTStop;
32 class NBEdgeCont;
33 
34 class NBPTLine {
35 
36 public:
37  explicit NBPTLine(const std::string& name, const std::string& type, const std::string& ref, int interval, const std::string& nightService);
38 
39  void addPTStop(NBPTStop* pStop);
40  long long int getLineID() const;
41  const std::string& getName() const ;
42 
43  const std::string& getType() const {
44  return myType;
45  }
46 
47  std::vector<NBPTStop*> getStops();
48  void write(OutputDevice& device, NBEdgeCont& ec);
49  void setId(long long int id);
50  void addWayNode(long long int way, long long int node);
51 
52  void setMyNumOfStops(int numStops);
53 
55  const std::string& getRef() const {
56  return myRef;
57  }
58 
59  void replaceStops(std::vector<NBPTStop*> stops) {
60  myPTStops = stops;
61  }
62 
63 private:
64  std::string myName;
65  std::string myType;
66  std::vector<NBPTStop*> myPTStops;
67 
68 private:
69  std::map<std::string, std::vector<long long int> > myWaysNodes;
70  std::vector<std::string> myWays;
71 public:
72  const std::vector<std::string>& getMyWays() const;
73  std::vector<long long int>* getWaysNodes(std::string wayId);
74 private:
75 
76  std::string myCurrentWay;
77  long long int myPTLineId;
78  std::string myRef;
80  std::string myNightService;
81 
82 public:
83  void addEdgeVector(std::vector<NBEdge*>::iterator fr, std::vector<NBEdge*>::iterator to);
84 private:
85  // route of ptline
86  std::vector<NBEdge*> myRoute;
87 public:
88  const std::vector<NBEdge*>& getRoute() const;
89 private:
90 
92 };
93 
94 
95 #endif //SUMO_NBPTLINE_H
std::vector< long long int > * getWaysNodes(std::string wayId)
Definition: NBPTLine.cpp:112
const std::string & getType() const
Definition: NBPTLine.h:43
void write(OutputDevice &device, NBEdgeCont &ec)
Definition: NBPTLine.cpp:52
std::string myRef
Definition: NBPTLine.h:78
std::vector< std::string > myWays
Definition: NBPTLine.h:70
std::vector< NBPTStop * > myPTStops
Definition: NBPTLine.h:66
void addPTStop(NBPTStop *pStop)
Definition: NBPTLine.cpp:36
std::string myType
Definition: NBPTLine.h:65
The representation of a single pt stop.
Definition: NBPTStop.h:45
const std::vector< std::string > & getMyWays() const
Definition: NBPTLine.cpp:109
const std::vector< NBEdge * > & getRoute() const
Definition: NBPTLine.cpp:126
const std::string & getRef() const
get line reference (not unique)
Definition: NBPTLine.h:55
void addWayNode(long long int way, long long int node)
Definition: NBPTLine.cpp:100
void setMyNumOfStops(int numStops)
Definition: NBPTLine.cpp:123
void replaceStops(std::vector< NBPTStop *> stops)
Definition: NBPTLine.h:59
void addEdgeVector(std::vector< NBEdge *>::iterator fr, std::vector< NBEdge *>::iterator to)
Definition: NBPTLine.cpp:119
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
long long int myPTLineId
Definition: NBPTLine.h:77
NBPTLine(const std::string &name, const std::string &type, const std::string &ref, int interval, const std::string &nightService)
Definition: NBPTLine.cpp:27
std::string myName
Definition: NBPTLine.h:64
std::string myCurrentWay
Definition: NBPTLine.h:76
int myInterval
Definition: NBPTLine.h:79
const std::string & getName() const
Definition: NBPTLine.cpp:40
std::vector< NBEdge * > myRoute
Definition: NBPTLine.h:86
std::map< std::string, std::vector< long long int > > myWaysNodes
Definition: NBPTLine.h:69
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
std::vector< NBPTStop * > getStops()
Definition: NBPTLine.cpp:49
long long int getLineID() const
Definition: NBPTLine.cpp:45
void setId(long long int id)
Definition: NBPTLine.cpp:97
std::string myNightService
Definition: NBPTLine.h:80
int myNumOfStops
Definition: NBPTLine.h:91