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  void updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos,
185  SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime,
186  bool cleanUp);
187 
189 
190 
201  virtual void notifyMoveInternal(SUMOVehicle& veh,
202  SUMOReal timeOnLane,
203  SUMOReal speed) {
204  UNUSED_PARAMETER(speed);
205  UNUSED_PARAMETER(timeOnLane);
206  UNUSED_PARAMETER(&veh);
207  }
208 
209  void setDescription(const std::string& description) {
210  myDescription = description;
211  }
212 
213  const std::string& getDescription() const {
214  return myDescription;
215  }
216 
217 protected:
219 
220 protected:
221 
223  MSLane* const myLane;
225  std::string myDescription;
226 
227 private:
228  std::map<SUMOVehicle*, std::pair<SUMOTime, SUMOReal> > myLastVehicleUpdateValues;
229 
230 
231 private:
232  MSMoveReminder& operator=(const MSMoveReminder&); // just to avoid a compiler warning
233 
234 };
235 
236 
237 #endif
238 
239 /****************************************************************************/
240 
virtual ~MSMoveReminder()
Destructor.
long long int SUMOTime
Definition: SUMOTime.h:43
const std::string & getDescription() const
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)
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
const MSLane * getLane() const
Returns the lane the reminder works on.
The vehicle changes lanes (micro only)
Representation of a vehicle.
Definition: SUMOVehicle.h:65
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 void notifyMoveInternal(SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
Internal notification about the vehicle moves.
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)
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:77
The vehicle is being teleported.