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 
133 private:
148  unsigned int tryInsert(SUMOTime time, SUMOVehicle* veh,
149  MSVehicleContainer::VehicleVector& refusedEmits) ;
150 
151 
156  void checkFlowWait(SUMOVehicle* veh) ;
157 
158 
164  void checkPrevious(SUMOTime time) ;
165 
166 
173  unsigned int checkFlows(SUMOTime time,
174  MSVehicleContainer::VehicleVector& refusedEmits) ;
175 
176 
177 private:
180 
183 
186 
190  struct Flow {
197  };
198 
200  std::vector<Flow> myFlows;
201 
204 
207 
208 
209 private:
212 
215 
216 
217 };
218 
219 
220 #endif
221 
222 /****************************************************************************/
223