|
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 // =========================================================================== 00039 // class definitions 00040 // =========================================================================== 00049 class MSDevice_Tripinfo : public MSDevice { 00050 public: 00061 static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*> &into) ; 00062 00063 00064 public: 00067 00077 bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, 00078 SUMOReal newPos, SUMOReal newSpeed) ; 00079 00080 00089 bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; 00090 00091 00100 bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, 00101 MSMoveReminder::Notification reason) ; 00103 00104 00111 void generateOutput() const; 00112 00113 00115 ~MSDevice_Tripinfo() ; 00116 00117 00118 private: 00124 MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id) ; 00125 00126 00127 private: 00128 00129 std::string myDepartLane; 00130 SUMOReal myDepartPos; 00131 SUMOReal myDepartSpeed; 00132 unsigned int myWaitingSteps; 00133 SUMOTime myArrivalTime; 00134 std::string myArrivalLane; 00135 SUMOReal myArrivalPos; 00136 SUMOReal myArrivalSpeed; 00137 00138 private: 00140 MSDevice_Tripinfo(const MSDevice_Tripinfo&); 00141 00143 MSDevice_Tripinfo& operator=(const MSDevice_Tripinfo&); 00144 00145 00146 }; 00147 00148 00149 #endif 00150 00151 /****************************************************************************/ 00152