Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Statistics Class Reference

The class does some statistics on the number of individuals drawn. More...

#include <BB2004Evo.h>

List of all members.

Public Member Functions

 Statistics (int size)
 Constructor.

 ~Statistics ()
 Destructor.

void reset ()
 The function empties the histogram.

void add (int index)
 The function adds a single entry to the histogram.

int analyze ()
 The function analyzes the histogram and brings it into a compact form.

int operator[] (int index) const
 The operator allows for accessing the entries in the histogram.


Static Private Member Functions

int compare (const int *i1, const int *i2)
 The function compares two integers as required for qsort.


Private Attributes

int size
 The number of entries in the histogram.

int * stats
 A histogram that counts how often each individual was drawn.


Detailed Description

The class does some statistics on the number of individuals drawn.

Definition at line 63 of file BB2004Evo.h.


Constructor & Destructor Documentation

Statistics::Statistics int  size  )  [inline]
 

Constructor.

Parameters:
size The number of entries in the histogram.

Definition at line 86 of file BB2004Evo.h.

References reset(), and stats.

Here is the call graph for this function:

Statistics::~Statistics  )  [inline]
 

Destructor.

Definition at line 96 of file BB2004Evo.h.

References stats.


Member Function Documentation

int Statistics::compare const int *  i1,
const int *  i2
[inline, static, private]
 

The function compares two integers as required for qsort.

Parameters:
i1 The address of the first integer.
i2 The address of the second integer.
Returns:
-1 if the first integer is larger, 1 if it smaller, otherwise 0. Results in a descending order.

Definition at line 76 of file BB2004Evo.h.

void Statistics::reset  )  [inline]
 

The function empties the histogram.

Definition at line 101 of file BB2004Evo.h.

References stats.

Referenced by BBPopulation< CalibrationIndividual >::extrapolate(), BBPopulation< CalibrationIndividual >::interpolate(), and Statistics().

void Statistics::add int  index  )  [inline]
 

The function adds a single entry to the histogram.

Parameters:
index The index of the entry that is incremented by 1.

Definition at line 111 of file BB2004Evo.h.

References stats.

Referenced by BBPopulation< CalibrationIndividual >::drawIndividual().

int Statistics::analyze  )  [inline]
 

The function analyzes the histogram and brings it into a compact form.

It removes all empty entries and sorts the others in descending order. Please note that the function destoys the data in the histogram.

Returns:
The number of entries remaining.

Definition at line 119 of file BB2004Evo.h.

References stats.

Referenced by BB2004Calibrator::evolve(), and BB2004InvKinWalkingEngine::learn().

int Statistics::operator[] int  index  )  const [inline]
 

The operator allows for accessing the entries in the histogram.

Parameters:
index The index of the entry to return.
Returns:
The entry of the histogram with the given entry.

Definition at line 135 of file BB2004Evo.h.

References stats.


Member Data Documentation

int Statistics::size [private]
 

The number of entries in the histogram.

Definition at line 66 of file BB2004Evo.h.

int* Statistics::stats [private]
 

A histogram that counts how often each individual was drawn.

Definition at line 67 of file BB2004Evo.h.

Referenced by add(), analyze(), operator[](), reset(), Statistics(), and ~Statistics().


The documentation for this class was generated from the following file:
Generated on Thu Sep 23 20:11:56 2004 for GT2004 by doxygen 1.3.6