 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
27 NBPTLine::NBPTLine(
const std::string&
id,
const std::string& name,
const std::string& type,
const std::string& ref,
int interval,
const std::string& nightService,
32 myRef(ref !=
"" ? ref : name),
34 myNightService(nightService),
66 std::vector<std::string> validEdgeIDs;
71 validEdgeIDs.push_back(e->getID());
117 if (permissions != 0 && (permissions & nVuln) == 0) {
122 for (
int i = 0; i < (int)e->getNumLanes(); i++) {
123 if ((e->getPermissions(i) & nVuln) != 0) {
142 std::vector<NBEdge*> result;
154 std::vector<NBEdge*> validEdges;
158 validEdges.push_back(e);
161 if (validEdges.size() == 0) {
167 if (firstStopEdge ==
nullptr) {
172 auto it = std::find(validEdges.begin(), validEdges.end(), firstStopEdge);
173 if (it == validEdges.end()) {
178 return validEdges.front();
183 std::vector<NBEdge*> validEdges;
187 validEdges.push_back(e);
190 if (validEdges.size() == 0) {
196 if (lastStopEdge ==
nullptr) {
201 auto it = std::find(validEdges.begin(), validEdges.end(), lastStopEdge);
202 if (it == validEdges.end()) {
207 return validEdges.back();
212 for (
int i = 0; i < (int)
myPTStops.size(); i++) {
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
std::vector< NBEdge * > myRoute
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
#define WRITE_WARNING(msg)
Storage for edges, including some functionality operating on multiple edges.
Static storage of an output device and its base (abstract) implementation.
std::vector< NBPTStop * > getStops()
void replaceStop(NBPTStop *oldStop, NBPTStop *newStop)
replace the given stop
const double SUMO_const_laneWidth
std::vector< long long int > * getWaysNodes(std::string wayId)
std::vector< NBPTStop * > myPTStops
void setMyNumOfStops(int numStops)
std::string myNightService
NBPTLine(const std::string &id, const std::string &name, const std::string &type, const std::string &ref, int interval, const std::string &nightService, SUMOVehicleClass vClass)
void write(OutputDevice &device, NBEdgeCont &ec)
The representation of a single edge during network building.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
std::vector< NBEdge * > getStopEdges(const NBEdgeCont &ec) const
get stop edges
std::vector< std::string > myWays
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
void addPTStop(NBPTStop *pStop)
const std::vector< NBEdge * > & getRoute() const
std::map< std::string, std::vector< long long int > > myWaysNodes
NBEdge * getRouteEnd(const NBEdgeCont &ec) const
return last valid edge of myRoute (if it doest not lie before the last stop)
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void setEdges(const std::vector< NBEdge * > &edges)
SUMOVehicleClass myVClass
const std::vector< std::string > & getMyWays() const
begin/end of the description of a route
void addWayNode(long long int way, long long int node)
NBEdge * getRouteStart(const NBEdgeCont &ec) const
return first valid edge of myRoute (if it doest not lie after the first stop)
The representation of a single pt stop.
const std::string & getID() const