SIMLIB/C++ 3.09
Loading...
Searching...
No Matches
simlib3::Stat Class Reference

class for statistical information gathering More...

#include <simlib.h>

Inheritance diagram for simlib3::Stat:
Collaboration diagram for simlib3::Stat:

Public Member Functions

 Stat ()
 Stat (const char *name)
 ~Stat ()
virtual void Clear ()
 initialize
void operator() (double x)
 record the value
virtual void Output () const override
 print statistics
unsigned long Number () const
double Min () const
double Max () const
double Sum () const
double SumSquare () const
double MeanValue () const
double StdDev () const
Public Member Functions inherited from simlib3::SimObject
bool TestAndSetFlag (bool new_value, unsigned n)
 internal method for flag manipulation is used for algebraic loop checking in continuous blocks
 SimObject ()
 constructor
virtual ~SimObject ()
 virtual destructor
void * operator new (size_t size)
 allocate object, set _flags
void operator delete (void *ptr)
 deallocate object
void * operator new[] (size_t size)=delete
void operator delete[] (void *ptr)=delete
bool isAllocated () const
virtual std::string Name () const
 get object name
bool HasName () const
void SetName (const std::string &name)
 assign the name

Protected Attributes

double sx
double sx2
double min
double max
unsigned long n
Protected Attributes inherited from simlib3::SimObject
unsigned _flags
 bool flags for internal use (TODO bitfield?)

Additional Inherited Members

Public Types inherited from simlib3::SimObject
enum  _Flags { _CLEAR_ALL_FLAGS = 0 , _ALLOCATED_FLAG = 1<<0 , _EVAL_FLAG = 1<<1 , _HAS_NAME_FLAG = 1<<2 }

Detailed Description

class for statistical information gathering

Definition at line 568 of file simlib.h.

Constructor & Destructor Documentation

◆ Stat() [1/2]

simlib3::Stat::Stat ( )

Definition at line 58 of file stat.cc.

References Dprintf, max, min, n, sx, and sx2.

◆ Stat() [2/2]

simlib3::Stat::Stat ( const char * name)
explicit

Definition at line 49 of file stat.cc.

References Dprintf, max, min, n, simlib3::SimObject::SetName(), sx, and sx2.

◆ ~Stat()

simlib3::Stat::~Stat ( )

Definition at line 69 of file stat.cc.

References Dprintf, and simlib3::SimObject::Name().

Member Function Documentation

◆ Clear()

void simlib3::Stat::Clear ( )
virtual

initialize

Definition at line 77 of file stat.cc.

References max, min, n, sx, and sx2.

Referenced by simlib3::Histogram::Clear(), and simlib3::Queue::clear().

◆ Max()

double simlib3::Stat::Max ( ) const
inline

Definition at line 586 of file simlib.h.

References max.

Referenced by simlib3::Queue::Output().

◆ MeanValue()

double simlib3::Stat::MeanValue ( ) const

Definition at line 88 of file stat.cc.

References n, simlib3::SIMLIB_error(), simlib3::StatNoRecError, and sx.

Referenced by simlib3::Queue::Output(), and Output().

◆ Min()

double simlib3::Stat::Min ( ) const
inline

Definition at line 585 of file simlib.h.

References min.

Referenced by simlib3::Queue::Output().

◆ Number()

unsigned long simlib3::Stat::Number ( ) const
inline

Definition at line 584 of file simlib.h.

References n.

Referenced by simlib3::Queue::Output().

◆ operator()()

void simlib3::Stat::operator() ( double x)

record the value

Definition at line 34 of file stat.cc.

References max, min, n, sx, and sx2.

◆ Output()

void simlib3::Stat::Output ( ) const
overridevirtual

print statistics

Reimplemented from simlib3::SimObject.

Definition at line 166 of file output2.cc.

References max, MeanValue(), min, n, simlib3::SimObject::Name(), simlib3::Print(), and StdDev().

Referenced by simlib3::Histogram::Output().

◆ StdDev()

double simlib3::Stat::StdDev ( ) const

Definition at line 97 of file stat.cc.

References n, simlib3::SIMLIB_error(), simlib3::StatDispError, sx, and sx2.

Referenced by simlib3::Queue::Output(), and Output().

◆ Sum()

double simlib3::Stat::Sum ( ) const
inline

Definition at line 587 of file simlib.h.

References sx.

◆ SumSquare()

double simlib3::Stat::SumSquare ( ) const
inline

Definition at line 588 of file simlib.h.

References sx2.

Member Data Documentation

◆ max

double simlib3::Stat::max
protected

Definition at line 573 of file simlib.h.

Referenced by Clear(), Max(), operator()(), Output(), Stat(), and Stat().

◆ min

double simlib3::Stat::min
protected

Definition at line 572 of file simlib.h.

Referenced by Clear(), Min(), operator()(), Output(), Stat(), and Stat().

◆ n

unsigned long simlib3::Stat::n
protected

Definition at line 574 of file simlib.h.

Referenced by Clear(), MeanValue(), Number(), operator()(), Output(), Stat(), Stat(), and StdDev().

◆ sx

double simlib3::Stat::sx
protected

Definition at line 570 of file simlib.h.

Referenced by Clear(), MeanValue(), operator()(), Stat(), Stat(), StdDev(), and Sum().

◆ sx2

double simlib3::Stat::sx2
protected

Definition at line 571 of file simlib.h.

Referenced by Clear(), operator()(), Stat(), Stat(), StdDev(), and SumSquare().


The documentation for this class was generated from the following files: