SUMO - Simulation of Urban MObility
TrackerValueDesc Class Reference

Representation of a timeline of floats with their names and moments. More...

#include <TrackerValueDesc.h>

Inheritance diagram for TrackerValueDesc:
ValueRetriever< SUMOReal >

Public Member Functions

void addValue (SUMOReal value)
 Adds a new value to the list. More...
 
const std::vector< SUMOReal > & getAggregatedValues ()
 returns the vector of aggregated values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called More...
 
SUMOTime getAggregationSpan () const
 get the aggregation amount More...
 
const RGBColorgetColor () const
 Returns the color to use to display the value. More...
 
SUMOReal getMax () const
 Returns the values maximum. More...
 
SUMOReal getMin () const
 Returns the values minimum. More...
 
const std::string & getName () const
 Returns the name of the value. More...
 
SUMOReal getRange () const
 returns the maximum value range More...
 
SUMOTime getRecordingBegin () const
 Returns the timestep the recording started. More...
 
const std::vector< SUMOReal > & getValues ()
 returns the vector of collected values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called More...
 
SUMOReal getYCenter () const
 Returns the center of the value. More...
 
void setAggregationSpan (SUMOTime as)
 set the aggregation amount More...
 
 TrackerValueDesc (const std::string &name, const RGBColor &col, SUMOTime recordBegin)
 Constructor. More...
 
void unlockValues ()
 Releases the locking after the values have been drawn. More...
 
 ~TrackerValueDesc ()
 Destructor. More...
 

Private Attributes

RGBColor myActiveCol
 The color to use when the value is set as "active". More...
 
std::vector< SUMORealmyAggregatedValues
 Collected values in their aggregated form. More...
 
int myAggregationInterval
 The aggregation interval in simulation steps. More...
 
RGBColor myInactiveCol
 The color to use when the value is set as "inactive". More...
 
SUMOReal myInvalidValue
 Values like this shall not be counted on aggregation. More...
 
MFXMutex myLock
 
SUMOReal myMax
 
SUMOReal myMin
 The minimum and the maximum of the value. More...
 
std::string myName
 The name of the value. More...
 
SUMOTime myRecordingBegin
 The time step the values are added from. More...
 
SUMOReal myTmpLastAggValue
 Temporary storage for the last aggregation interval. More...
 
size_t myValidNo
 Counter for valid numbers within the current aggregation interval. More...
 
std::vector< SUMORealmyValues
 Values collected. More...
 

Detailed Description

Representation of a timeline of floats with their names and moments.

This class contains the information needed to display a time line of float values.

Definition at line 51 of file TrackerValueDesc.h.

Constructor & Destructor Documentation

TrackerValueDesc::TrackerValueDesc ( const std::string &  name,
const RGBColor col,
SUMOTime  recordBegin 
)

Constructor.

Definition at line 46 of file TrackerValueDesc.cpp.

TrackerValueDesc::~TrackerValueDesc ( )

Destructor.

Definition at line 55 of file TrackerValueDesc.cpp.

References MFXMutex::locked(), myLock, and MFXMutex::unlock().

Member Function Documentation

void TrackerValueDesc::addValue ( SUMOReal  value)
virtual

Adds a new value to the list.

Implements ValueRetriever< SUMOReal >.

Definition at line 64 of file TrackerValueDesc.cpp.

References myAggregatedValues, myAggregationInterval, myInvalidValue, myLock, myMax, myMin, myTmpLastAggValue, myValidNo, myValues, and SUMOReal.

const std::vector< SUMOReal > & TrackerValueDesc::getAggregatedValues ( )

returns the vector of aggregated values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called

Definition at line 129 of file TrackerValueDesc.cpp.

References MFXMutex::lock(), myAggregatedValues, and myLock.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUIParameterTracker::onCmdSave().

SUMOTime TrackerValueDesc::getAggregationSpan ( ) const

get the aggregation amount

Definition at line 175 of file TrackerValueDesc.cpp.

References DELTA_T, and myAggregationInterval.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().

const RGBColor & TrackerValueDesc::getColor ( ) const

Returns the color to use to display the value.

Definition at line 116 of file TrackerValueDesc.cpp.

References myActiveCol.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().

SUMOReal TrackerValueDesc::getMax ( ) const

Returns the values maximum.

