|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Writes route distributions at a certain edge 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 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/common/RandomDistributor.h> 00036 00037 00038 // =========================================================================== 00039 // class declarations 00040 // =========================================================================== 00041 class MSEdge; 00042 class MSRoute; 00043 class MSVehicle; 00044 class OutputDevice; 00045 00046 00047 // =========================================================================== 00048 // class definitions 00049 // =========================================================================== 00065 class MSRouteProbe : public MSDetectorFileOutput, public MSMoveReminder { 00066 public: 00073 MSRouteProbe(const std::string& id, 00074 const MSEdge* edge, 00075 SUMOTime begin) throw(); 00076 00077 00079 virtual ~MSRouteProbe() throw(); 00080 00081 00084 00096 bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) throw(); 00098 00099 00102 00116 void writeXMLOutput(OutputDevice& dev, 00117 SUMOTime startTime, SUMOTime stopTime) throw(IOError); 00118 00119 00127 void writeXMLDetectorProlog(OutputDevice& dev) const throw(IOError); 00129 00130 private: 00132 RandomDistributor<const MSRoute*> *myCurrentRouteDistribution; 00133 00134 00135 private: 00137 MSRouteProbe(const MSRouteProbe&); 00138 00140 MSRouteProbe& operator=(const MSRouteProbe&); 00141 00142 00143 }; 00144 00145 #endif 00146 00147 /****************************************************************************/ 00148