SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00010 // Something on a lane to be noticed about vehicle movement 00011 /****************************************************************************/ 00012 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00013 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00014 /****************************************************************************/ 00015 // 00016 // This file is part of SUMO. 00017 // SUMO is free software: you can redistribute it and/or modify 00018 // it under the terms of the GNU General Public License as published by 00019 // the Free Software Foundation, either version 3 of the License, or 00020 // (at your option) any later version. 00021 // 00022 /****************************************************************************/ 00023 #ifndef MSMoveReminder_h 00024 #define MSMoveReminder_h 00025 00026 00027 // =========================================================================== 00028 // included modules 00029 // =========================================================================== 00030 #ifdef _MSC_VER 00031 #include <windows_config.h> 00032 #else 00033 #include <config.h> 00034 #endif 00035 00036 #include <map> 00037 #include <utils/common/SUMOTime.h> 00038 #include <utils/common/StdDefs.h> 00039 00040 00041 // =========================================================================== 00042 // class declarations 00043 // =========================================================================== 00044 class SUMOVehicle; 00045 class MSLane; 00046 00047 00048 // =========================================================================== 00049 // class definitions 00050 // =========================================================================== 00068 class MSMoveReminder { 00069 public: 00075 MSMoveReminder(MSLane* const lane = 0, const bool doAdd = true) ; 00076 00077 00080 virtual ~MSMoveReminder() {} 00081 00082 00087 const MSLane* getLane() const { 00088 return myLane; 00089 } 00090 00091 00093 enum Notification { 00095 NOTIFICATION_DEPARTED, 00097 NOTIFICATION_JUNCTION, 00099 NOTIFICATION_SEGMENT, 00101 NOTIFICATION_LANE_CHANGE, 00103 NOTIFICATION_TELEPORT, 00105 NOTIFICATION_PARKING, 00107 NOTIFICATION_ARRIVED, // arrived and everything after is treated as permanent deletion from the net 00109 NOTIFICATION_VAPORIZED, 00111 NOTIFICATION_TELEPORT_ARRIVED 00112 }; 00113 00114 00117 00128 virtual bool notifyEnter(SUMOVehicle& veh, Notification reason) { 00129 UNUSED_PARAMETER(reason); 00130 UNUSED_PARAMETER(&veh); 00131 return true; 00132 } 00133 00134 00148 virtual bool notifyMove(SUMOVehicle& veh, 00149 SUMOReal oldPos, 00150 SUMOReal newPos, 00151 SUMOReal newSpeed) { 00152 UNUSED_PARAMETER(oldPos); 00153 UNUSED_PARAMETER(newPos); 00154 UNUSED_PARAMETER(newSpeed); 00155 UNUSED_PARAMETER(&veh); 00156 return true; 00157 } 00158 00159 00173 virtual bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, 00174 Notification reason) { 00175 UNUSED_PARAMETER(reason); 00176 UNUSED_PARAMETER(lastPos); 00177 UNUSED_PARAMETER(&veh); 00178 return true; 00179 } 00180 00181 00182 #ifdef HAVE_MESOSIM 00183 void updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos, 00184 SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime) ; 00185 #endif 00186 00188 00189 00200 virtual void notifyMoveInternal(SUMOVehicle& veh, 00201 SUMOReal timeOnLane, 00202 SUMOReal speed) { 00203 UNUSED_PARAMETER(speed); 00204 UNUSED_PARAMETER(timeOnLane); 00205 UNUSED_PARAMETER(&veh); 00206 } 00207 00208 00209 private: 00210 MSMoveReminder& operator=(const MSMoveReminder&); // just to avoid a compiler warning 00211 00212 00213 protected: 00215 MSLane* const myLane; 00216 00217 00218 #ifdef HAVE_MESOSIM 00219 std::map<SUMOVehicle*, std::pair<SUMOTime, SUMOReal> > myLastVehicleUpdateValues; 00220 #endif 00221 00222 }; 00223 00224 00225 #endif 00226 00227 /****************************************************************************/ 00228