Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GenericEngineModel Class Referenceabstract

#include <GenericEngineModel.h>

Inheritance diagram for GenericEngineModel:
[legend]

Public Member Functions

 GenericEngineModel ()
 constructor
 
virtual double getRealAcceleration (double speed_mps, double accel_mps2, double reqAccel_mps2, SUMOTime timeStep=0)=0
 
void setMaximumAcceleration (double maxAcc)
 
void setMaximumDeceleration (double maxDec)
 
virtual void setParameter (const std::string parameter, const std::string &value)=0
 
virtual void setParameter (const std::string parameter, double value)=0
 
virtual void setParameter (const std::string parameter, int value)=0
 
virtual ~GenericEngineModel ()
 destructor
 

Protected Member Functions

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

std::string className
 
double maxAcceleration_mpsps
 
double maxDeceleration_mpsps
 

Detailed Description

This is an interface for plexe engine models. It provides two virtual methods that should be overridden by implementing classes: getRealAcceleration and loadParameters

Definition at line 34 of file GenericEngineModel.h.

Constructor & Destructor Documentation

◆ GenericEngineModel()

GenericEngineModel::GenericEngineModel ( )
inline

constructor

Definition at line 38 of file GenericEngineModel.h.

◆ ~GenericEngineModel()

virtual GenericEngineModel::~GenericEngineModel ( )
inlinevirtual

destructor

Definition at line 41 of file GenericEngineModel.h.

Member Function Documentation

◆ getRealAcceleration()

virtual double GenericEngineModel::getRealAcceleration ( double  speed_mps,
double  accel_mps2,
double  reqAccel_mps2,
SUMOTime  timeStep = 0 
)
pure 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

Implemented in FirstOrderLagModel, and RealisticEngineModel.

Referenced by MSCFModel_CC::finalizeSpeed().

Here is the caller graph for this function:

◆ parseParameter() [1/3]

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

Parses a value from the parameter map

Definition at line 32 of file GenericEngineModel.cpp.

References 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 
)
protected

Definition at line 42 of file GenericEngineModel.cpp.

References printParameterError(), and StringUtils::toInt().

◆ parseParameter() [3/3]

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

Definition at line 52 of file GenericEngineModel.cpp.

◆ printParameterError()

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

Prints a parameter error

Definition at line 28 of file GenericEngineModel.cpp.

References className.

Referenced by parseParameter(), and parseParameter().

Here is the caller graph for this function:

◆ setMaximumAcceleration()

void GenericEngineModel::setMaximumAcceleration ( double  maxAcc)

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)

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]

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

Sets a single parameter value

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

Implemented in FirstOrderLagModel, and RealisticEngineModel.

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

Here is the caller graph for this function:

◆ setParameter() [2/3]

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

◆ setParameter() [3/3]

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

Field Documentation

◆ className

std::string GenericEngineModel::className
protected

◆ maxAcceleration_mpsps

double GenericEngineModel::maxAcceleration_mpsps
protected

◆ maxDeceleration_mpsps

double GenericEngineModel::maxDeceleration_mpsps
protected

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