Eclipse SUMO - Simulation of Urban MObility
MSDevice_Friction.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 /****************************************************************************/
19 // A device which stands as an implementation example and which outputs movereminder calls
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include "MSVehicleDevice.h"
25 
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
30 class SUMOTrafficObject;
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
45 public:
49  static void insertOptions(OptionsCont& oc);
50 
61  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
62 
63 public:
66 
69 
79  bool notifyMove(SUMOTrafficObject& veh, double oldPos,
80  double newPos, double newSpeed);
82 
84  const std::string deviceName() const {
85  return "friction";
86  }
87 
89  std::string getParameter(const std::string& key) const;
90 
92  void setParameter(const std::string& key, const std::string& value);
93 
94  inline double getMeasuredFriction() {
96  }
97 
98 private:
104  MSDevice_Friction(SUMOVehicle& holder, const std::string& id,
105  double stdDev, double offset);
106 
107 private:
108  // private state members of the Friction device
109 
112 
115 
118 
120  double myOffset;
121 
122 private:
125 
128 
129 };
A device which collects info on current friction Coefficient on the road.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
MSDevice_Friction & operator=(const MSDevice_Friction &)
Invalidated assignment operator.
double myOffset
a value which is initialised based on a vType parameter
~MSDevice_Friction()
Destructor.
double myStdDeviation
a value which is initialised based on a vehicle parameter
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Friction-options.
MSDevice_Friction(SUMOVehicle &holder, const std::string &id, double stdDev, double offset)
Constructor.
MSDevice_Friction(const MSDevice_Friction &)
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
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
const std::string deviceName() const
return the name for this type of device
double myRawFriction
realValue from Road (without measurement model)
double myMeasuredFrictionCoefficient
a value which is initialised based on a commandline/configuration option
double getMeasuredFriction()
Abstract in-vehicle device.
A storage for options typed value containers)
Definition: OptionsCont.h:89
Representation of a vehicle, person, or container.
Representation of a vehicle.
Definition: SUMOVehicle.h:60