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, double positionInMeters,
73  const std::string& vTypes);
74 
75 
78 
79 
80 
83 
100  bool notifyMove(SUMOVehicle& veh, double oldPos, double newPos, double newSpeed);
101 
102 
117  bool notifyLeave(SUMOVehicle& veh, double lastPos, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
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, double t, SUMOVehicle& veh, double speed, const char* add = 0, double addValue = -1);
160 
161 
162 protected:
165 
167  const double myPosition;
168 
171 
173  std::map<SUMOVehicle*, double> 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:83
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Write the generated output to the given device.
void writeXMLDetectorProlog(OutputDevice &dev) const
Open the XML-output.
Notification
Definition of a vehicle state.
An instantaneous induction loop.
bool notifyMove(SUMOVehicle &veh, double oldPos, double newPos, double newSpeed)
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder.
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:38
bool notifyLeave(SUMOVehicle &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Dismisses the vehicle if it is on the detector due to a lane change.
double myLastExitTime
The last exit time.
MSInstantInductLoop(const std::string &id, OutputDevice &od, MSLane *const lane, double positionInMeters, const std::string &vTypes)
Constructor.
std::map< SUMOVehicle *, double > myEntryTimes
The last exit time.
~MSInstantInductLoop()
Destructor.
Representation of a vehicle.
Definition: SUMOVehicle.h:67
MSInstantInductLoop & operator=(const MSInstantInductLoop &)
Invalidated assignment operator.
Something on a lane to be noticed about vehicle movement.
const double myPosition
Detector&#39;s position on lane [m].
OutputDevice & myOutputDevice
The output device to use.
void write(const char *state, double t, SUMOVehicle &veh, double speed, const char *add=0, double addValue=-1)
Writes an event line.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
long long int SUMOTime
Definition: TraCIDefs.h:52
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
Base of value-generating classes (detectors)