SUMO - Simulation of Urban MObility
NBPTStopCont.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Container for pt stops during the netbuilding process
18 /****************************************************************************/
19 
20 #ifndef SUMO_NBPTSTOPCONT_H
21 #define SUMO_NBPTSTOPCONT_H
22 
23 #include <string>
24 #include <map>
25 #include "NBPTStop.h"
26 
27 class NBEdge;
28 class NBEdgeCont;
29 
30 class NBPTStopCont {
31 
32 public:
33 
34  ~NBPTStopCont();
35 
40  bool insert(NBPTStop* ptStop);
41 
43  NBPTStop* get(std::string id);
44 
46  int size() const {
47  return (int) myPTStops.size();
48  }
49 
53  std::map<std::string, NBPTStop*>::const_iterator begin() const {
54  return myPTStops.begin();
55  }
56 
57 
61  std::map<std::string, NBPTStop*>::const_iterator end() const {
62  return myPTStops.end();
63  }
64 
69  void reviseStops(NBEdgeCont& cont);
70 
71  void assignLanes(NBEdgeCont& cont);
72 
73  void localizePTStops(NBEdgeCont& cont);
74 
75  void findAccessEdgesForRailStops(NBEdgeCont& cont, double d, int i);
76 
77  void postprocess(std::set<std::string>& usedStops);
78 
80  void addEdges2Keep(const OptionsCont& oc, std::set<std::string>& into);
81 
82 private:
84  typedef std::map<std::string, NBPTStop*> PTStopsCont;
85 
87  PTStopsCont myPTStops;
88 
90 
91 
95  double computeCrossProductEdgePosition(const NBEdge* edge, const Position* closestPlatform) const;
96 
97 public:
98  static NBEdge* getReverseEdge(NBEdge* edge);
99 
100 
101  void alignIdSigns();
102 };
103 
104 #endif //SUMO_NBPTSTOPCONT_H
void reviseStops(NBEdgeCont &cont)
revise pt stops and remove stops on non existing (removed) edges
void alignIdSigns()
PTStopsCont myPTStops
The map of names to pt stops.
Definition: NBPTStopCont.h:87
void addEdges2Keep(const OptionsCont &oc, std::set< std::string > &into)
add edges that must be kept
void assignPTStopToEdgeOfClosestPlatform(NBPTStop *pStop, NBEdgeCont &cont)
void findAccessEdgesForRailStops(NBEdgeCont &cont, double d, int i)
void postprocess(std::set< std::string > &usedStops)
NBPTPlatform * getClosestPlatformToPTStopPosition(NBPTStop *pStop)
The representation of a single edge during network building.
Definition: NBEdge.h:70
NBPTStop * assignAndCreatNewPTStopAsNeeded(NBPTStop *pStop, NBEdgeCont &cont)
double computeCrossProductEdgePosition(const NBEdge *edge, const Position *closestPlatform) const
The representation of a single pt stop.
Definition: NBPTStop.h:51
std::map< std::string, NBPTStop * > PTStopsCont
Definition of the map of names to pt stops.
Definition: NBPTStopCont.h:84
void localizePTStops(NBEdgeCont &cont)
void assignLanes(NBEdgeCont &cont)
std::map< std::string, NBPTStop * >::const_iterator begin() const
Returns the pointer to the begin of the stored pt stops.
Definition: NBPTStopCont.h:53
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
std::map< std::string, NBPTStop * >::const_iterator end() const
Returns the pointer to the end of the stored pt stops.
Definition: NBPTStopCont.h:61
A storage for options typed value containers)
Definition: OptionsCont.h:98
NBPTStop * getReverseStop(NBPTStop *pStop, NBEdgeCont &cont)
bool insert(NBPTStop *ptStop)
Inserts a node into the map.
static NBEdge * getReverseEdge(NBEdge *edge)
int size() const
Returns the number of pt stops stored in this container.
Definition: NBPTStopCont.h:46