Eclipse SUMO - Simulation of Urban MObility
RORouteHandler.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 /****************************************************************************/
16 // Parser and container for routes during their loading
17 /****************************************************************************/
18 #ifndef RORouteHandler_h
19 #define RORouteHandler_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <vector>
30 #include <utils/common/SUMOTime.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
40 class ROEdge;
41 class ROLane;
42 class RONet;
43 class ROPerson;
44 class RORoute;
45 class RORouteDef;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
60 public:
62  RORouteHandler(RONet& net, const std::string& file,
63  const bool tryRepair,
64  const bool emptyDestinationsAllowed,
65  const bool ignoreErrors,
66  const bool checkSchema);
67 
69  virtual ~RORouteHandler();
70 
71 protected:
73 
74 
82  virtual void myStartElement(int element,
83  const SUMOSAXAttributes& attrs);
85 
92  void parseFromViaTo(std::string element,
93  const SUMOSAXAttributes& attrs);
94 
97 
100 
102  void openRoute(const SUMOSAXAttributes& attrs);
103 
105  void openFlow(const SUMOSAXAttributes& attrs);
106 
108  void openTrip(const SUMOSAXAttributes& attrs);
109 
116  void closeRoute(const bool mayBeDisconnected = false);
117 
119  void openRouteDistribution(const SUMOSAXAttributes& attrs);
120 
122  void closeRouteDistribution();
123 
125  void closeVehicle();
126 
128  void closeVType();
129 
131  void closePerson();
132 
134  void closePersonFlow();
135 
137  void closeContainer();
138 
140  void closeFlow();
141 
143  void closeTrip();
144 
146  void addStop(const SUMOSAXAttributes& attrs);
147 
149  void addPerson(const SUMOSAXAttributes& attrs);
150 
152  void addFlowPerson(SUMOTime depart, const std::string& baseID, int i);
153 
155  void addContainer(const SUMOSAXAttributes& attrs);
156 
158  void addRide(const SUMOSAXAttributes& attrs);
159 
161  void addTransport(const SUMOSAXAttributes& attrs);
162 
164  void addTranship(const SUMOSAXAttributes& attrs);
165 
167  void parseEdges(const std::string& desc, ConstROEdgeVector& into,
168  const std::string& rid);
169 
171  void parseGeoEdges(const PositionVector& positions, bool geo,
172  ConstROEdgeVector& into, const std::string& rid);
173 
175  void addPersonTrip(const SUMOSAXAttributes& attrs);
176 
178  void addWalk(const SUMOSAXAttributes& attrs);
179 
182 
183 protected:
186 
189 
192 
195 
198 
200  const bool myTryRepair;
201 
204 
207 
210 
212  const bool myKeepVTypeDist;
213 
216 
219 
222 
225 
226 private:
228  RORouteHandler(const RORouteHandler& s) = delete;
229 
232 };
233 
234 
235 #endif
236 
237 /****************************************************************************/
238 
RORouteHandler::myLaneTree
NamedRTree * myLaneTree
RTree for finding lanes.
Definition: RORouteHandler.h:224
RORouteHandler::openRoute
void openRoute(const SUMOSAXAttributes &attrs)
opens a route for reading
Definition: RORouteHandler.cpp:280
RORouteHandler::addContainer
void addContainer(const SUMOSAXAttributes &attrs)
Processing of a container.
Definition: RORouteHandler.cpp:754
SUMOTime.h
OutputDevice_String
An output device that encapsulates an ofstream.
Definition: OutputDevice_String.h:39
RORouteHandler::parseFromViaTo
void parseFromViaTo(std::string element, const SUMOSAXAttributes &attrs)
Called for parsing from and to and the corresponding taz attributes.
Definition: RORouteHandler.cpp:80
RORouteHandler::myActiveContainerPlanSize
int myActiveContainerPlanSize
The number of stages in myActiveContainerPlan.
Definition: RORouteHandler.h:197
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
RORouteHandler::addPersonTrip
void addPersonTrip(const SUMOSAXAttributes &attrs)
add a routing request for a walking or intermodal person
Definition: RORouteHandler.cpp:849
ROLane
A single lane the router may use.
Definition: ROLane.h:50
RORouteDef
Base class for a vehicle's route definition.
Definition: RORouteDef.h:55
RONet
The router's network representation.
Definition: RONet.h:63
ROPerson
A person as used by router.
Definition: ROPerson.h:50
NamedRTree.h
RORouteHandler::closePersonFlow
void closePersonFlow()
Ends the processing of a personFlow.
Definition: RORouteHandler.cpp:538
PositionVector
A list of positions.
Definition: PositionVector.h:45
RORouteHandler
Parser and container for routes during their loading.
Definition: RORouteHandler.h:59
RORouteHandler::myCurrentVTypeDistribution
RandomDistributor< SUMOVTypeParameter * > * myCurrentVTypeDistribution
The currently parsed distribution of vehicle types (probability->vehicle type)
Definition: RORouteHandler.h:215
RORouteHandler::addRide
void addRide(const SUMOSAXAttributes &attrs)
Processing of a ride.
Definition: RORouteHandler.cpp:759
RORouteHandler::openTrip
void openTrip(const SUMOSAXAttributes &attrs)
opens a trip for reading
Definition: RORouteHandler.cpp:337
RORouteHandler::addWalk
void addWalk(const SUMOSAXAttributes &attrs)
add a fully specified walk
Definition: RORouteHandler.cpp:922
RORouteHandler::getLaneTree
NamedRTree * getLaneTree()
initialize lane-RTree
Definition: RORouteHandler.cpp:962
RandomDistributor.h
RORouteHandler::parseGeoEdges
void parseGeoEdges(const PositionVector &positions, bool geo, ConstROEdgeVector &into, const std::string &rid)
Parse edges from coordinates.
Definition: RORouteHandler.cpp:795
RORouteHandler::addTransport
void addTransport(const SUMOSAXAttributes &attrs)
Processing of a transport.
Definition: RORouteHandler.cpp:764
MsgHandler
Definition: MsgHandler.h:38
PedestrianRouter.h
RORouteHandler::operator=
RORouteHandler & operator=(const RORouteHandler &s)=delete
Invalidated assignment operator.
RORouteHandler::closeContainer
void closeContainer()
Ends the processing of a container.
Definition: RORouteHandler.cpp:590
RORoute
A complete router's route.
Definition: RORoute.h:54
RORouteHandler::myStartElement
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: RORouteHandler.cpp:146
RORouteHandler::myTryRepair
const bool myTryRepair
Information whether routes shall be repaired.
Definition: RORouteHandler.h:200
RORouteHandler::myBegin
const SUMOTime myBegin
The begin time.
Definition: RORouteHandler.h:209
RandomDistributor< SUMOVTypeParameter * >
RORouteHandler::myCurrentVTypeDistributionID
std::string myCurrentVTypeDistributionID
The id of the currently parsed vehicle type distribution.
Definition: RORouteHandler.h:218
RORouteHandler::closeFlow
void closeFlow()
Ends the processing of a flow.
Definition: RORouteHandler.cpp:607
RORouteHandler::parseEdges
void parseEdges(const std::string &desc, ConstROEdgeVector &into, const std::string &rid)
Parse edges from strings.
Definition: RORouteHandler.cpp:774
RORouteHandler::myErrorOutput
MsgHandler *const myErrorOutput
Depending on the "ignore-errors" option different outputs are used.
Definition: RORouteHandler.h:206
RORouteHandler::~RORouteHandler
virtual ~RORouteHandler()
standard destructor
Definition: RORouteHandler.cpp:75
RORouteHandler::closePerson
void closePerson()
Ends the processing of a person.
Definition: RORouteHandler.cpp:523
RORouteHandler::closeTrip
void closeTrip()
Ends the processing of a trip.
Definition: RORouteHandler.cpp:653
RORouteHandler::myActiveRoute
ConstROEdgeVector myActiveRoute
The current route.
Definition: RORouteHandler.h:188
RORouteHandler::RORouteHandler
RORouteHandler(RONet &net, const std::string &file, const bool tryRepair, const bool emptyDestinationsAllowed, const bool ignoreErrors, const bool checkSchema)
standard constructor
Definition: RORouteHandler.cpp:53
SUMORouteHandler.h
RORouteHandler::openVehicleTypeDistribution
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
opens a type distribution for reading
Definition: RORouteHandler.cpp:242
RORouteHandler::addStop
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
Definition: RORouteHandler.cpp:660
RORouteHandler::myEmptyDestinationsAllowed
const bool myEmptyDestinationsAllowed
Information whether the "to" attribute is mandatory.
Definition: RORouteHandler.h:203
RORouteHandler::closeVehicleTypeDistribution
void closeVehicleTypeDistribution()
closes (ends) the building of a distribution
Definition: RORouteHandler.cpp:265
RORouteHandler::openFlow
void openFlow(const SUMOSAXAttributes &attrs)
opens a flow for reading
Definition: RORouteHandler.cpp:331
RORouteHandler::RORouteHandler
RORouteHandler(const RORouteHandler &s)=delete
Invalidated copy constructor.
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:72
NamedRTree
A RT-tree for efficient storing of SUMO's Named objects.
Definition: NamedRTree.h:63
RORouteHandler::myNet
RONet & myNet
The current route.
Definition: RORouteHandler.h:185
SUMORouteHandler
Parser for routes during their loading.
Definition: SUMORouteHandler.h:50
RORouteHandler::myCurrentAlternatives
RORouteDef * myCurrentAlternatives
The currently parsed route alternatives.
Definition: RORouteHandler.h:221
config.h
RORouteHandler::closeVType
void closeVType()
Ends the processing of a vehicle type.
Definition: RORouteHandler.cpp:508
RORouteHandler::closeRoute
void closeRoute(const bool mayBeDisconnected=false)
closes (ends) the building of a route.
Definition: RORouteHandler.cpp:343
RORouteHandler::closeVehicle
void closeVehicle()
Ends the processing of a vehicle.
Definition: RORouteHandler.cpp:469
RORouteHandler::addTranship
void addTranship(const SUMOSAXAttributes &attrs)
Processing of a tranship.
Definition: RORouteHandler.cpp:769
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:56
RORouteHandler::addFlowPerson
void addFlowPerson(SUMOTime depart, const std::string &baseID, int i)
Processing of a person from a personFlow.
Definition: RORouteHandler.cpp:570
RORouteHandler::myActiveContainerPlan
OutputDevice_String * myActiveContainerPlan
The plan of the current container.
Definition: RORouteHandler.h:194
RORouteHandler::openRouteDistribution
void openRouteDistribution(const SUMOSAXAttributes &attrs)
opens a route distribution for reading
Definition: RORouteHandler.cpp:412
RORouteHandler::myKeepVTypeDist
const bool myKeepVTypeDist
whether to keep the the vtype distribution in output
Definition: RORouteHandler.h:212
RORouteHandler::myActivePerson
ROPerson * myActivePerson
The plan of the current person.
Definition: RORouteHandler.h:191
ConstROEdgeVector
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:56
RORouteHandler::closeRouteDistribution
void closeRouteDistribution()
closes (ends) the building of a distribution
Definition: RORouteHandler.cpp:454
RORouteHandler::addPerson
void addPerson(const SUMOSAXAttributes &attrs)
Processing of a person.
Definition: RORouteHandler.cpp:749