Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSInstantInductLoop.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2011-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// An instantaneous induction loop
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
24#include <string>
25#include <deque>
26#include <map>
27#include <functional>
30
31
32// ===========================================================================
33// class declarations
34// ===========================================================================
35class MSLane;
36class MSVehicle;
37class OutputDevice;
39
40
41// ===========================================================================
42// class definitions
43// ===========================================================================
52 : public MSMoveReminder, public MSDetectorFileOutput {
53public:
62 MSInstantInductLoop(const std::string& id, OutputDevice& od,
63 MSLane* const lane, double positionInMeters,
64 const std::string name, const std::string& vTypes,
65 const std::string& nextEdges,
66 int detectPersons);
67
68
71
72
73
76
79
89 bool notifyEnter(SUMOTrafficObject& veh, Notification reason, const MSLane* enteredLane = 0);
90
107 bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos, double newSpeed);
108
109
123 bool notifyLeave(SUMOTrafficObject& veh, double lastPos, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
125
126
127
138 SUMOTime startTime, SUMOTime stopTime) {
139 UNUSED_PARAMETER(dev);
140 UNUSED_PARAMETER(startTime);
141 UNUSED_PARAMETER(stopTime);
142 }
143
144
153 void writeXMLDetectorProlog(OutputDevice& dev) const;
154
155
156protected:
165 void write(const char* state, double t, SUMOTrafficObject& veh, double speed, const char* add = 0, double addValue = -1);
166
167
168protected:
170 const std::string myName;
171
174
176 const double myPosition;
177
180
182 std::map<SUMOTrafficObject*, double> myEntryTimes;
183
184private:
187
190
191
192};
long long int SUMOTime
Definition GUI.h:36
Base of value-generating classes (detectors)
An instantaneous induction loop.
MSInstantInductLoop(const MSInstantInductLoop &)
Invalidated copy constructor.
std::map< SUMOTrafficObject *, double > myEntryTimes
The last exit time.
MSInstantInductLoop & operator=(const MSInstantInductLoop &)
Invalidated assignment operator.
bool notifyEnter(SUMOTrafficObject &veh, Notification reason, const MSLane *enteredLane=0)
Checks whether the reminder is activated by a vehicle entering the lane.
OutputDevice & myOutputDevice
The output device to use.
void writeXMLDetectorProlog(OutputDevice &dev) const
Open the XML-output.
void write(const char *state, double t, SUMOTrafficObject &veh, double speed, const char *add=0, double addValue=-1)
Writes an event line.
const double myPosition
Detector's position on lane [m].
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Write the generated output to the given device.
const std::string myName
name
bool notifyLeave(SUMOTrafficObject &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.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the vehicle shall be counted and/or shall still touch this MSMoveReminder.
Representation of a lane in the micro simulation.
Definition MSLane.h:84
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
Static storage of an output device and its base (abstract) implementation.
Representation of a vehicle, person, or container.
#define UNUSED_PARAMETER(x)