Eclipse 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-2019 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 /****************************************************************************/
15 // Container for pt stops during the netbuilding process
16 /****************************************************************************/
17 
18 #ifndef SUMO_NBPTSTOPCONT_H
19 #define SUMO_NBPTSTOPCONT_H
20 
21 #include <string>
22 #include <map>
23 #include "NBPTStop.h"
24 
25 class NBEdge;
26 class NBEdgeCont;
27 
28 class NBPTStopCont {
29 
30 public:
31 
32  ~NBPTStopCont();
33 
38  bool insert(NBPTStop* ptStop);
39 
41  NBPTStop* get(std::string id);
42 
44  int size() const {
45  return (int) myPTStops.size();
46  }
47 
51  std::map<std::string, NBPTStop*>::const_iterator begin() const {
52  return myPTStops.begin();
53  }
54 
58  std::map<std::string, NBPTStop*>::const_iterator end() const {
59  return myPTStops.end();
60  }
61 
62  const std::map<std::string, NBPTStop*>& getStops() const {
63  return myPTStops;
64  }
65 
66 
71  void cleanupDeleted(NBEdgeCont& cont);
72 
73  void assignLanes(NBEdgeCont& cont);
74 
76  int generateBidiStops(NBEdgeCont& cont);
77 
78  void localizePTStops(NBEdgeCont& cont);
79 
80  void findAccessEdgesForRailStops(NBEdgeCont& cont, double maxRadius, int maxCount, double accessFactor);
81 
82  void postprocess(std::set<std::string>& usedStops);
83 
85  void addEdges2Keep(const OptionsCont& oc, std::set<std::string>& into);
86 
87 private:
89  typedef std::map<std::string, NBPTStop*> PTStopsCont;
90 
93 
95 
96 
100  double computeCrossProductEdgePosition(const NBEdge* edge, const Position& closestPlatform) const;
101 
102  static std::string getReverseID(const std::string& id);
103 
104 public:
105  static NBEdge* getReverseEdge(NBEdge* edge);
106 
107 
108  void alignIdSigns();
109 };
110 
111 #endif //SUMO_NBPTSTOPCONT_H
NBPTStopCont
Definition: NBPTStopCont.h:28
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
NBPTStopCont::localizePTStops
void localizePTStops(NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:60
NBPTStopCont::addEdges2Keep
void addEdges2Keep(const OptionsCont &oc, std::set< std::string > &into)
add edges that must be kept
Definition: NBPTStopCont.cpp:314
NBPTStopCont::begin
std::map< std::string, NBPTStop * >::const_iterator begin() const
Returns the pointer to the begin of the stored pt stops.
Definition: NBPTStopCont.h:51
NBPTStopCont::cleanupDeleted
void cleanupDeleted(NBEdgeCont &cont)
remove stops on non existing (removed) edges
Definition: NBPTStopCont.cpp:300
NBPTStopCont::getReverseEdge
static NBEdge * getReverseEdge(NBEdge *edge)
Definition: NBPTStopCont.cpp:285
NBPTStopCont::computeCrossProductEdgePosition
double computeCrossProductEdgePosition(const NBEdge *edge, const Position &closestPlatform) const
Definition: NBPTStopCont.cpp:236
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:86
NBPTStopCont::alignIdSigns
void alignIdSigns()
Definition: NBPTStopCont.cpp:340
NBPTStopCont::assignAndCreatNewPTStopAsNeeded
NBPTStop * assignAndCreatNewPTStopAsNeeded(NBPTStop *pStop, NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:178
NBPTStopCont::~NBPTStopCont
~NBPTStopCont()
Definition: NBPTStopCont.cpp:30
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
NBPTStopCont::size
int size() const
Returns the number of pt stops stored in this container.
Definition: NBPTStopCont.h:44
NBPTStopCont::getReverseStop
NBPTStop * getReverseStop(NBPTStop *pStop, NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:160
NBPTPlatform
Definition: NBPTPlatform.h:23
NBPTStopCont::end
std::map< std::string, NBPTStop * >::const_iterator end() const
Returns the pointer to the end of the stored pt stops.
Definition: NBPTStopCont.h:58
NBPTStopCont::getStops
const std::map< std::string, NBPTStop * > & getStops() const
Definition: NBPTStopCont.h:62
NBPTStopCont::PTStopsCont
std::map< std::string, NBPTStop * > PTStopsCont
Definition of the map of names to pt stops.
Definition: NBPTStopCont.h:89
NBPTStopCont::myPTStops
PTStopsCont myPTStops
The map of names to pt stops.
Definition: NBPTStopCont.h:92
NBPTStopCont::assignPTStopToEdgeOfClosestPlatform
void assignPTStopToEdgeOfClosestPlatform(NBPTStop *pStop, NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:213
NBPTStopCont::get
NBPTStop * get(std::string id)
Retrieve a previously inserted pt stop.
Definition: NBPTStopCont.cpp:51
NBPTStop.h
NBPTStopCont::assignLanes
void assignLanes(NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:95
NBPTStopCont::generateBidiStops
int generateBidiStops(NBEdgeCont &cont)
duplicate stops for superposed rail edges and return the number of generated stops
Definition: NBPTStopCont.cpp:114
NBPTStopCont::getReverseID
static std::string getReverseID(const std::string &id)
Definition: NBPTStopCont.cpp:335
NBPTStopCont::insert
bool insert(NBPTStop *ptStop)
Inserts a node into the map.
Definition: NBPTStopCont.cpp:39
NBPTStopCont::postprocess
void postprocess(std::set< std::string > &usedStops)
Definition: NBPTStopCont.cpp:324
NBPTStop
The representation of a single pt stop.
Definition: NBPTStop.h:45
NBPTStopCont::getClosestPlatformToPTStopPosition
const NBPTPlatform * getClosestPlatformToPTStopPosition(NBPTStop *pStop)
Definition: NBPTStopCont.cpp:268
NBPTStopCont::findAccessEdgesForRailStops
void findAccessEdgesForRailStops(NBEdgeCont &cont, double maxRadius, int maxCount, double accessFactor)
Definition: NBPTStopCont.cpp:356