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-2018 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>
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);
84 
85 
92  virtual void myEndElement(int element);
94 
95 
102  void parseFromViaTo(std::string element,
103  const SUMOSAXAttributes& attrs);
104 
105 
108 
111 
113  void openRoute(const SUMOSAXAttributes& attrs);
114 
120  void closeRoute(const bool mayBeDisconnected = false);
121 
123  void openRouteDistribution(const SUMOSAXAttributes& attrs);
124 
126  void closeRouteDistribution();
127 
129  void closeVehicle();
130 
132  void closePerson();
133 
135  void closeContainer();
136 
138  void closeFlow();
139 
141  void addStop(const SUMOSAXAttributes& attrs);
142 
144  void parseEdges(const std::string& desc, ConstROEdgeVector& into,
145  const std::string& rid);
146 
148  void addPersonTrip(const SUMOSAXAttributes& attrs);
149 
151  void addWalk(const SUMOSAXAttributes& attrs);
152 
153 protected:
156 
159 
162 
165 
168 
170  const bool myTryRepair;
171 
174 
177 
180 
182  const bool myKeepVTypeDist;
183 
186 
189 
192 
193 private:
195  RORouteHandler(const RORouteHandler& s);
196 
199 
200 };
201 
202 
203 #endif
204 
205 /****************************************************************************/
206 
RORouteDef * myCurrentAlternatives
The currently parsed route alternatives.
long long int SUMOTime
Definition: SUMOTime.h:36
const bool myEmptyDestinationsAllowed
Information whether the "to" attribute is mandatory.
void closeVehicleTypeDistribution()
A single lane the router may use.
Definition: ROLane.h:50
void closePerson()
Ends the processing of a person.
void openRouteDistribution(const SUMOSAXAttributes &attrs)
Represents a generic random distribution.
ConstROEdgeVector myActiveRoute
The current route.
void addWalk(const SUMOSAXAttributes &attrs)
add a fully specified walk
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
MsgHandler *const myErrorOutput
Depending on the "ignore-errors" option different outputs are used.
virtual void myEndElement(int element)
Called when a closing tag occurs.
int myActiveContainerPlanSize
The number of stages in myActiveContainerPlan.
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:56
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
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 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.
RORouteHandler & operator=(const RORouteHandler &s)
Invalidated assignment operator.
A basic edge for routing applications.
Definition: ROEdge.h:72
Parser for routes during their loading.
void closeContainer()
Ends the processing of a container.
The router&#39;s network representation.
Definition: RONet.h:68
void openRoute(const SUMOSAXAttributes &attrs)
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.
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)
virtual ~RORouteHandler()
standard destructor
void addPersonTrip(const SUMOSAXAttributes &attrs)
add a routing request for a walking or intermodal person
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()
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