SoftBank Robotics documentation What's new in NAOqi 2.8?

qi::stats namespace

Reference

qi::MinMaxSum Class Reference

Introduction

Stores min, max and sum of values fed to it. More...

Public Functions

MinMaxSum()
MinMaxSum(float minValue, float maxValue, float cumulatedValue)
const float& minValue() const
const float& maxValue() const
const float& cumulatedValue() const
void push(float val, bool init)
void reset()
std::string asString(unsigned int count) const

Detailed Description

Stores min, max and sum of values fed to it.

Function Documentation

qi::MinMaxSum::MinMaxSum()

Default constructor.

qi::MinMaxSum::MinMaxSum(float minValue, float maxValue, float cumulatedValue)

Brief: Constructor.

Parameters:
  • minValue – Minimum value.
  • maxValue – Maximum value.
  • cumulatedValue – Sum of all value add to the class.
const float& qi::MinMaxSum::minValue() const

Get minimum value.

const float& qi::MinMaxSum::maxValue() const

Get maximum value.

const float& qi::MinMaxSum::cumulatedValue() const

Get sum of all value push value.

void qi::MinMaxSum::push(float val, bool init = false)

Brief: Push a new value, process new min/max and add the value to cumulated.

Parameters:
  • val – New value.
  • init – If true init min, max, cumulated to val
void qi::MinMaxSum::reset()

Reset all three values to 0.

std::string qi::MinMaxSum::asString(unsigned int count) const

Brief: asString Get a string from min, max and cumulated.

Parameters:
  • count – Devide cumulated by count.
Returns:

A string with format (cumulated / count), min and max In this order separated by space.

qi::MethodStatistics Class Reference

Introduction

Store statistics about method calls. More...

Public Functions

MethodStatistics()
MethodStatistics(unsigned int count, MinMaxSum wall, MinMaxSum user, MinMaxSum system)
void push(float wall, float user, float system)
const MinMaxSum& wall() const
const MinMaxSum& user() const
const MinMaxSum& system() const
unsigned int& count() const
void reset()

Detailed Description

Store statistics about method calls.

Function Documentation

qi::MethodStatistics::MethodStatistics()

Constructor.

qi::MethodStatistics::MethodStatistics(unsigned int count, MinMaxSum wall, MinMaxSum user, MinMaxSum system)

Brief: Constructor and Set.

Parameters:
  • count – Number of value added.
  • wall – Wall statistics.
  • user – User statistics.
  • system – System statistics.
void qi::MethodStatistics::push(float wall, float user, float system)

Brief: Add value for all tree statistics values.

Parameters:
  • wall – Value to add to wall statistics.
  • user – Value to add to user statistics.
  • system – Value to add to system statistics.

If it’s the fist time that push is call, min, max and cumulated will be set to the value added.

const MinMaxSum& qi::MethodStatistics::wall() const

Brief: Get wall MinMaxSum value.

Returns:Return MinMaxSum value.
const MinMaxSum& qi::MethodStatistics::user() const

Brief: Get user MinMaxSum value.

Returns:Return MinMaxSum value.
const MinMaxSum& qi::MethodStatistics::system() const

Brief: Get system MinMaxSum value.

Returns:Return MinMaxSum value.
unsigned int& qi::MethodStatistics::count() const

Brief: Get number of value added.

Returns:Return number of value pushed.
void qi::MethodStatistics::reset()

Reset all value to 0 (count and MinMaxSum of all 3 statistics values)