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 /****************************************************************************/
17 // Parser and container for routes during their loading
18 /****************************************************************************/
19 #ifndef RORouteHandler_h
20 #define RORouteHandler_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
29 #include <vector>
31 #include <utils/common/SUMOTime.h>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
41 class ROEdge;
42 class ROLane;
43 class RONet;
44 class ROPerson;
45 class RORoute;
46 class RORouteDef;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
61 public:
63  RORouteHandler(RONet& net, const std::string& file,
64  const bool tryRepair,
65  const bool emptyDestinationsAllowed,
66  const bool ignoreErrors,
67  const bool checkSchema);
68 
70  virtual ~RORouteHandler();
71 
72 protected:
74 
75 
83  virtual void myStartElement(int element,
84  const SUMOSAXAttributes& attrs);
86 
93  void parseFromViaTo(std::string element,
94  const SUMOSAXAttributes& attrs);
95 
98 
101 
103  void openRoute(const SUMOSAXAttributes& attrs);
104 
106  void openFlow(const SUMOSAXAttributes& attrs);
107 
109  void openTrip(const SUMOSAXAttributes& attrs);
110 
117  void closeRoute(const bool mayBeDisconnected = false);
118 
120  void openRouteDistribution(const SUMOSAXAttributes& attrs);
121 
123  void closeRouteDistribution();
124 
126  void closeVehicle();
127 
129  void closeVType();
130 
132  void closePerson();
133 
135  void closePersonFlow();
136 
138  void closeContainer();
139 
141  void closeFlow();
142 
144  void closeTrip();
145 
147  void addStop(const SUMOSAXAttributes& attrs);
148 
150  void addPerson(const SUMOSAXAttributes& attrs);
151 
153  void addFlowPerson(SUMOTime depart, const std::string& baseID, int i);
154 
156  void addContainer(const SUMOSAXAttributes& attrs);
157 
159  void addRide(const SUMOSAXAttributes& attrs);
160 
162  void addTransport(const SUMOSAXAttributes& attrs);
163 
165  void addTranship(const SUMOSAXAttributes& attrs);
166 
168  void parseEdges(const std::string& desc, ConstROEdgeVector& into,
169  const std::string& rid);
170 
172  void parseGeoEdges(const PositionVector& positions, bool geo,
173  ConstROEdgeVector& into, const std::string& rid);
174 
176  void addPersonTrip(const SUMOSAXAttributes& attrs);
177 
179  void addWalk(const SUMOSAXAttributes& attrs);
180 
183 
184 protected:
187 
190 
193 
196 
199 
201  const bool myTryRepair;
202 
205 
208 
211 
213  const bool myKeepVTypeDist;
214 
217 
220 
223 
226 
227 private:
229  RORouteHandler(const RORouteHandler& s) = delete;
230 
232  RORouteHandler& operator=(const RORouteHandler& s) = delete;
233 };
234 
235 
236 #endif
237 
238 /****************************************************************************/
239 
RORouteHandler::myLaneTree
NamedRTree * myLaneTree
RTree for finding lanes.
Definition: RORouteHandler.h:225
RORouteHandler::openRoute
void openRoute(const SUMOSAXAttributes &attrs)
opens a route for reading
Definition: RORouteHandler.cpp:281
RORouteHandler::addContainer
void addContainer(const SUMOSAXAttributes &attrs)
Processing of a container.
Definition: RORouteHandler.cpp:751
SUMOTime.h
OutputDevice_String
An output device that encapsulates an ofstream.
Definition: OutputDevice_String.h:40
RORouteHandler::parseFromViaTo
void parseFromViaTo(std::string element, const SUMOSAXAttributes &attrs)
Called for parsing from and to and the corresponding taz attributes.
Definition: RORouteHandler.cpp:81
RORouteHandler::myActiveContainerPlanSize
int myActiveContainerPlanSize
The number of stages in myActiveContainerPlan.
Definition: RORouteHandler.h:198
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
RORouteHandler::addPersonTrip
void addPersonTrip(const SUMOSAXAttributes &attrs)
add a routing request for a walking or intermodal person
Definition: RORouteHandler.cpp:846
ROLane
A single lane the router may use.
Definition: ROLane.h:51
RORouteDef
Base class for a vehicle's route definition.
Definition: RORouteDef.h:56
RONet
The router's network representation.
Definition: RONet.h:64
ROPerson
A person as used by router.
Definition: ROPerson.h:51
NamedRTree.h
RORouteHandler::closePersonFlow
void closePersonFlow()
Ends the processing of a personFlow.
Definition: RORouteHandler.cpp:535
PositionVector
A list of positions.
Definition: PositionVector.h:46
RORouteHandler
Parser and container for routes during their loading.
Definition: RORouteHandler.h:60
RORouteHandler::myCurrentVTypeDistribution
RandomDistributor< SUMOVTypeParameter * > * myCurrentVTypeDistribution
The currently parsed distribution of vehicle types (probability->vehicle type)
Definition: RORouteHandler.h:216
RORouteHandler::addRide
void addRide(const SUMOSAXAttributes &attrs)
Processing of a ride.
Definition: RORouteHandler.cpp:756
RORouteHandler::openTrip
void openTrip(const SUMOSAXAttributes &attrs)
opens a trip for reading
Definition: RORouteHandler.cpp:338
RORouteHandler::addWalk
void addWalk(const SUMOSAXAttributes &attrs)
add a fully specified walk
Definition: RORouteHandler.cpp:919
RORouteHandler::getLaneTree
NamedRTree * getLaneTree()
initialize lane-RTree
Definition: RORouteHandler.cpp:959
RandomDistributor.h
RORouteHandler::parseGeoEdges
void parseGeoEdges(const PositionVector &positions, bool geo, ConstROEdgeVector &into, const std::string &rid)
Parse edges from coordinates.
Definition: RORouteHandler.cpp:792
RORouteHandler::addTransport
void addTransport(const SUMOSAXAttributes &attrs)
Processing of a transport.
Definition: RORouteHandler.cpp:761
MsgHandler
Definition: MsgHandler.h:44
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:587
RORoute
A complete router's route.
Definition: RORoute.h:55
RORouteHandler::myStartElement
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: RORouteHandler.cpp:147
RORouteHandler::myTryRepair
const bool myTryRepair
Information whether routes shall be repaired.
Definition: RORouteHandler.h:201
RORouteHandler::myBegin
const SUMOTime myBegin
The begin time.
Definition: RORouteHandler.h:210
RandomDistributor< SUMOVTypeParameter * >
RORouteHandler::myCurrentVTypeDistributionID
std::string myCurrentVTypeDistributionID
The id of the currently parsed vehicle type distribution.
Definition: RORouteHandler.h:219
RORouteHandler::closeFlow
void closeFlow()
Ends the processing of a flow.
Definition: RORouteHandler.cpp:604
RORouteHandler::parseEdges
void parseEdges(const std::string &desc, ConstROEdgeVector &into, const std::string &rid)
Parse edges from strings.
Definition: RORouteHandler.cpp:771
RORouteHandler::myErrorOutput
MsgHandler *const myErrorOutput
Depending on the "ignore-errors" option different outputs are used.
Definition: RORouteHandler.h:207
RORouteHandler::~RORouteHandler
virtual ~RORouteHandler()
standard destructor
Definition: RORouteHandler.cpp:76
RORouteHandler::closePerson
void closePerson()
Ends the processing of a person.
Definition: RORouteHandler.cpp:520
RORouteHandler::closeTrip
void closeTrip()
Ends the processing of a trip.
Definition: RORouteHandler.cpp:650
RORouteHandler::myActiveRoute
ConstROEdgeVector myActiveRoute
The current route.
Definition: RORouteHandler.h:189
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:54
SUMORouteHandler.h
RORouteHandler::openVehicleTypeDistribution
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
opens a type distribution for reading
Definition: RORouteHandler.cpp:243
RORouteHandler::addStop
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
Definition: RORouteHandler.cpp:657
RORouteHandler::myEmptyDestinationsAllowed
const bool myEmptyDestinationsAllowed
Information whether the "to" attribute is mandatory.
Definition: RORouteHandler.h:204
RORouteHandler::closeVehicleTypeDistribution
void closeVehicleTypeDistribution()
closes (ends) the building of a distribution
Definition: RORouteHandler.cpp:266
RORouteHandler::openFlow
void openFlow(const SUMOSAXAttributes &attrs)
opens a flow for reading
Definition: RORouteHandler.cpp:332
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:73
NamedRTree
A RT-tree for efficient storing of SUMO's Named objects.
Definition: NamedRTree.h:64
RORouteHandler::myNet
RONet & myNet
The current route.
Definition: RORouteHandler.h:186
SUMORouteHandler
Parser for routes during their loading.
Definition: SUMORouteHandler.h:51
RORouteHandler::myCurrentAlternatives
RORouteDef * myCurrentAlternatives
The currently parsed route alternatives.
Definition: RORouteHandler.h:222
config.h
RORouteHandler::closeVType
void closeVType()
Ends the processing of a vehicle type.
Definition: RORouteHandler.cpp:509
RORouteHandler::closeRoute
void closeRoute(const bool mayBeDisconnected=false)
closes (ends) the building of a route.
Definition: RORouteHandler.cpp:344
RORouteHandler::closeVehicle
void closeVehicle()
Ends the processing of a vehicle.
Definition: RORouteHandler.cpp:470
RORouteHandler::addTranship
void addTranship(const SUMOSAXAttributes &attrs)
Processing of a tranship.
Definition: RORouteHandler.cpp:766
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:57
RORouteHandler::addFlowPerson
void addFlowPerson(SUMOTime depart, const std::string &baseID, int i)
Processing of a person from a personFlow.
Definition: RORouteHandler.cpp:567
RORouteHandler::myActiveContainerPlan
OutputDevice_String * myActiveContainerPlan
The plan of the current container.
Definition: RORouteHandler.h:195
RORouteHandler::openRouteDistribution
void openRouteDistribution(const SUMOSAXAttributes &attrs)
opens a route distribution for reading
Definition: RORouteHandler.cpp:413
RORouteHandler::myKeepVTypeDist
const bool myKeepVTypeDist
whether to keep the the vtype distribution in output
Definition: RORouteHandler.h:213
RORouteHandler::myActivePerson
ROPerson * myActivePerson
The plan of the current person.
Definition: RORouteHandler.h:192
ConstROEdgeVector
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:57
RORouteHandler::closeRouteDistribution
void closeRouteDistribution()
closes (ends) the building of a distribution
Definition: RORouteHandler.cpp:455
RORouteHandler::addPerson
void addPerson(const SUMOSAXAttributes &attrs)
Processing of a person.
Definition: RORouteHandler.cpp:746