SIMLIB/C++ 3.09
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
simlib3::Stat Class Reference

class for statistical information gathering More...

#include <simlib.h>

Inheritance diagram for simlib3::Stat:
Inheritance graph
[legend]
Collaboration diagram for simlib3::Stat:
Collaboration graph
[legend]

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
 
virtual void Output () const
 print object to default output
 

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 563 of file simlib.h.

Constructor & Destructor Documentation

◆ Stat() [1/2]

simlib3::Stat::Stat ( )

Definition at line 58 of file stat.cc.

References Dprintf.

◆ Stat() [2/2]

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

Definition at line 49 of file stat.cc.

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

◆ ~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::Queue::clear(), and simlib3::Histogram::Clear().

◆ Max()

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

Definition at line 581 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(), StatNoRecError, and sx.

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

◆ Min()

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

Definition at line 580 of file simlib.h.

References min.

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

◆ Number()

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

Definition at line 579 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(), StatDispError, sx, and sx2.

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

◆ Sum()

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

Definition at line 582 of file simlib.h.

References sx.

◆ SumSquare()

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

Definition at line 583 of file simlib.h.

References sx2.

Member Data Documentation

◆ max

double simlib3::Stat::max
protected

Definition at line 568 of file simlib.h.

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

◆ min

double simlib3::Stat::min
protected

Definition at line 567 of file simlib.h.

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

◆ n

unsigned long simlib3::Stat::n
protected

Definition at line 569 of file simlib.h.

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

◆ sx

double simlib3::Stat::sx
protected

Definition at line 565 of file simlib.h.

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

◆ sx2

double simlib3::Stat::sx2
protected

Definition at line 566 of file simlib.h.

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


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