class Clock

This class keeps track of the number of generations that have been completed in the system

Public Methods

Clock(int total_gens = 0, double (*damper_fn)(int, int) = sigmoid_time)
Construction: the arguments are:
bool Collapsed()
Check if all the generations wanted and already done
double Damp(double value)
Damp a value according to the current/total generations; the damped returned value goes from 0 (the the beginning) to value (at the end)
int Generation()
See what the current generation is
void NewGeneration()
Increase the generation counter
void SetGenerations(int gens)
Reset the total number of generations
int TotalGenerations()
See what the total number of generations is
double UnDamp(double value)
Damp a value according to the current/total generations; the damped returned value goes from 1 (at the beginning) to value (at the end)

Documentation

This class keeps track of the number of generations that have been completed in the system
Clock(int total_gens = 0, double (*damper_fn)(int, int) = sigmoid_time)
Construction: the arguments are:
Parameters:
total_gens - the total number of generations to do.
damper_fn - returns a floating point value for the time, in the interval [0,1], as a function of the current generation and the total number of generations.

void NewGeneration()
Increase the generation counter

bool Collapsed()
Check if all the generations wanted and already done

void SetGenerations(int gens)
Reset the total number of generations

double Damp(double value)
Damp a value according to the current/total generations; the damped returned value goes from 0 (the the beginning) to value (at the end)

double UnDamp(double value)
Damp a value according to the current/total generations; the damped returned value goes from 1 (at the beginning) to value (at the end)

int Generation()
See what the current generation is

int TotalGenerations()
See what the total number of generations is


This class has no child classes.



this page was generated by


Joao Pedro Pedroso
Oct 21, 1997