Definition at line 104 of file TrackerValueDesc.cpp.

References myMax.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().

SUMOReal TrackerValueDesc::getMin ( ) const

Returns the values minimum.

Definition at line 98 of file TrackerValueDesc.cpp.

References myMin.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().

const std::string & TrackerValueDesc::getName ( ) const

Returns the name of the value.

Definition at line 136 of file TrackerValueDesc.cpp.

References myName.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUIParameterTracker::onCmdSave().

SUMOReal TrackerValueDesc::getRange ( ) const

returns the maximum value range

Definition at line 92 of file TrackerValueDesc.cpp.

References myMax, and myMin.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().

SUMOTime TrackerValueDesc::getRecordingBegin ( ) const

Returns the timestep the recording started.

Definition at line 181 of file TrackerValueDesc.cpp.

References myRecordingBegin.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().

const std::vector< SUMOReal > & TrackerValueDesc::getValues ( )

returns the vector of collected values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called

Definition at line 122 of file TrackerValueDesc.cpp.

References MFXMutex::lock(), myLock, and myValues.

SUMOReal TrackerValueDesc::getYCenter ( ) const

Returns the center of the value.

Definition at line 110 of file TrackerValueDesc.cpp.

References myMax, and myMin.

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().

void TrackerValueDesc::setAggregationSpan ( SUMOTime  as)

set the aggregation amount

Definition at line 147 of file TrackerValueDesc.cpp.

References DELTA_T, myAggregatedValues, myAggregationInterval, myInvalidValue, myLock, myTmpLastAggValue, myValidNo, and myValues.

void TrackerValueDesc::unlockValues ( )

Releases the locking after the values have been drawn.

Definition at line 141 of file TrackerValueDesc.cpp.

References myLock, and MFXMutex::unlock().

Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUIParameterTracker::onCmdSave().

Field Documentation

RGBColor TrackerValueDesc::myActiveCol
private

The color to use when the value is set as "active".

Definition at line 109 of file TrackerValueDesc.h.

Referenced by getColor().

std::vector<SUMOReal> TrackerValueDesc::myAggregatedValues
private

Collected values in their aggregated form.

Definition at line 118 of file TrackerValueDesc.h.

Referenced by addValue(), getAggregatedValues(), and setAggregationSpan().

int TrackerValueDesc::myAggregationInterval
private

The aggregation interval in simulation steps.

Definition at line 127 of file TrackerValueDesc.h.

Referenced by addValue(), getAggregationSpan(), and setAggregationSpan().

RGBColor TrackerValueDesc::myInactiveCol
private

The color to use when the value is set as "inactive".

Definition at line 112 of file TrackerValueDesc.h.

SUMOReal TrackerValueDesc::myInvalidValue
private

Values like this shall not be counted on aggregation.

Definition at line 130 of file TrackerValueDesc.h.

Referenced by addValue(), and setAggregationSpan().

MFXMutex TrackerValueDesc::myLock
private
SUMOReal TrackerValueDesc::myMax
private

Definition at line 121 of file TrackerValueDesc.h.

Referenced by addValue(), getMax(), getRange(), and getYCenter().

SUMOReal TrackerValueDesc::myMin
private

The minimum and the maximum of the value.

Definition at line 121 of file TrackerValueDesc.h.

Referenced by addValue(), getMin(), getRange(), and getYCenter().

std::string TrackerValueDesc::myName
private

The name of the value.

Definition at line 106 of file TrackerValueDesc.h.

Referenced by getName().

SUMOTime TrackerValueDesc::myRecordingBegin
private

The time step the values are added from.

Definition at line 136 of file TrackerValueDesc.h.

Referenced by getRecordingBegin().

SUMOReal TrackerValueDesc::myTmpLastAggValue
private

Temporary storage for the last aggregation interval.

Definition at line 139 of file TrackerValueDesc.h.

Referenced by addValue(), and setAggregationSpan().

size_t TrackerValueDesc::myValidNo
private

Counter for valid numbers within the current aggregation interval.

Definition at line 133 of file TrackerValueDesc.h.

Referenced by addValue(), and setAggregationSpan().

std::vector<SUMOReal> TrackerValueDesc::myValues
private

Values collected.

Definition at line 115 of file TrackerValueDesc.h.

Referenced by addValue(), getValues(), and setAggregationSpan().


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