Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSDevice_Bluelight.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2013-2024 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/****************************************************************************/
18// A device which stands as an implementation example and which outputs movereminder calls
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "MSVehicleDevice.h"
25
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30class SUMOVehicle;
32
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
46public:
50 static void insertOptions(OptionsCont& oc);
51
52
63 static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
64
65
66
67public:
70
71
72
75
85 bool notifyMove(SUMOTrafficObject& veh, double oldPos,
86 double newPos, double newSpeed);
87
88
97 bool notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
98
99
108 bool notifyLeave(SUMOTrafficObject& veh, double lastPos,
109 MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
111
112
114 const std::string deviceName() const {
115 return "bluelight";
116 }
117
119 std::string getParameter(const std::string& key) const;
120
122 void setParameter(const std::string& key, const std::string& value);
123
130 void generateOutput(OutputDevice* tripinfoOut) const;
131
132
133
134private:
140 MSDevice_Bluelight(SUMOVehicle& holder, const std::string& id, const double reactionDist, const double minGapFactor);
141
143 void resetVehicle(MSVehicle* veh2, const std::string& targetTypeID);
144
145
146private:
147 // @brief collects all vehicleIDs which had to react to the emergency vehicle
148 std::set<std::string> myInfluencedVehicles;
149
150 // @brief collects all VehicleTypes of the vehicles which had to react to the emergency vehicle
152
155
158
159private:
162
165
166
167};
A device which collects info on the vehicle trip (mainly on departure and arrival)
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
std::set< std::string > myInfluencedVehicles
double myMinGapFactor
min gap reduction of other vehicles
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Bluelight-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
MSDevice_Bluelight(const MSDevice_Bluelight &)
Invalidated copy constructor.
void resetVehicle(MSVehicle *veh2, const std::string &targetTypeID)
restore type of influenced vehicle
double myReactionDist
reaction distance of other vehicle (i.e. due to different noise levels of the siren)
Parameterised::Map myInfluencedTypes
~MSDevice_Bluelight()
Destructor.
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves departure info on insertion.
const std::string deviceName() const
return the name for this type of device
void generateOutput(OutputDevice *tripinfoOut) const
Called on writing tripinfo output.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves arrival info.
MSDevice_Bluelight & operator=(const MSDevice_Bluelight &)
Invalidated assignment operator.
Representation of a lane in the micro simulation.
Definition MSLane.h:84
Notification
Definition of a vehicle state.
Abstract in-vehicle device.
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
A storage for options typed value containers)
Definition OptionsCont.h:89
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map
Representation of a vehicle, person, or container.
Representation of a vehicle.
Definition SUMOVehicle.h:62