SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MSRouteHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Parser and container for routes during their loading
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSRouteHandler_h
23 #define MSRouteHandler_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
37 #include "MSContainer.h"
38 #include "MSVehicle.h"
40 #include <utils/common/SUMOTime.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class MSEdge;
47 class MSVehicleType;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
62 public:
64  MSRouteHandler(const std::string& file,
65  bool addVehiclesDirectly);
66 
68  virtual ~MSRouteHandler();
69 
70  static MTRand* getParsingRNG() {
71  return &myParsingRNG;
72  }
73 
74 protected:
76 
77 
85  virtual void myStartElement(int element,
86  const SUMOSAXAttributes& attrs);
87 
88 
95  virtual void myEndElement(int element);
97 
98 
105  void parseFromViaTo(std::string element,
106  const SUMOSAXAttributes& attrs);
107 
108 
111 
114 
116  void openRoute(const SUMOSAXAttributes& attrs);
117 
123  void closeRoute(const bool mayBeDisconnected = false);
124 
126  void openRouteDistribution(const SUMOSAXAttributes& attrs);
127 
129  void closeRouteDistribution();
130 
132  void closeVehicle();
133 
135  void closePerson();
136 
138  void closeContainer();
139 
141  void closeFlow();
142 
144  void addStop(const SUMOSAXAttributes& attrs);
145 
146 protected:
149 
152 
155 
158 
161 
164 
167 
170 
173 
174 private:
176  MSRouteHandler(const MSRouteHandler& s);
177 
180 
181 };
182 
183 
184 #endif
185 
186 /****************************************************************************/
187 
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
MSRouteHandler(const std::string &file, bool addVehiclesDirectly)
standard constructor
ConstMSEdgeVector myActiveRoute
The current route.
void parseFromViaTo(std::string element, const SUMOSAXAttributes &attrs)
Called for parsing from and to and the corresponding taz attributes.
RandomDistributor< const MSRoute * > * myCurrentRouteDistribution
The currently parsed distribution of routes (probability->route)
MSPerson::MSPersonPlan * myActivePlan
The plan of the current person.
void closeVehicle()
Ends the processing of a vehicle.
static MTRand myParsingRNG
A random number generator used to choose from vtype/route distributions and computing the speed facto...
bool myAddVehiclesDirectly
Information whether vehicles shall be directly added to the network or kept within the buffer...
static MTRand * getParsingRNG()
void closePerson()
Ends the processing of a person.
void openRoute(const SUMOSAXAttributes &attrs)
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:79
The car-following model and parameter.
Definition: MSVehicleType.h:74
A road/street connecting two junctions.
Definition: MSEdge.h:81
RandomDistributor< MSVehicleType * > * myCurrentVTypeDistribution
The currently parsed distribution of vehicle types (probability->vehicle type)
void closeRouteDistribution()
Encapsulated SAX-Attributes.
void closeContainer()
Ends the processing of a container.
void closeVehicleTypeDistribution()
MSContainer::MSContainerPlan * myActiveContainerPlan
The plan of the current container.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
std::vector< MSContainerStage * > MSContainerPlan
the structure holding the plan of a container
Definition: MSContainer.h:553
Parser for routes during their loading.
std::string myCurrentRouteDistributionID
The id of the currently parsed route distribution.
void openRouteDistribution(const SUMOSAXAttributes &attrs)
virtual void myEndElement(int element)
Called when a closing tag occurs.
std::string myCurrentVTypeDistributionID
The id of the currently parsed vehicle type distribution.
MSRouteHandler & operator=(const MSRouteHandler &s)
Invalidated assignment operator.
virtual ~MSRouteHandler()
standard destructor
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
std::vector< MSPersonStage * > MSPersonPlan
the structure holding the plan of a person
Definition: MSPerson.h:514
void closeRoute(const bool mayBeDisconnected=false)
Parser and container for routes during their loading.
void closeFlow()
Ends the processing of a flow.