SimDriver  0.1
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
agent_model::VelocityHorizon Class Reference

A class to store the internal horizon. More...

#include <VelocityHorizon.h>

Classes

struct  PredictionPoint
 A class store a prediction point. More...
 

Public Member Functions

void init (double offset, unsigned int noOfElements)
 
void update (double s)
 Updates the horizon to the new reference position Removes all elements with a distance smaller than zero, except of the first one smaller than zero. More...
 
unsigned int getIndexBefore (double s)
 
unsigned int getIndexAfter (double s)
 
void setMaxVelocity (double v)
 
void resetSpeedRule ()
 
void updateSpeedRuleInInterval (double s0, double s1, double v)
 
void updateContinuousPoint (double s, double v)
 
double mean (double s0, double s1, double delta=1.0)
 

Protected Member Functions

double getSpeedAt (unsigned int i)
 
PredictionPoint newPoint (size_t i)
 

Protected Attributes

double _offset
 
double _vMax
 
std::deque< PredictionPoint_elements {}
 

Detailed Description

A class to store the internal horizon.

Member Function Documentation

◆ getIndexAfter()

unsigned int agent_model::VelocityHorizon::getIndexAfter ( double  s)
inline

Returns the index of the end point of the interval in which the position is

Parameters
sPosition to be searched
Returns
Index of the interval

◆ getIndexBefore()

unsigned int agent_model::VelocityHorizon::getIndexBefore ( double  s)
inline

Returns the index of the start point of the interval in which the position is

Parameters
sPosition to be searched
Returns
Index of the interval

◆ getSpeedAt()

double agent_model::VelocityHorizon::getSpeedAt ( unsigned int  i)
inlineprotected

Returns the minimum of the speed at the given index

Parameters
iIndex
Returns
Minimum speed

◆ init()

void agent_model::VelocityHorizon::init ( double  offset,
unsigned int  noOfElements 
)
inline

Initializes the points container

Parameters
offsetPosition offset of the horizon
noOfElementsNumber of elements to be stored

◆ mean()

double agent_model::VelocityHorizon::mean ( double  s0,
double  s1,
double  delta = 1.0 
)
inline

Calculates the mean speed within the given interval

Parameters
s0Start of the interval
s1End of the interval
deltaA factor shifting the influence over the interval
Returns
The mean value

◆ newPoint()

PredictionPoint agent_model::VelocityHorizon::newPoint ( size_t  i)
inlineprotected

Creates a new point with the given index at the given position

Parameters
iIndex of the point
Returns
The new point

◆ resetSpeedRule()

void agent_model::VelocityHorizon::resetSpeedRule ( )
inline

Resets the set speed rules

◆ setMaxVelocity()

void agent_model::VelocityHorizon::setMaxVelocity ( double  v)
inline

Updates the maximum total velocity

Parameters
vVelocity to be set

◆ update()

void agent_model::VelocityHorizon::update ( double  s)
inline

Updates the horizon to the new reference position Removes all elements with a distance smaller than zero, except of the first one smaller than zero.

Parameters
sNew reference position

◆ updateContinuousPoint()

void agent_model::VelocityHorizon::updateContinuousPoint ( double  s,
double  v 
)
inline

Updates the continuous velocity profile at the given point

Parameters
sPoint to be set
vVelocity to be set

◆ updateSpeedRuleInInterval()

void agent_model::VelocityHorizon::updateSpeedRuleInInterval ( double  s0,
double  s1,
double  v 
)
inline

Updates the speed in the given interval if the speed is smaller than the already set speed

Parameters
s0Start of the interval
s1End of the interval
vVelocity to be set

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