SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-sim.org/
14 // Copyright (C) 2003-2014 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 #ifdef HAVE_INTERNAL
185  void updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos,
186  SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime);
187 #endif
188 
190 
191 
202  virtual void notifyMoveInternal(SUMOVehicle& veh,
203  SUMOReal timeOnLane,
204  SUMOReal speed) {
205  UNUSED_PARAMETER(speed);
206  UNUSED_PARAMETER(timeOnLane);
207  UNUSED_PARAMETER(&veh);
208  }
209 
210  void setDescription(const std::string& description) {
211  myDescription = description;
212  }
213 
214  const std::string& getDescription() const {
215  return myDescription;
216  }
217 
218 
219 protected:
221  MSLane* const myLane;
223  std::string myDescription;
224 
225 #ifdef HAVE_INTERNAL
226  std::map<SUMOVehicle*, std::pair<SUMOTime, SUMOReal> > myLastVehicleUpdateValues;
227 #endif
228 
229 
230 private:
231  MSMoveReminder& operator=(const MSMoveReminder&); // just to avoid a compiler warning
232 
233 };
234 
235 
236 #endif
237 
238 /****************************************************************************/
239 
virtual ~MSMoveReminder()
Destructor.
const std::string & getDescription() const
std::string myDescription
a description of this moveReminder
The vehicle arrived at a junction.
MSLane *const myLane
Lane on which the reminder works.
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:64
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)
int SUMOTime
Definition: SUMOTime.h:43
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:215
The vehicle was teleported out of the net.
virtual bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, Notification reason)
Called if the vehicle leaves the reminder's lane.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
The vehicle is being teleported.