SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSInsertionControl.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Inserts vehicles into the network when their departure time is reached
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef MSInsertionControl_h
24 #define MSInsertionControl_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include "MSVehicleContainer.h"
37 #include <vector>
38 #include <map>
39 #include <string>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class MSVehicle;
46 class MSVehicleControl;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
68 public:
75  MSInsertionControl(MSVehicleControl& vc, SUMOTime maxDepartDelay, bool checkEdgesOnce);
76 
77 
80 
81 
98  unsigned int emitVehicles(SUMOTime time);
99 
100 
107  void add(SUMOVehicle* veh);
108 
109 
114  void add(SUMOVehicleParameter* pars);
115 
116 
124  unsigned int getWaitingVehicleNo() const;
125 
126 
131  int getPendingFlowCount() const;
132 
133 
135  void descheduleDeparture(SUMOVehicle* veh);
136 
137 
139  void clearPendingVehicles(std::string& route);
140 
141 
142 private:
157  unsigned int tryInsert(SUMOTime time, SUMOVehicle* veh,
158  MSVehicleContainer::VehicleVector& refusedEmits);
159 
160 
165  void checkFlowWait(SUMOVehicle* veh);
166 
167 
173  void checkPrevious(SUMOTime time);
174 
175 
182  unsigned int checkFlows(SUMOTime time,
183  MSVehicleContainer::VehicleVector& refusedEmits);
184 
185 
186 private:
189 
192 
195 
197  std::set<SUMOVehicle*> myAbortedEmits;
198 
202  struct Flow {
210  unsigned int index;
211  };
212 
214  std::vector<Flow> myFlows;
215 
218 
221 
222 
223 private:
226 
229 
230 
231 };
232 
233 
234 #endif
235 
236 /****************************************************************************/
237