SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RORDGenerator_ODAmounts.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Class for loading trip amount definitions and route generation
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2012 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 RORDGenerator_ODAmounts_h
23 #define RORDGenerator_ODAmounts_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 <set>
40 #include "RORDLoader_TripDefs.h"
41 #include "RONet.h"
42 #include <utils/common/SUMOTime.h>
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
55 public:
58  SUMOTime begin, SUMOTime end, bool emptyDestinationsAllowed,
59  bool randomize, const std::string& file = "") ;
60 
63 
64 
72  bool readRoutesAtLeastUntil(SUMOTime until);
73 
74 
75 protected:
77 
78 
86  void myStartElement(int element,
87  const SUMOSAXAttributes& attrs) ;
88 
89 
96  void myEndElement(int element) ;
98 
100  void parseFlowAmountDef(const SUMOSAXAttributes& attrs) ;
101 
103  void myEndFlowAmountDef();
104 
109  class FlowDef {
110  public:
112  FlowDef(ROVehicle* vehicle, SUMOVTypeParameter* type, RORouteDef* route,
113  SUMOTime intBegin, SUMOTime intEnd,
114  unsigned int vehicles2insert, bool randomize);
115 
117  ~FlowDef();
118 
120  bool applicableForTime(SUMOTime time) const;
121 
123  void addRoutes(RONet& net, SUMOTime time);
124 
126  void addSingleRoute(RONet& net, SUMOTime time);
127 
129  SUMOTime getIntervalEnd() const;
130 
131  private:
134 
137 
140 
143 
146 
149 
151  unsigned int myInserted;
152 
154  std::vector<SUMOTime> myDepartures;
155 
157  bool myRandom;
158 
159  };
160 
161 private:
163  void buildForTimeStep(SUMOTime time) ;
164 
165 private:
168 
171 
174 
177 
180 
183 
185  typedef std::vector<FlowDef*> FlowDefV;
186 
189 
191  std::set<std::string> myKnownIDs;
192 
194  bool myRandom;
195 
196 
198 
199 private:
202 
205 
206 };
207 
208 
209 #endif
210 
211 /****************************************************************************/
212