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 /****************************************************************************/
9 // Inserts vehicles into the network when their departure time is reached
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 MSInsertionControl_h
23 #define MSInsertionControl_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 "MSVehicleContainer.h"
36 #include <vector>
37 #include <map>
38 #include <string>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class MSVehicle;
45 class MSVehicleControl;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
67 public:
74  MSInsertionControl(MSVehicleControl& vc, SUMOTime maxDepartDelay, bool checkEdgesOnce);
75 
76 
79 
80 
97  unsigned int emitVehicles(SUMOTime time);
98 
99 
106  void add(SUMOVehicle* veh);
107 
108 
113  void add(SUMOVehicleParameter* pars);
114 
115 
123  unsigned int getWaitingVehicleNo() const;
124 
125 
130  int getPendingFlowCount() const;
131 
132 
134  void descheduleDeparture(SUMOVehicle* veh);
135 
136 
137 private:
152  unsigned int tryInsert(SUMOTime time, SUMOVehicle* veh,
153  MSVehicleContainer::VehicleVector& refusedEmits);
154 
155 
160  void checkFlowWait(SUMOVehicle* veh);
161 
162 
168  void checkPrevious(SUMOTime time);
169 
170 
177  unsigned int checkFlows(SUMOTime time,
178  MSVehicleContainer::VehicleVector& refusedEmits);
179 
180 
181 private:
184 
187 
190 
192  std::set<SUMOVehicle*> myAbortedEmits;
193 
197  struct Flow {
204  };
205 
207  std::vector<Flow> myFlows;
208 
211 
214 
215 
216 private:
219 
222 
223 
224 };
225 
226 
227 #endif
228 
229 /****************************************************************************/
230