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