Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
RONetHandler.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
20// The handler that parses a SUMO-network for its usage in a router
21/****************************************************************************/
22#pragma once
23#include <config.h>
24
25#include <string>
29
30
31// ===========================================================================
32// class declarations
33// ===========================================================================
34class RONet;
35class OptionsCont;
36class ROEdge;
38
39
40// ===========================================================================
41// class definitions
42// ===========================================================================
51public:
57 RONetHandler(RONet& net, ROAbstractEdgeBuilder& eb, const bool ignoreInternal, const double minorPenalty, double tlsPenalty, double turnaroundPenalty);
58
59
61 virtual ~RONetHandler();
62
64 const std::map<ROEdge*, std::string>& getBidiMap() const {
65 return myBidiEdges;
66 }
67
68protected:
70
71
79 virtual void myStartElement(int element, const SUMOSAXAttributes& attrs);
80
87 virtual void myEndElement(int element);
89
90protected:
92
93
95 void addParam(const SUMOSAXAttributes& attrs);
96
108 void parseEdge(const SUMOSAXAttributes& attrs);
109
110
119 virtual void parseLane(const SUMOSAXAttributes& attrs);
120
121
130 void parseJunction(const SUMOSAXAttributes& attrs);
131
132
137 void parseConnection(const SUMOSAXAttributes& attrs);
138
139
145 void parseStoppingPlace(const SUMOSAXAttributes& attrs, const SumoXMLTag element);
146
147
152 void parseAccess(const SUMOSAXAttributes& attrs);
153
154
164 void parseDistrict(const SUMOSAXAttributes& attrs);
165
166
178 void parseDistrictEdge(const SUMOSAXAttributes& attrs, bool isSource);
179
181
183 void setLocation(const SUMOSAXAttributes& attrs);
184
185protected:
188
191
194
197
199 std::string myCurrentName;
200
202 std::string myCurrentTypeID;
203
206
209
211 std::set<std::string> myUnseenNodeIDs;
212
214 const double myMinorPenalty;
215 const double myTLSPenalty;
217
219 std::map<ROEdge*, std::string> myBidiEdges;
220
221private:
224
227
228};
SumoXMLTag
Numbers representing SUMO-XML - element names.
std::pair< int, double > MMVersion
(M)ajor/(M)inor version for written networks and default version for loading
Definition StdDefs.h:67
A storage for options typed value containers)
Definition OptionsCont.h:89
Interface for building instances of router-edges.
A basic edge for routing applications.
Definition ROEdge.h:72
The handler that parses a SUMO-network for its usage in a router.
RONetHandler(const RONetHandler &src)
Invalidated copy constructor.
void parseAccess(const SUMOSAXAttributes &attrs)
const double myMinorPenalty
time penalty for passing a minor link
RONetHandler & operator=(const RONetHandler &src)
Invalidated assignment operator.
virtual void myEndElement(int element)
Called when a closing tag occurs.
MMVersion myNetworkVersion
the loaded network version
virtual ~RONetHandler()
Destructor.
void parseEdge(const SUMOSAXAttributes &attrs)
Parses and builds an edge.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
std::string myCurrentName
The name of the edge/node that is currently processed.
const double myTLSPenalty
void addParam(const SUMOSAXAttributes &attrs)
assign arbitrary vehicle parameters
ROEdge * myCurrentEdge
The currently built edge.
std::string myCurrentTypeID
The id of the currently processed edge type.
void parseStoppingPlace(const SUMOSAXAttributes &attrs, const SumoXMLTag element)
const bool myIgnoreInternal
whether to ignore junction internal edges
void parseConnection(const SUMOSAXAttributes &attrs)
std::map< ROEdge *, std::string > myBidiEdges
temporary storage for bidi attributes (to be resolved after loading all edges)
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
virtual void parseLane(const SUMOSAXAttributes &attrs)
Parses and builds a lane.
SUMOVehicleParameter::Stop * myCurrentStoppingPlace
The currently built stopping place.
RONet & myNet
The net to store the information into.
const std::map< ROEdge *, std::string > & getBidiMap() const
retrieve mapping of edges to bidi edges (must be resolved after loading network)
const double myTurnaroundPenalty
void parseDistrict(const SUMOSAXAttributes &attrs)
void parseJunction(const SUMOSAXAttributes &attrs)
Parses a junction's position.
void parseDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
std::set< std::string > myUnseenNodeIDs
temporary data for checking node initialisation after network parsing is finished
void setLocation(const SUMOSAXAttributes &attrs)
Parses network location description.
The router's network representation.
Definition RONet.h:63
Encapsulated SAX-Attributes.
SAX-handler base for SUMO-files.
Definition of vehicle stop (position and duration)