SUMO - Simulation of Urban MObility
MSMoveReminder.h
Go to the documentation of this file.
1 /****************************************************************************/
11 // Something on a lane to be noticed about vehicle movement
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2003-2016 DLR (http://www.dlr.de/) and contributors
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
24 #ifndef MSMoveReminder_h
25 #define MSMoveReminder_h
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
37 #include <map>
38 #include <utils/common/SUMOTime.h>
39 #include <utils/common/StdDefs.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class SUMOVehicle;
46 class MSLane;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
71 public:
77  MSMoveReminder(const std::string& description, MSLane* const lane = 0, const bool doAdd = true);
78 
79 
82  virtual ~MSMoveReminder() {}
83 
84 
89  const MSLane* getLane() const {
90  return myLane;
91  }
92 
93 
95  enum Notification {
109  NOTIFICATION_ARRIVED, // arrived and everything after is treated as permanent deletion from the net
114  };
115 
116 
119 
130  virtual bool notifyEnter(SUMOVehicle& veh, Notification reason) {
131  UNUSED_PARAMETER(reason);
132  UNUSED_PARAMETER(&veh);
133  return true;
134  }
135 
136 
150  virtual bool notifyMove(SUMOVehicle& veh,
151  SUMOReal oldPos,
152  SUMOReal newPos,
153  SUMOReal newSpeed) {
154  UNUSED_PARAMETER(oldPos);
155  UNUSED_PARAMETER(newPos);
156  UNUSED_PARAMETER(newSpeed);
157  UNUSED_PARAMETER(&veh);
158  return true;
159  }
160 
161 
175  virtual bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos,
176  Notification reason) {
177  UNUSED_PARAMETER(reason);
178  UNUSED_PARAMETER(lastPos);
179  UNUSED_PARAMETER(&veh);
180  return true;
181  }
182 
183 
184  // TODO: Documentation
185  void updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos,
186  SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime,
187  bool cleanUp);
188 
190 
205  virtual void notifyMoveInternal(const SUMOVehicle& veh,
206  const SUMOReal frontOnLane,
207  const SUMOReal timeOnLane,
208  const SUMOReal meanSpeedFrontOnLane,
209  const SUMOReal meanSpeedVehicleOnLane,
210  const SUMOReal travelledDistanceFrontOnLane,
211  const SUMOReal travelledDistanceVehicleOnLane) {
212  UNUSED_PARAMETER(travelledDistanceFrontOnLane);
213  UNUSED_PARAMETER(travelledDistanceVehicleOnLane);
214  UNUSED_PARAMETER(meanSpeedVehicleOnLane);
215  UNUSED_PARAMETER(meanSpeedFrontOnLane);
216  UNUSED_PARAMETER(frontOnLane);
217  UNUSED_PARAMETER(timeOnLane);
218  UNUSED_PARAMETER(&veh);
219  }
220 
221  void setDescription(const std::string& description) {
222  myDescription = description;
223  }
224 
225  const std::string& getDescription() const {
226  return myDescription;
227  }
228 
229 protected:
231 
232 protected:
233 
235  MSLane* const myLane;
237  std::string myDescription;
238 
239 private:
240  std::map<SUMOVehicle*, std::pair<SUMOTime, SUMOReal> > myLastVehicleUpdateValues;
241 
242 
243 private:
244  MSMoveReminder& operator=(const MSMoveReminder&); // just to avoid a compiler warning
245 
246 };
247 
248 
249 #endif
250 
251 /****************************************************************************/
252 
const MSLane * getLane() const
Returns the lane the reminder works on.
virtual ~MSMoveReminder()
Destructor.
long long int SUMOTime
Definition: SUMOTime.h:43
std::string myDescription
a description of this moveReminder
The vehicle arrived at a junction.
void updateDetector(SUMOVehicle &veh, SUMOReal entryPos, SUMOReal leavePos, SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime, bool cleanUp)
MSLane *const myLane
Lane on which the reminder works.
void removeFromVehicleUpdateValues(SUMOVehicle &veh)
Notification
Definition of a vehicle state.
The vehicle got vaporized.
MSMoveReminder(const std::string &description, MSLane *const lane=0, const bool doAdd=true)
Constructor.
The vehicle changes the segment (meso only)
virtual void notifyMoveInternal(const SUMOVehicle &veh, const SUMOReal frontOnLane, const SUMOReal timeOnLane, const SUMOReal meanSpeedFrontOnLane, const SUMOReal meanSpeedVehicleOnLane, const SUMOReal travelledDistanceFrontOnLane, const SUMOReal travelledDistanceVehicleOnLane)
Internal notification about the vehicle moves.
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
The vehicle changes lanes (micro only) XXX: What if a vehicle changes lanes and passes a junction sim...
Representation of a vehicle.
Definition: SUMOVehicle.h:66
std::map< SUMOVehicle *, std::pair< SUMOTime, SUMOReal > > myLastVehicleUpdateValues
The vehicle arrived at its destination (is deleted)
Something on a lane to be noticed about vehicle movement.
virtual bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks whether the reminder still has to be notified about the vehicle moves.
void setDescription(const std::string &description)
The vehicle starts or ends parking.
The vehicle has departed (was inserted into the network)
const std::string & getDescription() const
virtual bool notifyEnter(SUMOVehicle &veh, Notification reason)
Checks whether the reminder is activated by a vehicle entering the lane.
MSMoveReminder & operator=(const MSMoveReminder &)
#define SUMOReal
Definition: config.h:213
The vehicle was teleported out of the net.
virtual bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, Notification reason)
Called if the vehicle leaves the reminder&#39;s lane.
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
The vehicle is being teleported.