|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Something on a lane to be noticed about vehicle movement 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 MSMoveReminder_h 00020 #define MSMoveReminder_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 <map> 00033 #include <utils/common/SUMOTime.h> 00034 #include <utils/common/StdDefs.h> 00035 00036 00037 // =========================================================================== 00038 // class declarations 00039 // =========================================================================== 00040 class SUMOVehicle; 00041 class MSLane; 00042 00043 00044 // =========================================================================== 00045 // class definitions 00046 // =========================================================================== 00064 class MSMoveReminder { 00065 public: 00071 MSMoveReminder(MSLane* const lane=0, const bool doAdd=true) throw(); 00072 00073 00076 virtual ~MSMoveReminder() throw() {} 00077 00078 00083 const MSLane* getLane() const throw() { 00084 return myLane; 00085 } 00086 00087 00089 enum Notification { 00091 NOTIFICATION_DEPARTED, 00093 NOTIFICATION_JUNCTION, 00095 NOTIFICATION_SEGMENT, 00097 NOTIFICATION_LANE_CHANGE, 00099 NOTIFICATION_TELEPORT, 00101 NOTIFICATION_PARKING, 00103 NOTIFICATION_ARRIVED, // arrived and everything after is treated as permanent deletion from the net 00105 NOTIFICATION_VAPORIZED, 00107 NOTIFICATION_TELEPORT_ARRIVED 00108 }; 00109 00110 00113 00124 virtual bool notifyEnter(SUMOVehicle& veh, Notification reason) throw() { 00125 UNUSED_PARAMETER(reason); 00126 UNUSED_PARAMETER(&veh); 00127 return true; 00128 } 00129 00130 00144 virtual bool notifyMove(SUMOVehicle& veh, 00145 SUMOReal oldPos, 00146 SUMOReal newPos, 00147 SUMOReal newSpeed) throw() { 00148 UNUSED_PARAMETER(oldPos); 00149 UNUSED_PARAMETER(newPos); 00150 UNUSED_PARAMETER(newSpeed); 00151 UNUSED_PARAMETER(&veh); 00152 return true; 00153 } 00154 00155 00169 virtual bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, 00170 Notification reason) throw() { 00171 UNUSED_PARAMETER(reason); 00172 UNUSED_PARAMETER(lastPos); 00173 UNUSED_PARAMETER(&veh); 00174 return true; 00175 } 00176 00177 00178 #ifdef HAVE_MESOSIM 00179 void updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos, 00180 SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime) throw(); 00181 #endif 00182 00184 00185 00196 virtual void notifyMoveInternal(SUMOVehicle& veh, 00197 SUMOReal timeOnLane, 00198 SUMOReal speed) throw() { 00199 UNUSED_PARAMETER(speed); 00200 UNUSED_PARAMETER(timeOnLane); 00201 UNUSED_PARAMETER(&veh); 00202 } 00203 00204 00205 private: 00206 MSMoveReminder& operator=(const MSMoveReminder&); // just to avoid a compiler warning 00207 00208 00209 protected: 00211 MSLane* const myLane; 00212 00213 00214 #ifdef HAVE_MESOSIM 00215 std::map<SUMOVehicle*, std::pair<SUMOTime, SUMOReal> > myLastVehicleUpdateValues; 00216 #endif 00217 00218 }; 00219 00220 00221 #endif 00222 00223 /****************************************************************************/ 00224