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 /****************************************************************************/
14 // Container for pt stops during the netbuilding process
15 /****************************************************************************/
16 
17 #ifndef SUMO_NBPTSTOPCONT_H
18 #define SUMO_NBPTSTOPCONT_H
19 
20 #include <string>
21 #include <map>
22 #include "NBPTStop.h"
23 
24 class NBEdge;
25 class NBEdgeCont;
26 
27 class NBPTStopCont {
28 
29 public:
30 
31  ~NBPTStopCont();
32 
37  bool insert(NBPTStop* ptStop);
38 
40  NBPTStop* get(std::string id);
41 
43  int size() const {
44  return (int) myPTStops.size();
45  }
46 
50  std::map<std::string, NBPTStop*>::const_iterator begin() const {
51  return myPTStops.begin();
52  }
53 
57  std::map<std::string, NBPTStop*>::const_iterator end() const {
58  return myPTStops.end();
59  }
60 
61  const std::map<std::string, NBPTStop*>& getStops() const {
62  return myPTStops;
63  }
64 
65 
70  int cleanupDeleted(NBEdgeCont& cont);
71 
72  void assignLanes(NBEdgeCont& cont);
73 
75  int generateBidiStops(NBEdgeCont& cont);
76 
77  void localizePTStops(NBEdgeCont& cont);
78 
79  void findAccessEdgesForRailStops(NBEdgeCont& cont, double maxRadius, int maxCount, double accessFactor);
80 
81  void postprocess(std::set<std::string>& usedStops);
82 
84  void addEdges2Keep(const OptionsCont& oc, std::set<std::string>& into);
85 
86  NBPTStop* findStop(const std::string& origEdgeID, Position pos, double threshold = 1) const;
87 
88 private:
90  typedef std::map<std::string, NBPTStop*> PTStopsCont;
91 
94 
96 
97 
101  double computeCrossProductEdgePosition(const NBEdge* edge, const Position& closestPlatform) const;
102 
103  static std::string getReverseID(const std::string& id);
104 
105 public:
106  static NBEdge* getReverseEdge(NBEdge* edge);
107 
108 
109  void alignIdSigns();
110 };
111 
112 #endif //SUMO_NBPTSTOPCONT_H
NBPTStopCont
Definition: NBPTStopCont.h:27
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
NBPTStopCont::localizePTStops
void localizePTStops(NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:59
NBPTStopCont::addEdges2Keep
void addEdges2Keep(const OptionsCont &oc, std::set< std::string > &into)
add edges that must be kept
Definition: NBPTStopCont.cpp:315
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:50
NBPTStopCont::getReverseEdge
static NBEdge * getReverseEdge(NBEdge *edge)
Definition: NBPTStopCont.cpp:284
NBPTStopCont::computeCrossProductEdgePosition
double computeCrossProductEdgePosition(const NBEdge *edge, const Position &closestPlatform) const
Definition: NBPTStopCont.cpp:235
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
NBPTStopCont::alignIdSigns
void alignIdSigns()
Definition: NBPTStopCont.cpp:341
NBPTStopCont::cleanupDeleted
int cleanupDeleted(NBEdgeCont &cont)
remove stops on non existing (removed) edges
Definition: NBPTStopCont.cpp:299
NBPTStopCont::assignAndCreatNewPTStopAsNeeded
NBPTStop * assignAndCreatNewPTStopAsNeeded(NBPTStop *pStop, NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:177
NBPTStopCont::~NBPTStopCont
~NBPTStopCont()
Definition: NBPTStopCont.cpp:29
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
NBPTStopCont::size
int size() const
Returns the number of pt stops stored in this container.
Definition: NBPTStopCont.h:43
NBPTStopCont::getReverseStop
NBPTStop * getReverseStop(NBPTStop *pStop, NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:159
NBPTPlatform
Definition: NBPTPlatform.h:22
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:57
NBPTStopCont::findStop
NBPTStop * findStop(const std::string &origEdgeID, Position pos, double threshold=1) const
Definition: NBPTStopCont.cpp:413
NBPTStopCont::getStops
const std::map< std::string, NBPTStop * > & getStops() const
Definition: NBPTStopCont.h:61
NBPTStopCont::PTStopsCont
std::map< std::string, NBPTStop * > PTStopsCont
Definition of the map of names to pt stops.
Definition: NBPTStopCont.h:90
NBPTStopCont::myPTStops
PTStopsCont myPTStops
The map of names to pt stops.
Definition: NBPTStopCont.h:93
NBPTStopCont::assignPTStopToEdgeOfClosestPlatform
void assignPTStopToEdgeOfClosestPlatform(NBPTStop *pStop, NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:212
NBPTStopCont::get
NBPTStop * get(std::string id)
Retrieve a previously inserted pt stop.
Definition: NBPTStopCont.cpp:50
NBPTStop.h
NBPTStopCont::assignLanes
void assignLanes(NBEdgeCont &cont)
Definition: NBPTStopCont.cpp:94
NBPTStopCont::generateBidiStops
int generateBidiStops(NBEdgeCont &cont)
duplicate stops for superposed rail edges and return the number of generated stops
Definition: NBPTStopCont.cpp:113
NBPTStopCont::getReverseID
static std::string getReverseID(const std::string &id)
Definition: NBPTStopCont.cpp:336
NBPTStopCont::insert
bool insert(NBPTStop *ptStop)
Inserts a node into the map.
Definition: NBPTStopCont.cpp:38
NBPTStopCont::postprocess
void postprocess(std::set< std::string > &usedStops)
Definition: NBPTStopCont.cpp:325
NBPTStop
The representation of a single pt stop.
Definition: NBPTStop.h:44
NBPTStopCont::getClosestPlatformToPTStopPosition
const NBPTPlatform * getClosestPlatformToPTStopPosition(NBPTStop *pStop)
Definition: NBPTStopCont.cpp:267
NBPTStopCont::findAccessEdgesForRailStops
void findAccessEdgesForRailStops(NBEdgeCont &cont, double maxRadius, int maxCount, double accessFactor)
Definition: NBPTStopCont.cpp:360