Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Base class for a statistic that can be pretty-printed. More...
#include <stats.h>
Public Member Functions | |
Stat (absl::string_view name) | |
Stat (absl::string_view name, StatsGroup *group) | |
Also add this stat to the given group. | |
virtual | ~Stat () |
std::string | Name () const |
Only used for display purposes. | |
std::string | StatString () const |
virtual int | Priority () const |
virtual double | Sum () const |
virtual std::string | ValueAsString () const =0 |
Prints information about this statistic. | |
virtual bool | WorthPrinting () const =0 |
Is this stat worth printing? Usually false if nothing was measured. | |
virtual void | Reset ()=0 |
Reset this statistic to the same state as if it was newly created. | |
|
inlineexplicit |
operations_research::Stat::Stat | ( | absl::string_view | name, |
StatsGroup * | group ) |
|
inline |
|
inlinevirtual |
At display, stats are displayed by decreasing priority, then decreasing Sum(), then alphabetical order. Used to group the stats per category (timing, ratio, etc..,).
Reimplemented in operations_research::TimeDistribution.
|
pure virtual |
Reset this statistic to the same state as if it was newly created.
Implemented in operations_research::DistributionStat.
std::string operations_research::Stat::StatString | ( | ) | const |
|
inlinevirtual |
By default return 0 for the sum. This makes it possible to sort stats by decreasing total time.
Reimplemented in operations_research::DistributionStat.
|
pure virtual |
Prints information about this statistic.
Implemented in operations_research::DistributionStat, operations_research::DoubleDistribution, operations_research::IntegerDistribution, operations_research::RatioDistribution, and operations_research::TimeDistribution.
|
pure virtual |
Is this stat worth printing? Usually false if nothing was measured.
Implemented in operations_research::DistributionStat.