Eclipse SUMO - Simulation of Urban MObility
NBPTLineCont.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 NBPTLine during netbuild
15 /****************************************************************************/
16 
17 #ifndef SUMO_NBPTLINECONT_H
18 #define SUMO_NBPTLINECONT_H
19 
20 
21 #include <vector>
23 #include "NBPTLine.h"
24 #include "NBEdgeCont.h"
25 
26 class NBPTLineCont {
27 
28 public:
30  NBPTLineCont();
31 
33  ~NBPTLineCont();
34 
36  void insert(NBPTLine* ptLine);
37 
38  const std::map<std::string, NBPTLine*>& getLines() const {
39  return myPTLines;
40  }
41 
42  void process(NBEdgeCont& ec, NBPTStopCont& sc);
43 
45  void addEdges2Keep(const OptionsCont& oc, std::set<std::string>& into);
46 
48  void fixBidiStops(const NBEdgeCont& ec);
49 
50  std::set<std::string>& getServedPTStops();
51 private:
52 
53  static const int FWD;
54  static const int BWD;
55 
57  std::map<std::string, NBPTLine*> myPTLines;
58 
60  void reviseStops(NBPTLine* line, const NBEdgeCont& ec, NBPTStopCont& sc);
61 
62  /* @brief find way element corresponding to the stop
63  * @note: if the edge id is updated, the stop extent is recomputed */
64  NBPTStop* findWay(NBPTLine* line, NBPTStop* stop, const NBEdgeCont& ec, NBPTStopCont& sc) const;
65 
66  void constructRoute(NBPTLine* myPTLine, NBEdgeCont& cont);
67 
68  std::set<std::string> myServedPTStops;
69 
70  static double getCost(const NBEdgeCont& ec, SUMOAbstractRouter<NBRouterEdge, NBVehicle>& router,
71  const NBPTStop* from, const NBPTStop* to, const NBVehicle* veh);
72 
73  static std::string getWayID(const std::string& edgeID);
74 };
75 
76 
77 #endif //SUMO_NBPTLINECONT_H
NBPTStopCont
Definition: NBPTStopCont.h:27
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
NBPTLineCont::BWD
static const int BWD
Definition: NBPTLineCont.h:54
NBPTLineCont::constructRoute
void constructRoute(NBPTLine *myPTLine, NBEdgeCont &cont)
Definition: NBPTLineCont.cpp:231
NBPTLineCont::process
void process(NBEdgeCont &ec, NBPTStopCont &sc)
Definition: NBPTLineCont.cpp:57
NBPTLineCont::insert
void insert(NBPTLine *ptLine)
insert new line
Definition: NBPTLineCont.cpp:53
NBPTLineCont::myServedPTStops
std::set< std::string > myServedPTStops
Definition: NBPTLineCont.h:68
NBPTLineCont::FWD
static const int FWD
Definition: NBPTLineCont.h:53
NBPTLine
Definition: NBPTLine.h:33
NBEdgeCont.h
NBPTLineCont::NBPTLineCont
NBPTLineCont()
constructor
Definition: NBPTLineCont.cpp:42
NBPTLineCont::fixBidiStops
void fixBidiStops(const NBEdgeCont &ec)
select the correct stop on superposed rail edges
Definition: NBPTLineCont.cpp:351
NBPTLineCont::~NBPTLineCont
~NBPTLineCont()
destructor
Definition: NBPTLineCont.cpp:45
NBPTLineCont::findWay
NBPTStop * findWay(NBPTLine *line, NBPTStop *stop, const NBEdgeCont &ec, NBPTStopCont &sc) const
Definition: NBPTLineCont.cpp:149
NBPTLineCont::getCost
static double getCost(const NBEdgeCont &ec, SUMOAbstractRouter< NBRouterEdge, NBVehicle > &router, const NBPTStop *from, const NBPTStop *to, const NBVehicle *veh)
Definition: NBPTLineCont.cpp:450
NBPTLineCont
Definition: NBPTLineCont.h:26
NBPTLineCont::getServedPTStops
std::set< std::string > & getServedPTStops()
Definition: NBPTLineCont.cpp:345
NBPTLineCont::addEdges2Keep
void addEdges2Keep(const OptionsCont &oc, std::set< std::string > &into)
add edges that must be kept
Definition: NBPTLineCont.cpp:333
NBPTLineCont::getLines
const std::map< std::string, NBPTLine * > & getLines() const
Definition: NBPTLineCont.h:38
NBVehicle
A vehicle as used by router.
Definition: NBVehicle.h:43
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
SUMOAbstractRouter< NBRouterEdge, NBVehicle >
NBPTLineCont::reviseStops
void reviseStops(NBPTLine *line, const NBEdgeCont &ec, NBPTStopCont &sc)
find directional edge for all stops of the line
Definition: NBPTLineCont.cpp:69
NBPTLine.h
NBPTLineCont::myPTLines
std::map< std::string, NBPTLine * > myPTLines
The map of names to pt lines.
Definition: NBPTLineCont.h:57
NBPTStop
The representation of a single pt stop.
Definition: NBPTStop.h:44
SUMOAbstractRouter.h
NBPTLineCont::getWayID
static std::string getWayID(const std::string &edgeID)
Definition: NBPTLineCont.cpp:468