SUMO - Simulation of Urban MObility
NBPTStopCont.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // Container for pt stops during the netbuilding process
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 #ifndef SUMO_NBPTSTOPCONT_H
22 #define SUMO_NBPTSTOPCONT_H
23 
24 #include <string>
25 #include <map>
26 #include "NBPTStop.h"
27 
28 class NBEdge;
29 class NBEdgeCont;
30 
31 class NBPTStopCont {
32 
33 public:
34 
35  ~NBPTStopCont();
36 
41  bool insert(NBPTStop* ptStop);
42 
44  NBPTStop* get(std::string id);
45 
47  int size() const {
48  return (int) myPTStops.size();
49  }
50 
54  std::map<std::string, NBPTStop*>::const_iterator begin() const {
55  return myPTStops.begin();
56  }
57 
58 
62  std::map<std::string, NBPTStop*>::const_iterator end() const {
63  return myPTStops.end();
64  }
65 
70  void reviseStops(NBEdgeCont& cont);
71 
72  void process(NBEdgeCont& cont);
73 private:
75  typedef std::map<std::string, NBPTStop*> PTStopsCont;
76 
78  PTStopsCont myPTStops;
79 
81 
82 
86  double computeCrossProductEdgePosition(const NBEdge* edge, const Position* closestPlatform) const;
87 
88 public:
89  static bool findLaneAndComputeBusStopExtend(NBPTStop* pStop, NBEdgeCont& cont);
90  static NBEdge* getReverseEdge(NBEdge* edge);
91 
92 
93 };
94 
95 #endif //SUMO_NBPTSTOPCONT_H
void reviseStops(NBEdgeCont &cont)
revise pt stops and remove stops on non existing (removed) edges
PTStopsCont myPTStops
The map of names to pt stops.
Definition: NBPTStopCont.h:78
void assignPTStopToEdgeOfClosestPlatform(NBPTStop *pStop, NBEdgeCont &cont)
NBPTPlatform * getClosestPlatformToPTStopPosition(NBPTStop *pStop)
The representation of a single edge during network building.
Definition: NBEdge.h:71
NBPTStop * assignAndCreatNewPTStopAsNeeded(NBPTStop *pStop, 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:54
The representation of a single pt stop.
Definition: NBPTStop.h:51
static bool findLaneAndComputeBusStopExtend(NBPTStop *pStop, NBEdgeCont &cont)
std::map< std::string, NBPTStop * > PTStopsCont
Definition of the map of names to pt stops.
Definition: NBPTStopCont.h:75
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
std::map< std::string, NBPTStop * >::const_iterator end() const
Returns the pointer to the end of the stored pt stops.
Definition: NBPTStopCont.h:62
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
void process(NBEdgeCont &cont)
NBPTStop * getReverseStop(NBPTStop *pStop, NBEdgeCont &cont)
bool insert(NBPTStop *ptStop)
Inserts a node into the map.
static NBEdge * getReverseEdge(NBEdge *edge)
double computeCrossProductEdgePosition(const NBEdge *edge, const Position *closestPlatform) const
int size() const
Returns the number of pt stops stored in this container.
Definition: NBPTStopCont.h:47