HOG2
Functions
StatUtil.cpp File Reference
#include "StatUtil.h"
#include <math.h>
#include <cstdio>
Include dependency graph for StatUtil.cpp:

Go to the source code of this file.

Functions

double max (double a, double b)
 
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 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...
 
double averageStatEntries (StatCollection *stats, const char *category, const char *owner)
 
double stdevStatEntries (StatCollection *stats, const char *category, const char *owner)
 

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.

◆ max()

double max ( double  a,
double  b 
)
inline

Definition at line 16 of file StatUtil.cpp.

Referenced by maxStatEntries().

◆ 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.