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.
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
SUMOTime getAggregationSpan () const
 get the aggregation amount
const RGBColorgetColor () const
 Returns the color to use to display the value.
SUMOReal getMax () const
 Returns the values maximum.
SUMOReal getMin () const
 Returns the values minimum.
const std::string & getName () const
 Returns the name of the value.
SUMOReal getRange () const
 returns the maximum value range
SUMOTime getRecordingBegin () const
 Returns the timestep the recording started.
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
SUMOReal getYCenter () const
 Returns the center of the value.
void setAggregationSpan (SUMOTime as)
 set the aggregation amount
 TrackerValueDesc (const std::string &name, const RGBColor &col, SUMOTime recordBegin)
 Constructor.
void unlockValues ()
 Releases the locking after the values have been drawn.
 ~TrackerValueDesc ()
 Destructor.

Private Attributes

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

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.

Destructor.

Definition at line 55 of file TrackerValueDesc.cpp.

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


Member Function Documentation

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 130 of file TrackerValueDesc.cpp.

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

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

get the aggregation amount

Definition at line 177 of file TrackerValueDesc.cpp.

References DELTA_T, and myAggregationInterval.

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

Returns the color to use to display the value.

Definition at line 117 of file TrackerValueDesc.cpp.

References myActiveCol.

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

Returns the values maximum.

Definition at line 105 of file TrackerValueDesc.cpp.

References myMax.

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

Returns the values minimum.

Definition at line 99 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 137 of file TrackerValueDesc.cpp.

References myName.

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

returns the maximum value range

Definition at line 93 of file TrackerValueDesc.cpp.

References myMax, and myMin.

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

Returns the timestep the recording started.

Definition at line 183 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 123 of file TrackerValueDesc.cpp.

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

Returns the center of the value.

Definition at line 111 of file TrackerValueDesc.cpp.

References myMax, and myMin.

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

Releases the locking after the values have been drawn.

Definition at line 142 of file TrackerValueDesc.cpp.

References myLock, and MFXMutex::unlock().

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


Field Documentation

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

Definition at line 109 of file TrackerValueDesc.h.

Referenced by getColor().

Collected values in their aggregated form.

Definition at line 118 of file TrackerValueDesc.h.

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

The aggregation interval in simulation steps.

Definition at line 127 of file TrackerValueDesc.h.

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

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

Definition at line 112 of file TrackerValueDesc.h.

Values like this shall not be counted on aggregation.

Definition at line 130 of file TrackerValueDesc.h.

Referenced by addValue(), and setAggregationSpan().

Definition at line 121 of file TrackerValueDesc.h.

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

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().

The time step the values are added from.

Definition at line 136 of file TrackerValueDesc.h.

Referenced by getRecordingBegin().

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:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines