SUMO - Simulation of Urban MObility
MSInstantInductLoop.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // An instantaneous induction loop
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2011-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSInstantInductLoop_h
22 #define MSInstantInductLoop_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <deque>
36 #include <map>
37 #include <functional>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class MSLane;
46 class MSVehicle;
47 class OutputDevice;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
61  : public MSMoveReminder, public MSDetectorFileOutput {
62 public:
71  MSInstantInductLoop(const std::string& id, OutputDevice& od,
72  MSLane* const lane, SUMOReal positionInMeters,
73  const std::string& vTypes);
74 
75 
78 
79 
80 
83 
100  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed);
101 
102 
117  bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason);
119 
120 
121 
132  SUMOTime startTime, SUMOTime stopTime) {
133  UNUSED_PARAMETER(dev);
134  UNUSED_PARAMETER(startTime);
135  UNUSED_PARAMETER(stopTime);
136  }
137 
138 
147  void writeXMLDetectorProlog(OutputDevice& dev) const;
148 
149 
150 protected:
159  void write(const char* state, SUMOReal t, SUMOVehicle& veh, SUMOReal speed, const char* add = 0, SUMOReal addValue = -1);
160 
161 
162 protected:
165 
168 
171 
173  std::map<SUMOVehicle*, SUMOReal> myEntryTimes;
174 
175 private:
178 
181 
182 
183 };
184 
185 
186 #endif
187 
188 /****************************************************************************/
189 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:82
long long int SUMOTime
Definition: SUMOTime.h:43
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Write the generated output to the given device.
MSInstantInductLoop(const std::string &id, OutputDevice &od, MSLane *const lane, SUMOReal positionInMeters, const std::string &vTypes)
Constructor.
void writeXMLDetectorProlog(OutputDevice &dev) const
Open the XML-output.
Notification
Definition of a vehicle state.
An instantaneous induction loop.
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Dismisses the vehicle if it is on the detector due to a lane change.
void write(const char *state, SUMOReal t, SUMOVehicle &veh, SUMOReal speed, const char *add=0, SUMOReal addValue=-1)
Writes an event line.
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
SUMOReal myLastExitTime
The last exit time.
const SUMOReal myPosition
Detector&#39;s position on lane [m].
std::map< SUMOVehicle *, SUMOReal > myEntryTimes
The last exit time.
~MSInstantInductLoop()
Destructor.
Representation of a vehicle.
Definition: SUMOVehicle.h:66
MSInstantInductLoop & operator=(const MSInstantInductLoop &)
Invalidated assignment operator.
Something on a lane to be noticed about vehicle movement.
OutputDevice & myOutputDevice
The output device to use.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:213
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
Base of value-generating classes (detectors)