92 const bool print_act,
const bool print_pred);
99 const double *y,
const int set_num,
const bool cur);
107 const bool return_cond,
const bool return_act,
108 const bool return_pred);
double cl_pred_size(const struct XCSF *xcsf, const struct Cl *c)
Returns the size of a classifier's prediction.
double cl_mfrac(const struct XCSF *xcsf, const struct Cl *c)
Returns the fraction of observed inputs matched by a classifier.
void cl_init(const struct XCSF *xcsf, struct Cl *c, const double size, const int time)
Initialises a new classifier - but not condition, action, prediction.
bool cl_m(const struct XCSF *xcsf, const struct Cl *c)
Returns whether a classifier matched the most recent input.
double cl_cond_size(const struct XCSF *xcsf, const struct Cl *c)
Returns the size of a classifier's condition.
void cl_rand(const struct XCSF *xcsf, struct Cl *c)
Initialises random actions, conditions and predictions.
void cl_update(const struct XCSF *xcsf, struct Cl *c, const double *x, const double *y, const int set_num, const bool cur)
Updates a classifier's experience, error, and set size.
void cl_update_fit(const struct XCSF *xcsf, struct Cl *c, const double acc_sum, const double acc)
Updates the fitness of a classifier.
int cl_action(const struct XCSF *xcsf, struct Cl *c, const double *x)
Computes the current classifier action using the input.
const double * cl_predict(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Computes the current classifier prediction using the input.
char * cl_json_export(const struct XCSF *xcsf, const struct Cl *c, const bool return_cond, const bool return_act, const bool return_pred)
Returns a json formatted string representation of a classifier.
bool cl_general(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Returns whether classifier c1 is more general than c2.
void cl_init_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Initialises and creates a copy of one classifier from another.
bool cl_match(const struct XCSF *xcsf, struct Cl *c, const double *x)
Calculates whether a classifier matches an input.
bool cl_mutate(const struct XCSF *xcsf, const struct Cl *c)
Performs classifier mutation.
size_t cl_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
Writes a classifier to a file.
void cl_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Copies condition, action, and prediction structures.
size_t cl_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
Reads a classifier from a file.
bool cl_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Performs classifier crossover.
void cl_cover(const struct XCSF *xcsf, struct Cl *c, const double *x, const int action)
Covers the condition and action for a classifier.
void cl_free(const struct XCSF *xcsf, struct Cl *c)
Frees the memory used by a classifier.
double cl_acc(const struct XCSF *xcsf, const struct Cl *c)
Returns the accuracy of a classifier.
void cl_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
Creates a classifier from a cJSON object.
double cl_del_vote(const struct XCSF *xcsf, const struct Cl *c, const double avg_fit)
Returns the deletion vote of a classifier.
bool cl_subsumer(const struct XCSF *xcsf, const struct Cl *c)
Returns whether a classifier is a potential subsumer.
void cl_print(const struct XCSF *xcsf, const struct Cl *c, const bool print_cond, const bool print_act, const bool print_pred)
Prints a classifier.
Classifier data structure.