GoHistory

Name

GoHistory -- track the development of a player's strength in time

Synopsis


#include <go-history.h>


struct      GoHistory;
GtkObject*  go_history_new                  (double *strength_ptr);
void        go_history_set_length           (GoHistory *self,
                                             int n);
void        go_history_increase_length      (GoHistory *self);
double      go_history_get_strength         (GoHistory *self,
                                             int i);
double      go_history_probability          (GoHistory *self);
double      go_history_compensator          (GoHistory *self);
void        go_history_write_back           (GoHistory *self);

Object Hierarchy


  GtkObject
   +----GoHistory

Signal Prototypes


"add-parameter"
            void        user_function      (GoHistory *gohistory,
                                            gpointer arg1,
                                            gpointer user_data);
"remove-parameter"
            void        user_function      (GoHistory *gohistory,
                                            gpointer arg1,
                                            gpointer user_data);

Description

Objects of this class are used by GoStrengths to track the development of a player's strength in time.

Details

struct GoHistory

struct GoHistory;


go_history_new ()

GtkObject*  go_history_new                  (double *strength_ptr);

Allocate a new GoHistory object to track the value at strength_ptr. The history length is set to 0. You must call set_length() to increase it.

strength_ptr : a pointer to the player's strength value
Returns : a new GoHistory object


go_history_set_length ()

void        go_history_set_length           (GoHistory *self,
                                             int n);

Set the number of games in the record.

self : a GoHistory object
n : the new history length


go_history_increase_length ()

void        go_history_increase_length      (GoHistory *self);

Increase the number of games in the record by one.

self : a GoHistory object


go_history_get_strength ()

double      go_history_get_strength         (GoHistory *self,
                                             int i);

Get the strength value recorded for game number i.

self : a GoHistory object
i : the game index
Returns : the player's strength


go_history_probability ()

double      go_history_probability          (GoHistory *self);

Estimate the likelihood of the currently stored data.

self : a GoHistory object
Returns : the probability


go_history_compensator ()

double      go_history_compensator          (GoHistory *self);

Return a typical mean value for the return value of probability(). The result does not depend on the current parameter settings, but it may depend on the number of games stored.

self : a GoHistory object
Returns : the mean probability


go_history_write_back ()

void        go_history_write_back           (GoHistory *self);

Write back the current player strength from the GoHistory object self to the original location.

self : a GoHistory object

Signals

The "add-parameter" signal

void        user_function                  (GoHistory *gohistory,
                                            gpointer arg1,
                                            gpointer user_data);

gohistory :the object which received the signal.
arg1 : 
user_data :user data set when the signal handler was connected.


The "remove-parameter" signal

void        user_function                  (GoHistory *gohistory,
                                            gpointer arg1,
                                            gpointer user_data);

gohistory :the object which received the signal.
arg1 : 
user_data :user data set when the signal handler was connected.