00001 /****************************************************************************/ 00007 // A mover of vehicles that got stucked due to grid locks 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This program is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 /****************************************************************************/ 00019 #ifndef MSVehicleTransfer_h 00020 #define MSVehicleTransfer_h 00021 00022 00023 // =========================================================================== 00024 // included modules 00025 // =========================================================================== 00026 #ifdef _MSC_VER 00027 #include <windows_config.h> 00028 #else 00029 #include <config.h> 00030 #endif 00031 00032 #include <string> 00033 #include <vector> 00034 00035 00036 // =========================================================================== 00037 // class declarations 00038 // =========================================================================== 00039 class MSVehicle; 00040 class MSEdge; 00041 00042 00043 // =========================================================================== 00044 // class definitions 00045 // =========================================================================== 00059 class MSVehicleTransfer { 00060 public: 00062 virtual ~MSVehicleTransfer() throw(); 00063 00064 00073 void addVeh(MSVehicle *veh) throw(); 00074 00075 00084 void checkEmissions(SUMOTime time) throw(); 00085 00086 00090 static MSVehicleTransfer *getInstance() throw(); 00091 00092 00093 private: 00095 MSVehicleTransfer() throw(); 00096 00097 00108 bool proceedVirtualReturnWhetherEnded(MSVehicle &veh, const MSEdge *const newEdge) throw(); 00109 00110 00111 protected: 00116 struct VehicleInformation { 00118 MSVehicle *myVeh; 00120 SUMOTime myInsertTime; 00122 SUMOTime myProceedTime; 00123 00128 VehicleInformation(MSVehicle *veh, SUMOTime insertTime) throw() 00129 : myVeh(veh), myInsertTime(insertTime), myProceedTime(insertTime) { } 00130 00131 }; 00132 00133 00135 typedef std::vector<VehicleInformation> VehicleInfVector; 00136 00138 VehicleInfVector myVehicles; 00139 00141 unsigned int myNoTransfered; 00142 00144 static MSVehicleTransfer *myInstance; 00145 00146 }; 00147 00148 00149 #endif 00150 00151 /****************************************************************************/ 00152
1.5.6