32 NBPTLine::NBPTLine(
const std::string&
id,
const std::string& name,
const std::string& type,
const std::string& ref,
int interval,
const std::string& nightService,
37 myRef(ref !=
"" ? ref : name),
40 myNightService(nightService),
126 if (permissions != 0 && (permissions & nVuln) == 0) {
131 for (
int i = 0; i < (int)e->getNumLanes(); i++) {
132 if ((e->getPermissions(i) & nVuln) != 0) {
151 std::vector<NBEdge*> result;
163 std::vector<NBEdge*> validEdges;
167 validEdges.push_back(e);
170 if (validEdges.size() == 0) {
176 if (firstStopEdge ==
nullptr) {
181 auto it = std::find(validEdges.begin(), validEdges.end(), firstStopEdge);
182 if (it == validEdges.end()) {
187 return validEdges.front();
192 std::vector<NBEdge*> validEdges;
196 validEdges.push_back(e);
199 if (validEdges.size() == 0) {
205 if (lastStopEdge ==
nullptr) {
210 auto it = std::find(validEdges.begin(), validEdges.end(), lastStopEdge);
211 if (it == validEdges.end()) {
216 return validEdges.back();
221 for (
int i = 0; i < (int)
myPTStops.size(); i++) {
232 for (
NBEdge* e : oldRoute) {
233 if (e->getID() == edgeID) {
234 for (
NBEdge* e2 : replacement) {
250 if (sc.
get(stop->
getID()) ==
nullptr ||
264 long long int lastAreaID = -1;
265 std::string lastName =
"";
268 if (lastAreaID != -1 && stop->
getAreaID() == lastAreaID) {
271 }
else if (lastName !=
"" && stop->
getName() == lastName) {
#define WRITE_WARNINGF(...)
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_PEDESTRIAN
pedestrian
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SUMO_TAG_PT_LINE
A pt line.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_COLOR
A color information.
const double SUMO_const_laneWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Storage for edges, including some functionality operating on multiple edges.
NBEdge * getByID(const std::string &edgeID) const
Returns the edge with id if it exists.
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
The representation of a single edge during network building.
const std::string & getID() const
void deleteDuplicateStops()
std::vector< NBPTStop * > myPTStops
SUMOVehicleClass myVClass
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, RGBColor color)
void addPTStop(NBPTStop *pStop)
std::vector< std::string > myWays
void deleteInvalidStops(const NBEdgeCont &ec, const NBPTStopCont &sc)
remove invalid stops from the line
void write(OutputDevice &device)
std::vector< NBEdge * > myRoute
void removeInvalidEdges(const NBEdgeCont &ec)
remove invalid edges from the line
const std::vector< std::string > & getMyWays() const
const std::string & getLineID() const
std::vector< long long int > * getWaysNodes(std::string wayId)
NBEdge * getRouteEnd(const NBEdgeCont &ec) const
return last valid edge of myRoute (if it doest not lie before the last stop)
const std::vector< NBEdge * > & getRoute() const
void addWayNode(long long int way, long long int node)
std::string myNightService
NBEdge * getRouteStart(const NBEdgeCont &ec) const
return first valid edge of myRoute (if it doest not lie after the first stop)
std::map< std::string, std::vector< long long int > > myWaysNodes
std::vector< NBEdge * > getStopEdges(const NBEdgeCont &ec) const
get stop edges
void setMyNumOfStops(int numStops)
void replaceStop(NBPTStop *oldStop, NBPTStop *newStop)
replace the given stop
void replaceEdge(const std::string &edgeID, const EdgeVector &replacement)
replace the edge with the given edge list
std::vector< NBPTStop * > getStops()
void setEdges(const std::vector< NBEdge * > &edges)
NBPTStop * get(std::string id) const
Retrieve a previously inserted pt stop.
The representation of a single pt stop.
const std::string getEdgeId() const
std::string getID() const
long long int getAreaID() const
const std::string getName() const
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
bool isValid() const
check if RGBColor is valid
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.