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-2014 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  void setDescription(const std::string& description) {
210  myDescription = description;
211  }
212 
213  const std::string& getDescription() const {
214  return myDescription;
215  }
216 
217 
218 protected:
220  MSLane* const myLane;
222  std::string myDescription;
223 
224 #ifdef HAVE_INTERNAL
225  std::map<SUMOVehicle*, std::pair<SUMOTime, SUMOReal> > myLastVehicleUpdateValues;
226 #endif
227 
228 
229 private:
230  MSMoveReminder& operator=(const MSMoveReminder&); // just to avoid a compiler warning
231 
232 };
233 
234 
235 #endif
236 
237 /****************************************************************************/
238 
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:38
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.
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.