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-2018 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* pLine);
38 
42  std::vector<NBPTLine*>::const_iterator begin() const {
43  return myPTLines.begin();
44  }
45 
49  std::vector<NBPTLine*>::const_iterator end() const {
50  return myPTLines.end();
51  }
52 
53  const std::vector<NBPTLine*>& getLines() const {
54  return myPTLines;
55  }
56 
57  void process(NBEdgeCont& cont);
58 
60  void addEdges2Keep(const OptionsCont& oc, std::set<std::string>& into);
61 
63  void fixBidiStops(const NBEdgeCont& ec);
64 
65  std::set<std::string>& getServedPTStops();
66 private:
67 
68  static const int FWD;
69  static const int BWD;
70 
72  std::vector<NBPTLine*> myPTLines;
73 
74  long long int myIdCnt;
75  void reviseStops(NBPTLine* myPTLine, NBEdgeCont& cont);
76  void constructRoute(NBPTLine* myPTLine, NBEdgeCont& cont);
77 
78  std::set<std::string> myServedPTStops;
79 
80  static double getCost(const NBEdgeCont& ec, SUMOAbstractRouter<NBEdge, NBVehicle>& router,
81  const NBPTStop* from, const NBPTStop* to, const NBVehicle* veh);
82 };
83 
84 
85 #endif //SUMO_NBPTLINECONT_H
void reviseStops(NBPTLine *myPTLine, NBEdgeCont &cont)
const std::vector< NBPTLine * > & getLines() const
Definition: NBPTLineCont.h:53
static const int BWD
Definition: NBPTLineCont.h:69
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()
void insert(NBPTLine *pLine)
insert new line
std::vector< NBPTLine * >::const_iterator end() const
Returns the pointer to the end of the stored pt lines.
Definition: NBPTLineCont.h:49
static double getCost(const NBEdgeCont &ec, SUMOAbstractRouter< NBEdge, NBVehicle > &router, const NBPTStop *from, const NBPTStop *to, const NBVehicle *veh)
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
static const int FWD
Definition: NBPTLineCont.h:68
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
long long int myIdCnt
Definition: NBPTLineCont.h:74
~NBPTLineCont()
destructor
A storage for options typed value containers)
Definition: OptionsCont.h:92
void constructRoute(NBPTLine *myPTLine, NBEdgeCont &cont)
NBPTLineCont()
constructor
std::vector< NBPTLine * >::const_iterator begin() const
Returns the pointer to the begin of the stored pt lines.
Definition: NBPTLineCont.h:42
std::set< std::string > myServedPTStops
Definition: NBPTLineCont.h:78
std::vector< NBPTLine * > myPTLines
The map of names to pt lines.
Definition: NBPTLineCont.h:72