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 
RORouteDef * myCurrentAlternatives
The currently parsed route alternatives.
void parseGeoEdges(const PositionVector &positions, bool geo, ConstROEdgeVector &into, const std::string &rid)
Parse edges from coordinates.
void addTransport(const SUMOSAXAttributes &attrs)
Processing of a transport.
void addContainer(const SUMOSAXAttributes &attrs)
Processing of a container.
NamedRTree * getLaneTree()
initialize lane-RTree
long long int SUMOTime
Definition: SUMOTime.h:35
const bool myEmptyDestinationsAllowed
Information whether the "to" attribute is mandatory.
void closeVehicleTypeDistribution()
closes (ends) the building of a distribution
A single lane the router may use.
Definition: ROLane.h:51
void closePerson()
Ends the processing of a person.
void openRouteDistribution(const SUMOSAXAttributes &attrs)
opens a route distribution for reading
Represents a generic random distribution.
ConstROEdgeVector myActiveRoute
The current route.
void addWalk(const SUMOSAXAttributes &attrs)
add a fully specified walk
A RT-tree for efficient storing of SUMO&#39;s Named objects.
Definition: NamedRTree.h:64
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
RORouteHandler & operator=(const RORouteHandler &s)=delete
Invalidated assignment operator.
MsgHandler *const myErrorOutput
Depending on the "ignore-errors" option different outputs are used.
void closePersonFlow()
Ends the processing of a personFlow.
int myActiveContainerPlanSize
The number of stages in myActiveContainerPlan.
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:57
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
opens a type distribution for reading
const SUMOTime myBegin
The begin time.
void closeVehicle()
Ends the processing of a vehicle.
RandomDistributor< SUMOVTypeParameter * > * myCurrentVTypeDistribution
The currently parsed distribution of vehicle types (probability->vehicle type)
RONet & myNet
The current route.
ROPerson * myActivePerson
The plan of the current person.
Encapsulated SAX-Attributes.
void openFlow(const SUMOSAXAttributes &attrs)
opens a flow for reading
A list of positions.
void parseEdges(const std::string &desc, ConstROEdgeVector &into, const std::string &rid)
Parse edges from strings.
A person as used by router.
Definition: ROPerson.h:51
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
void closeTrip()
Ends the processing of a trip.
void closeVType()
Ends the processing of a vehicle type.
A basic edge for routing applications.
Definition: ROEdge.h:73
void addPerson(const SUMOSAXAttributes &attrs)
Processing of a person.
Parser for routes during their loading.
void closeContainer()
Ends the processing of a container.
void addFlowPerson(SUMOTime depart, const std::string &baseID, int i)
Processing of a person from a personFlow.
The router&#39;s network representation.
Definition: RONet.h:64
void addRide(const SUMOSAXAttributes &attrs)
Processing of a ride.
void openRoute(const SUMOSAXAttributes &attrs)
opens a route for reading
void openTrip(const SUMOSAXAttributes &attrs)
opens a trip for reading
const bool myKeepVTypeDist
whether to keep the the vtype distribution in output
const bool myTryRepair
Information whether routes shall be repaired.
OutputDevice_String * myActiveContainerPlan
The plan of the current container.
void addTranship(const SUMOSAXAttributes &attrs)
Processing of a tranship.
Parser and container for routes during their loading.
Base class for a vehicle&#39;s route definition.
Definition: RORouteDef.h:56
void closeRoute(const bool mayBeDisconnected=false)
closes (ends) the building of a route.
virtual ~RORouteHandler()
standard destructor
void addPersonTrip(const SUMOSAXAttributes &attrs)
add a routing request for a walking or intermodal person
NamedRTree * myLaneTree
RTree for finding lanes.
void closeFlow()
Ends the processing of a flow.
void parseFromViaTo(std::string element, const SUMOSAXAttributes &attrs)
Called for parsing from and to and the corresponding taz attributes.
A complete router&#39;s route.
Definition: RORoute.h:55
An output device that encapsulates an ofstream.
void closeRouteDistribution()
closes (ends) the building of a distribution
std::string myCurrentVTypeDistributionID
The id of the currently parsed vehicle type distribution.
RORouteHandler(RONet &net, const std::string &file, const bool tryRepair, const bool emptyDestinationsAllowed, const bool ignoreErrors, const bool checkSchema)
standard constructor