SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSInstantInductLoop.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // An instantaneous induction loop
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSInstantInductLoop_h
21 #define MSInstantInductLoop_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <deque>
35 #include <map>
36 #include <functional>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class MSLane;
45 class MSVehicle;
46 class OutputDevice;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
60  : public MSMoveReminder, public MSDetectorFileOutput {
61 public:
70  MSInstantInductLoop(const std::string& id, OutputDevice& od,
71  MSLane* const lane, SUMOReal positionInMeters);
72 
73 
76 
77 
78 
81 
98  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed);
99 
100 
115  bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason);
117 
118 
119 
130  SUMOTime startTime, SUMOTime stopTime) {
131  UNUSED_PARAMETER(dev);
132  UNUSED_PARAMETER(startTime);
133  UNUSED_PARAMETER(stopTime);
134  }
135 
136 
145  void writeXMLDetectorProlog(OutputDevice& dev) const;
146 
147 
148 protected:
157  void write(const char* state, SUMOReal t, SUMOVehicle& veh, SUMOReal speed, const char* add = 0, SUMOReal addValue = -1);
158 
159 
160 protected:
163 
166 
169 
171  std::map<SUMOVehicle*, SUMOReal> myEntryTimes;
172 
173 private:
176 
179 
180 
181 };
182 
183 
184 #endif
185 
186 /****************************************************************************/
187 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
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)
Constructor.
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:38
SUMOReal myLastExitTime
The last exit time.
const SUMOReal myPosition
Detector's position on lane [m].
std::map< SUMOVehicle *, SUMOReal > myEntryTimes
The last exit time.
~MSInstantInductLoop()
Destructor.
Representation of a vehicle.
Definition: SUMOVehicle.h:63
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:70
void writeXMLDetectorProlog(OutputDevice &dev) const
Open the XML-output.
#define SUMOReal
Definition: config.h:215
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
Base of value-generating classes (detectors)