SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // A device which collects info on the vehicle trip 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00012 /****************************************************************************/ 00013 // 00014 // This file is part of SUMO. 00015 // SUMO is free software: you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation, either version 3 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef MSDevice_Tripinfo_h 00022 #define MSDevice_Tripinfo_h 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include "MSDevice.h" 00035 #include <utils/common/SUMOTime.h> 00036 00037 // =========================================================================== 00038 // class declarations 00039 // =========================================================================== 00040 class SUMOVehicle; 00041 00042 // =========================================================================== 00043 // class definitions 00044 // =========================================================================== 00053 class MSDevice_Tripinfo : public MSDevice { 00054 public: 00065 static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*> &into) ; 00066 00067 00068 public: 00071 00081 bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, 00082 SUMOReal newPos, SUMOReal newSpeed) ; 00083 00084 00093 bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; 00094 00095 00104 bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, 00105 MSMoveReminder::Notification reason) ; 00107 00108 00115 void generateOutput() const; 00116 00117 00119 ~MSDevice_Tripinfo() ; 00120 00121 00122 private: 00128 MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id) ; 00129 00130 00131 private: 00132 00133 std::string myDepartLane; 00134 SUMOReal myDepartPos; 00135 SUMOReal myDepartSpeed; 00136 unsigned int myWaitingSteps; 00137 SUMOTime myArrivalTime; 00138 std::string myArrivalLane; 00139 SUMOReal myArrivalPos; 00140 SUMOReal myArrivalSpeed; 00141 00142 private: 00144 MSDevice_Tripinfo(const MSDevice_Tripinfo&); 00145 00147 MSDevice_Tripinfo& operator=(const MSDevice_Tripinfo&); 00148 00149 00150 }; 00151 00152 00153 #endif 00154 00155 /****************************************************************************/ 00156