|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // A device which collects info on the vehicle trip 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 MSDevice_Tripinfo_h 00020 #define MSDevice_Tripinfo_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 "MSDevice.h" 00033 #include <utils/common/SUMOTime.h> 00034 00035 00036 // =========================================================================== 00037 // class definitions 00038 // =========================================================================== 00047 class MSDevice_Tripinfo : public MSDevice { 00048 public: 00059 static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*> &into) throw(); 00060 00061 00062 public: 00065 00075 bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, 00076 SUMOReal newPos, SUMOReal newSpeed) throw(); 00077 00078 00087 bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) throw(); 00088 00089 00098 bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, 00099 MSMoveReminder::Notification reason) throw(); 00101 00102 00109 void generateOutput() const throw(IOError); 00110 00111 00113 ~MSDevice_Tripinfo() throw(); 00114 00115 00116 private: 00122 MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id) throw(); 00123 00124 00125 private: 00126 00127 std::string myDepartLane; 00128 SUMOReal myDepartPos; 00129 SUMOReal myDepartSpeed; 00130 unsigned int myWaitingSteps; 00131 SUMOTime myArrivalTime; 00132 std::string myArrivalLane; 00133 SUMOReal myArrivalPos; 00134 SUMOReal myArrivalSpeed; 00135 00136 private: 00138 MSDevice_Tripinfo(const MSDevice_Tripinfo&); 00139 00141 MSDevice_Tripinfo& operator=(const MSDevice_Tripinfo&); 00142 00143 00144 }; 00145 00146 00147 #endif 00148 00149 /****************************************************************************/ 00150