Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
FirstOrderLagModel Class Reference

#include <FirstOrderLagModel.h>

Inheritance diagram for FirstOrderLagModel:
[legend]
Collaboration diagram for FirstOrderLagModel:
[legend]

Public Member Functions

 FirstOrderLagModel ()
virtual double getRealAcceleration (double speed_mps, double accel_mps2, double reqAccel_mps2, SUMOTime timeStep=0)
virtual void loadParameters (const Parameterised::Map &parameters)
void setMaximumAcceleration (double maxAcc)
void setMaximumDeceleration (double maxDec)
virtual void setParameter (const std::string parameter, const std::string &value)
virtual void setParameter (const std::string parameter, double value)
virtual void setParameter (const std::string parameter, int value)
virtual ~FirstOrderLagModel ()

Protected Member Functions

void computeParameters ()
void parseParameter (const Parameterised::Map &parameters, std::string parameter, double &value)
void parseParameter (const Parameterised::Map &parameters, std::string parameter, int &value)
void parseParameter (const Parameterised::Map &parameters, std::string parameter, std::string &value)
void printParameterError (std::string parameter, std::string value)

Protected Attributes

double alpha
std::string className
double dt_s
double maxAcceleration_mpsps
double maxDeceleration_mpsps
double oneMinusAlpha
double tau_s

Detailed Description

This model models actuation lags using a first order lag, i.e., a first order low pass filter with a time constant tau

Definition at line 30 of file FirstOrderLagModel.h.

Constructor & Destructor Documentation

◆ FirstOrderLagModel()

FirstOrderLagModel::FirstOrderLagModel ( )

◆ ~FirstOrderLagModel()

FirstOrderLagModel::~FirstOrderLagModel ( )
virtual

Definition at line 31 of file FirstOrderLagModel.cpp.

Member Function Documentation

◆ computeParameters()

void FirstOrderLagModel::computeParameters ( )
protected

Recomputes helper variables after loading parameters

Definition at line 33 of file FirstOrderLagModel.cpp.

References alpha, dt_s, oneMinusAlpha, and tau_s.

Referenced by FirstOrderLagModel(), loadParameters(), and setParameter().

Here is the caller graph for this function:

◆ getRealAcceleration()

double FirstOrderLagModel::getRealAcceleration ( double speed_mps,
double accel_mps2,
double reqAccel_mps2,
SUMOTime timeStep = 0 )
virtual

Computes real vehicle acceleration given current speed, current acceleration, and requested acceleration. Acceleration can be negative as well. The model should handle decelerations as well

Parameters
[in]speed_mpscurrent speed in meters per second
[in]accel_mps2current acceleration in meters per squared second
[in]reqAccel_mps2requested acceleration in meters per squared second
[in]timeStepcurrent simulation timestep
Returns
the real acceleration that the vehicle applies in meters per squared second

Implements GenericEngineModel.

Definition at line 38 of file FirstOrderLagModel.cpp.

References alpha, GenericEngineModel::maxAcceleration_mpsps, GenericEngineModel::maxDeceleration_mpsps, oneMinusAlpha, and UNUSED_PARAMETER.

◆ loadParameters()

void FirstOrderLagModel::loadParameters ( const Parameterised::Map & parameters)
virtual

Load model parameters. This method requires a map of strings to be as flexible as possible, independently from the actual model implementation

Parameters
[in]parametersa map of strings (from parameter name to parameter value) including configuration parameters

Definition at line 50 of file FirstOrderLagModel.cpp.

References computeParameters(), dt_s, FOLM_PAR_DT, FOLM_PAR_TAU, GenericEngineModel::parseParameter(), and tau_s.

◆ parseParameter() [1/3]

void GenericEngineModel::parseParameter ( const Parameterised::Map & parameters,
std::string parameter,
double & value )
protectedinherited

Parses a value from the parameter map

Definition at line 32 of file GenericEngineModel.cpp.

References invalid_return< std::string >::value, printParameterError(), and StringUtils::toDouble().

Referenced by FirstOrderLagModel::loadParameters().

Here is the caller graph for this function:

◆ parseParameter() [2/3]

void GenericEngineModel::parseParameter ( const Parameterised::Map & parameters,
std::string parameter,
int & value )
protectedinherited

◆ parseParameter() [3/3]

void GenericEngineModel::parseParameter ( const Parameterised::Map & parameters,
std::string parameter,
std::string & value )
protectedinherited

Definition at line 52 of file GenericEngineModel.cpp.

References invalid_return< std::string >::value.

◆ printParameterError()

void GenericEngineModel::printParameterError ( std::string parameter,
std::string value )
protectedinherited

Prints a parameter error

Definition at line 28 of file GenericEngineModel.cpp.

References className, and invalid_return< std::string >::value.

Referenced by parseParameter(), and parseParameter().

Here is the caller graph for this function:

◆ setMaximumAcceleration()

void GenericEngineModel::setMaximumAcceleration ( double maxAcc)
inherited

Sets maximum acceleration value

Parameters
[in]maximumacceleration in meters per second squared

Definition at line 58 of file GenericEngineModel.cpp.

References maxAcceleration_mpsps.

Referenced by MSCFModel_CC::createVehicleVariables(), and MSCFModel_CC::setParameter().

Here is the caller graph for this function:

◆ setMaximumDeceleration()

void GenericEngineModel::setMaximumDeceleration ( double maxDec)
inherited

Sets maximum deceleration value

Parameters
[in]maximumdeceleration (positive value) in meters per second squared

Definition at line 61 of file GenericEngineModel.cpp.

References maxDeceleration_mpsps.

Referenced by MSCFModel_CC::createVehicleVariables(), and MSCFModel_CC::setParameter().

Here is the caller graph for this function:

◆ setParameter() [1/3]

void FirstOrderLagModel::setParameter ( const std::string parameter,
const std::string & value )
virtual

Sets a single parameter value

Parameters
[in]parameterthe name of the parameter
[in]valuethe value for the parameter

Implements GenericEngineModel.

Definition at line 56 of file FirstOrderLagModel.cpp.

References invalid_return< std::string >::value, and UNUSED_PARAMETER.

◆ setParameter() [2/3]

void FirstOrderLagModel::setParameter ( const std::string parameter,
double value )
virtual

◆ setParameter() [3/3]

void FirstOrderLagModel::setParameter ( const std::string parameter,
int value )
virtual

Implements GenericEngineModel.

Definition at line 69 of file FirstOrderLagModel.cpp.

References invalid_return< std::string >::value, and UNUSED_PARAMETER.

Field Documentation

◆ alpha

double FirstOrderLagModel::alpha
protected

Definition at line 39 of file FirstOrderLagModel.h.

Referenced by computeParameters(), and getRealAcceleration().

◆ className

std::string GenericEngineModel::className
protectedinherited

◆ dt_s

double FirstOrderLagModel::dt_s
protected

◆ maxAcceleration_mpsps

double GenericEngineModel::maxAcceleration_mpsps
protectedinherited

◆ maxDeceleration_mpsps

double GenericEngineModel::maxDeceleration_mpsps
protectedinherited

◆ oneMinusAlpha

double FirstOrderLagModel::oneMinusAlpha
protected

Definition at line 39 of file FirstOrderLagModel.h.

Referenced by computeParameters(), and getRealAcceleration().

◆ tau_s

double FirstOrderLagModel::tau_s
protected

The documentation for this class was generated from the following files: