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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Parser and container for routes during their loading
20 /****************************************************************************/
21 #ifndef RORouteHandler_h
22 #define RORouteHandler_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <vector>
37 #include <utils/common/SUMOTime.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
46 class ROEdge;
47 class ROLane;
48 class RONet;
49 class ROPerson;
50 class RORoute;
51 class RORouteDef;
52 
53 
54 // ===========================================================================
55 // class definitions
56 // ===========================================================================
66 public:
68  RORouteHandler(RONet& net, const std::string& file,
69  const bool tryRepair,
70  const bool emptyDestinationsAllowed,
71  const bool ignoreErrors);
72 
74  virtual ~RORouteHandler();
75 
76 protected:
78 
79 
87  virtual void myStartElement(int element,
88  const SUMOSAXAttributes& attrs);
89 
90 
97  virtual void myEndElement(int element);
99 
100 
107  void parseFromViaTo(std::string element,
108  const SUMOSAXAttributes& attrs);
109 
110 
113 
116 
118  void openRoute(const SUMOSAXAttributes& attrs);
119 
125  void closeRoute(const bool mayBeDisconnected = false);
126 
128  void openRouteDistribution(const SUMOSAXAttributes& attrs);
129 
131  void closeRouteDistribution();
132 
134  void closeVehicle();
135 
137  void closePerson();
138 
140  void closeContainer();
141 
143  void closeFlow();
144 
146  void addStop(const SUMOSAXAttributes& attrs);
147 
149  void parseEdges(const std::string& desc, ConstROEdgeVector& into,
150  const std::string& rid);
151 
153  void addPersonTrip(const SUMOSAXAttributes& attrs);
154 
156  void addWalk(const SUMOSAXAttributes& attrs);
157 
158 protected:
161 
164 
167 
170 
173 
175  const bool myTryRepair;
176 
179 
182 
185 
187  const bool myKeepVTypeDist;
188 
191 
194 
197 
198 private:
200  RORouteHandler(const RORouteHandler& s);
201 
204 
205 };
206 
207 
208 #endif
209 
210 /****************************************************************************/
211 
RORouteDef * myCurrentAlternatives
The currently parsed route alternatives.
const bool myEmptyDestinationsAllowed
Information whether the "to" attribute is mandatory.
void closeVehicleTypeDistribution()
A single lane the router may use.
Definition: ROLane.h:56
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:62
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)
RORouteHandler(RONet &net, const std::string &file, const bool tryRepair, const bool emptyDestinationsAllowed, const bool ignoreErrors)
standard constructor
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:57
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:77
Parser for routes during their loading.
void closeContainer()
Ends the processing of a container.
The router&#39;s network representation.
Definition: RONet.h:74
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:62
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
long long int SUMOTime
Definition: TraCIDefs.h:51
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:61
An output device that encapsulates an ofstream.
void closeRouteDistribution()
std::string myCurrentVTypeDistributionID
The id of the currently parsed vehicle type distribution.