SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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-2014 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>
36 #include "MSPerson.h"
37 #include "MSVehicle.h"
39 #include <utils/common/SUMOTime.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class MSEdge;
46 class MSVehicleType;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
61 public:
63  MSRouteHandler(const std::string& file,
64  bool addVehiclesDirectly);
65 
67  virtual ~MSRouteHandler();
68 
69  static MTRand* getParsingRNG() {
70  return &myParsingRNG;
71  }
72 
73 protected:
75 
76 
84  virtual void myStartElement(int element,
85  const SUMOSAXAttributes& attrs);
86 
87 
94  virtual void myEndElement(int element);
96 
97 
100 
103 
105  void openRoute(const SUMOSAXAttributes& attrs);
106 
112  void closeRoute(const bool mayBeDisconnected = false);
113 
115  void openRouteDistribution(const SUMOSAXAttributes& attrs);
116 
118  void closeRouteDistribution();
119 
121  void closeVehicle();
122 
124  void closePerson();
125 
127  void closeFlow();
128 
130  void addStop(const SUMOSAXAttributes& attrs);
131 
132 protected:
135 
138 
141 
144 
147 
150 
153 
156 
157 private:
159  MSRouteHandler(const MSRouteHandler& s);
160 
163 
164 };
165 
166 
167 #endif
168 
169 /****************************************************************************/
170 
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
MSRouteHandler(const std::string &file, bool addVehiclesDirectly)
standard constructor
RandomDistributor< const MSRoute * > * myCurrentRouteDistribution
The currently parsed distribution of routes (probability-&gt;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)
MSEdgeVector myActiveRoute
The current route.
The car-following model and parameter.
Definition: MSVehicleType.h:74
A road/street connecting two junctions.
Definition: MSEdge.h:75
RandomDistributor< MSVehicleType * > * myCurrentVTypeDistribution
The currently parsed distribution of vehicle types (probability-&gt;vehicle type)
void closeRouteDistribution()
Encapsulated SAX-Attributes.
std::vector< const MSEdge * > MSEdgeVector
Definition: MSPerson.h:57
void closeVehicleTypeDistribution()
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
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:515
void closeRoute(const bool mayBeDisconnected=false)
Parser and container for routes during their loading.
void closeFlow()
Ends the processing of a flow.