Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSDevice_DriverState.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/****************************************************************************/
23/****************************************************************************/
24#pragma once
25#include <config.h>
26
27#include "MSVehicleDevice.h"
30
31
32// ===========================================================================
33// class declarations
34// ===========================================================================
35class SUMOVehicle;
36class MSVehicle;
38
39
40// ===========================================================================
41// class definitions
42// ===========================================================================
53public:
57 static void insertOptions(OptionsCont& oc);
58
59
70 static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
71
73 void update();
74
76 inline std::shared_ptr<MSSimpleDriverState> getDriverState() const {
77 return myDriverState;
78 }
79
80public:
83
85 const std::string deviceName() const {
86 return "driverstate";
87 }
88
90 std::string getParameter(const std::string& key) const;
91
93 void setParameter(const std::string& key, const std::string& value);
94
95
96private:
102 MSDevice_DriverState(SUMOVehicle& holder, const std::string& id,
103 double minAwareness,
104 double initialAwareness,
105 double errorTimeScaleCoefficient,
106 double errorNoiseIntensityCoefficient,
107 double speedDifferenceErrorCoefficient,
108 double speedDifferenceChangePerceptionThreshold,
109 double headwayChangePerceptionThreshold,
110 double headwayErrorCoefficient,
111 double freeSpeedErrorCoefficient,
112 double maximalReactionTime);
113
115 void initDriverState();
116
117private:
120
135
137 std::shared_ptr<MSSimpleDriverState> myDriverState;
138
139private:
142
145
146};
The ToC Device controls transition of control between automated and manual driving.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
MSVehicle * myHolderMS
The holder vehicle casted to MSVehicle*.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_DriverState-options.
MSDevice_DriverState(const MSDevice_DriverState &)
Invalidated copy constructor.
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::shared_ptr< MSSimpleDriverState > getDriverState() const
return internal state
const std::string deviceName() const
return the name for this type of device
void initDriverState()
Initialises the driver state parameters.
double mySpeedDifferenceChangePerceptionThreshold
std::shared_ptr< MSSimpleDriverState > myDriverState
The driver state of the holder.
MSDevice_DriverState & operator=(const MSDevice_DriverState &)
Invalidated assignment operator.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
void update()
update internal state
Provides an interface to an error whose fluctuation is controlled via the driver's 'awareness',...
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
Representation of a vehicle.
Definition SUMOVehicle.h:62