00001 /****************************************************************************/ 00007 // Writes route distributions at a certain edge 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 MSRouteProbe_h 00020 #define MSRouteProbe_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 <microsim/output/MSDetectorFileOutput.h> 00034 #include <microsim/MSMoveReminder.h> 00035 #include <utils/iodevices/OutputDevice.h> 00036 #include <utils/common/Named.h> 00037 00038 00039 // =========================================================================== 00040 // class declarations 00041 // =========================================================================== 00042 class MSEdge; 00043 class MSRoute; 00044 class MSVehicle; 00045 00046 00047 // =========================================================================== 00048 // class definitions 00049 // =========================================================================== 00065 class MSRouteProbe : public MSDetectorFileOutput, public Named { 00066 public: 00071 class EntryReminder : public MSMoveReminder { 00072 public: 00078 EntryReminder(MSLane * const lane, MSRouteProbe& collector) throw(); 00079 00080 00083 00095 bool notifyEnter(MSVehicle& veh, bool isEmit, bool isLaneChange) throw(); 00097 00098 00099 private: 00101 MSRouteProbe& myCollector; 00102 00103 private: 00105 EntryReminder(const EntryReminder&); 00106 00108 EntryReminder& operator=(const EntryReminder&); 00109 00110 }; 00111 00112 00119 MSRouteProbe(const std::string &id, 00120 const MSEdge *edge, 00121 SUMOTime begin) throw(); 00122 00123 00125 virtual ~MSRouteProbe() throw(); 00126 00127 00128 00131 00145 void writeXMLOutput(OutputDevice &dev, 00146 SUMOTime startTime, SUMOTime stopTime) throw(IOError); 00147 00148 00156 void writeXMLDetectorProlog(OutputDevice &dev) const throw(IOError); 00158 00159 00161 void addRoute(const MSRoute &route) const; 00162 00163 private: 00165 RandomDistributor<const MSRoute*> *myCurrentRouteDistribution; 00166 00168 EntryReminder *myEntryReminder; 00169 00170 00171 private: 00173 MSRouteProbe(const MSRouteProbe&); 00174 00176 MSRouteProbe& operator=(const MSRouteProbe&); 00177 00178 00179 }; 00180 00181 #endif 00182 00183 /****************************************************************************/ 00184
1.5.6