HOG2
Functions
StatUtil.h File Reference
#include "StatCollection.h"
Include dependency graph for StatUtil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void setupAverageRatio (StatCollection *stats, char *stat1, char *stat2)
 Setup the stats so a ratio between two stats for each unit can be properly measured. More...
 
void measureAverageRatio (StatCollection *stats)
 Measures the ration between the two stats set-up from setupAverageRatio. More...
 
double SumStatEntries (StatCollection *stats, const char *category, const char *owner)
 Sum the values of all stat entries for the same (category, owner). More...
 
double averageStatEntries (StatCollection *stats, const char *category, const char *owner)
 
double stdevStatEntries (StatCollection *stats, const char *category, const char *owner)
 
double maxStatEntries (StatCollection *stats, const char *category, const char *owner)
 
long unsigned countStatEntries (StatCollection *stats, const char *category, const char *owner)
 Count the number of state instances in the stat collection. More...
 

Function Documentation

◆ averageStatEntries()

double averageStatEntries ( StatCollection stats,
const char *  category,
const char *  owner 
)

◆ countStatEntries()

long unsigned countStatEntries ( StatCollection stats,
const char *  category,
const char *  owner 
)

Count the number of state instances in the stat collection.

Definition at line 182 of file StatUtil.cpp.

References statistics::category, StatCollection::GetNumStats(), StatCollection::GetStatNum(), StatCollection::LookupCategory(), StatCollection::LookupOwner(), and statistics::owner.

◆ maxStatEntries()

double maxStatEntries ( StatCollection stats,
const char *  category,
const char *  owner 
)

◆ measureAverageRatio()

void measureAverageRatio ( StatCollection stats)

◆ setupAverageRatio()

void setupAverageRatio ( StatCollection stats,
char *  stat1,
char *  stat2 
)

Setup the stats so a ratio between two stats for each unit can be properly measured.

Definition at line 23 of file StatUtil.cpp.

References StatCollection::AddIncludeFilter(), StatCollection::ClearAllStats(), and StatCollection::ClearFilters().

◆ stdevStatEntries()

double stdevStatEntries ( StatCollection stats,
const char *  category,
const char *  owner 
)

◆ SumStatEntries()

double SumStatEntries ( StatCollection stats,
const char *  category,
const char *  owner 
)

Sum the values of all stat entries for the same (category, owner).

Type is automatically known from the entry.

Definition at line 140 of file StatUtil.cpp.

References statistics::category, floatStored, statValue::fval, StatCollection::GetNumStats(), StatCollection::GetStatNum(), StatCollection::LookupCategory(), StatCollection::LookupOwner(), statValue::lval, statistics::owner, statistics::sType, and statistics::value.