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 /****************************************************************************/
10 // Something on a lane to be noticed about vehicle movement
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef MSMoveReminder_h
24 #define MSMoveReminder_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <map>
37 #include <utils/common/SUMOTime.h>
38 #include <utils/common/StdDefs.h>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class SUMOVehicle;
45 class MSLane;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
70 public:
76  MSMoveReminder(const std::string& description, MSLane* const lane = 0, const bool doAdd = true);
77 
78 
81  virtual ~MSMoveReminder() {}
82 
83 
88  const MSLane* getLane() const {
89  return myLane;
90  }
91 
92 
94  enum Notification {
108  NOTIFICATION_ARRIVED, // arrived and everything after is treated as permanent deletion from the net
113  };
114 
115 
118 
129  virtual bool notifyEnter(SUMOVehicle& veh, Notification reason) {
130  UNUSED_PARAMETER(reason);
131  UNUSED_PARAMETER(&veh);
132  return true;
133  }
134 
135 
149  virtual bool notifyMove(SUMOVehicle& veh,
150  SUMOReal oldPos,
151  SUMOReal newPos,
152  SUMOReal newSpeed) {
153  UNUSED_PARAMETER(oldPos);
154  UNUSED_PARAMETER(newPos);
155  UNUSED_PARAMETER(newSpeed);
156  UNUSED_PARAMETER(&veh);
157  return true;
158  }
159 
160 
174  virtual bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos,
175  Notification reason) {
176  UNUSED_PARAMETER(reason);
177  UNUSED_PARAMETER(lastPos);
178  UNUSED_PARAMETER(&veh);
179  return true;
180  }
181 
182 
183 #ifdef HAVE_INTERNAL
184  void updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos,
185  SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime);
186 #endif
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 
210  const std::string& getDescription() const {
211  return myDescription;
212  }
213 
214 
215 protected:
217  MSLane* const myLane;
219  const std::string myDescription;
220 
221 #ifdef HAVE_INTERNAL
222  std::map<SUMOVehicle*, std::pair<SUMOTime, SUMOReal> > myLastVehicleUpdateValues;
223 #endif
224 
225 
226 private:
227  MSMoveReminder& operator=(const MSMoveReminder&); // just to avoid a compiler warning
228 
229 };
230 
231 
232 #endif
233 
234 /****************************************************************************/
235 
virtual ~MSMoveReminder()
Destructor.
const std::string & getDescription() const
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)
const std::string myDescription
a description of this moveReminder
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:36
const MSLane * getLane() const
Returns the lane the reminder works on.
The vehicle changes lanes (micro only)
Representation of a vehicle.
Definition: SUMOVehicle.h:63
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.
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:221
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:73
The vehicle is being teleported.