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 /****************************************************************************/
15 // Container for NBPTLine during netbuild
16 /****************************************************************************/
17 
18 #ifndef SUMO_NBPTLINECONT_H
19 #define SUMO_NBPTLINECONT_H
20 
21 
22 #include <vector>
24 #include "NBPTLine.h"
25 #include "NBEdgeCont.h"
26 
27 class NBPTLineCont {
28 
29 public:
31  NBPTLineCont();
32 
34  ~NBPTLineCont();
35 
37  void insert(NBPTLine* ptLine);
38 
39  const std::map<std::string, NBPTLine*>& getLines() const {
40  return myPTLines;
41  }
42 
43  void process(NBEdgeCont& cont);
44 
46  void addEdges2Keep(const OptionsCont& oc, std::set<std::string>& into);
47 
49  void fixBidiStops(const NBEdgeCont& ec);
50 
51  std::set<std::string>& getServedPTStops();
52 private:
53 
54  static const int FWD;
55  static const int BWD;
56 
58  std::map<std::string, NBPTLine*> myPTLines;
59 
60  void reviseStops(NBPTLine* myPTLine, NBEdgeCont& cont);
61  void constructRoute(NBPTLine* myPTLine, NBEdgeCont& cont);
62 
63  std::set<std::string> myServedPTStops;
64 
65  static double getCost(const NBEdgeCont& ec, SUMOAbstractRouter<NBRouterEdge, NBVehicle>& router,
66  const NBPTStop* from, const NBPTStop* to, const NBVehicle* veh);
67 };
68 
69 
70 #endif //SUMO_NBPTLINECONT_H
static double getCost(const NBEdgeCont &ec, SUMOAbstractRouter< NBRouterEdge, NBVehicle > &router, const NBPTStop *from, const NBPTStop *to, const NBVehicle *veh)
void reviseStops(NBPTLine *myPTLine, NBEdgeCont &cont)
const std::map< std::string, NBPTLine * > & getLines() const
Definition: NBPTLineCont.h:39
static const int BWD
Definition: NBPTLineCont.h:55
The representation of a single pt stop.
Definition: NBPTStop.h:45
void fixBidiStops(const NBEdgeCont &ec)
select the correct stop on superposed rail edges
void process(NBEdgeCont &cont)
std::set< std::string > & getServedPTStops()
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
static const int FWD
Definition: NBPTLineCont.h:54
std::map< std::string, NBPTLine * > myPTLines
The map of names to pt lines.
Definition: NBPTLineCont.h:58
void insert(NBPTLine *ptLine)
insert new line
A vehicle as used by router.
Definition: NBVehicle.h:44
void addEdges2Keep(const OptionsCont &oc, std::set< std::string > &into)
add edges that must be kept
~NBPTLineCont()
destructor
A storage for options typed value containers)
Definition: OptionsCont.h:90
void constructRoute(NBPTLine *myPTLine, NBEdgeCont &cont)
NBPTLineCont()
constructor
std::set< std::string > myServedPTStops
Definition: NBPTLineCont.h:63