XCSF
1.4.7
XCSF learning classifier system
|
Interface for classifier conditions. More...
#include "cond_dgp.h"
#include "cond_dummy.h"
#include "cond_ellipsoid.h"
#include "cond_gp.h"
#include "cond_neural.h"
#include "cond_rectangle.h"
#include "cond_ternary.h"
#include "rule_dgp.h"
#include "rule_neural.h"
#include "utils.h"
Go to the source code of this file.
Functions | |
void | condition_set (const struct XCSF *xcsf, struct Cl *c) |
Sets a classifier's condition functions to the implementations. More... | |
const char * | condition_type_as_string (const int type) |
Returns a string representation of a condition type from an integer. More... | |
int | condition_type_as_int (const char *type) |
Returns the integer representation of a condition type given a name. More... | |
void | cond_param_defaults (struct XCSF *xcsf) |
Initialises default condition parameters. More... | |
static char * | cond_param_json_export_csr (const struct XCSF *xcsf) |
Returns a json formatted string of the center-spread parameters. More... | |
static char * | cond_param_json_import_csr (struct XCSF *xcsf, cJSON *json) |
Sets the center-spread parameters from a cJSON object. More... | |
char * | cond_param_json_export (const struct XCSF *xcsf) |
Returns a json formatted string of the condition parameters. More... | |
char * | cond_param_json_import (struct XCSF *xcsf, cJSON *json) |
Sets the condition parameters from a cJSON object. More... | |
size_t | cond_param_save (const struct XCSF *xcsf, FILE *fp) |
Saves condition parameters. More... | |
size_t | cond_param_load (struct XCSF *xcsf, FILE *fp) |
Loads condition parameters. More... | |
void | cond_param_free (struct XCSF *xcsf) |
Frees condition parameters. More... | |
void | cond_param_set_eta (struct XCSF *xcsf, const double a) |
void | cond_param_set_min (struct XCSF *xcsf, const double a) |
void | cond_param_set_max (struct XCSF *xcsf, const double a) |
void | cond_param_set_p_dontcare (struct XCSF *xcsf, const double a) |
void | cond_param_set_spread_min (struct XCSF *xcsf, const double a) |
void | cond_param_set_bits (struct XCSF *xcsf, const int a) |
int | cond_param_set_type_string (struct XCSF *xcsf, const char *a) |
void | cond_param_set_type (struct XCSF *xcsf, const int a) |
Interface for classifier conditions.
Definition in file condition.c.
void cond_param_defaults | ( | struct XCSF * | xcsf | ) |
Initialises default condition parameters.
[in] | xcsf | The XCSF data structure. |
Definition at line 166 of file condition.c.
References cond_dgp_param_defaults(), cond_gp_param_defaults(), cond_neural_param_defaults(), cond_param_set_eta(), cond_param_set_max(), cond_param_set_min(), cond_param_set_spread_min(), cond_param_set_type(), cond_ternary_param_defaults(), and COND_TYPE_HYPERRECTANGLE_CSR.
Referenced by param_init().
void cond_param_free | ( | struct XCSF * | xcsf | ) |
Frees condition parameters.
[in] | xcsf | The XCSF data structure. |
Definition at line 365 of file condition.c.
References layer_args_free(), and tree_args_free().
Referenced by param_free().
char* cond_param_json_export | ( | const struct XCSF * | xcsf | ) |
Returns a json formatted string of the condition parameters.
[in] | xcsf | XCSF data structure. |
Definition at line 232 of file condition.c.
References cond_dgp_param_json_export(), cond_gp_param_json_export(), cond_param_json_export_csr(), cond_ternary_param_json_export(), COND_TYPE_DGP, COND_TYPE_GP, COND_TYPE_HYPERELLIPSOID, COND_TYPE_HYPERRECTANGLE_CSR, COND_TYPE_HYPERRECTANGLE_UBR, COND_TYPE_NEURAL, COND_TYPE_TERNARY, condition_type_as_string(), layer_args_json_export(), RULE_TYPE_DGP, RULE_TYPE_NETWORK, RULE_TYPE_NEURAL, and ArgsCond::type.
Referenced by param_json_export().
|
static |
Returns a json formatted string of the center-spread parameters.
[in] | xcsf | The XCSF data structure. |
Definition at line 185 of file condition.c.
References ArgsCond::eta, ArgsCond::max, ArgsCond::min, and ArgsCond::spread_min.
Referenced by cond_param_json_export().
char* cond_param_json_import | ( | struct XCSF * | xcsf, |
cJSON * | json | ||
) |
Sets the condition parameters from a cJSON object.
[in,out] | xcsf | The XCSF data structure. |
[in] | json | cJSON object. |
Definition at line 281 of file condition.c.
References cond_dgp_param_json_import(), cond_gp_param_json_import(), cond_neural_param_json_import(), cond_param_json_import_csr(), cond_ternary_param_json_import(), COND_TYPE_DGP, COND_TYPE_GP, COND_TYPE_HYPERELLIPSOID, COND_TYPE_HYPERRECTANGLE_CSR, COND_TYPE_HYPERRECTANGLE_UBR, COND_TYPE_NEURAL, COND_TYPE_TERNARY, RULE_TYPE_DGP, RULE_TYPE_NETWORK, and RULE_TYPE_NEURAL.
Referenced by param_json_import_condition().
|
static |
Sets the center-spread parameters from a cJSON object.
[in,out] | xcsf | The XCSF data structure. |
[in] | json | cJSON object. |
Definition at line 205 of file condition.c.
References cond_param_set_eta(), cond_param_set_max(), cond_param_set_min(), and cond_param_set_spread_min().
Referenced by cond_param_json_import().
size_t cond_param_load | ( | struct XCSF * | xcsf, |
FILE * | fp | ||
) |
Loads condition parameters.
[in] | xcsf | The XCSF data structure. |
[in] | fp | Pointer to the output file. |
Definition at line 343 of file condition.c.
References ArgsCond::bits, ArgsCond::dargs, ArgsCond::eta, graph_args_load(), ArgsCond::largs, layer_args_load(), ArgsCond::max, ArgsCond::min, ArgsCond::p_dontcare, ArgsCond::spread_min, ArgsCond::targs, tree_args_load(), and ArgsCond::type.
Referenced by param_load().
size_t cond_param_save | ( | const struct XCSF * | xcsf, |
FILE * | fp | ||
) |
Saves condition parameters.
[in] | xcsf | The XCSF data structure. |
[in] | fp | Pointer to the output file. |
Definition at line 319 of file condition.c.
References ArgsCond::bits, ArgsCond::dargs, ArgsCond::eta, graph_args_save(), ArgsCond::largs, layer_args_save(), ArgsCond::max, ArgsCond::min, ArgsCond::p_dontcare, ArgsCond::spread_min, ArgsCond::targs, tree_args_save(), and ArgsCond::type.
Referenced by param_save().
void cond_param_set_bits | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 429 of file condition.c.
Referenced by cond_ternary_param_defaults(), and cond_ternary_param_json_import().
void cond_param_set_eta | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 378 of file condition.c.
Referenced by cond_param_defaults(), and cond_param_json_import_csr().
void cond_param_set_max | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 398 of file condition.c.
Referenced by cond_param_defaults(), and cond_param_json_import_csr().
void cond_param_set_min | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 392 of file condition.c.
Referenced by cond_param_defaults(), and cond_param_json_import_csr().
void cond_param_set_p_dontcare | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 404 of file condition.c.
Referenced by cond_ternary_param_defaults(), and cond_ternary_param_json_import().
void cond_param_set_spread_min | ( | struct XCSF * | xcsf, |
const double | a | ||
) |
Definition at line 418 of file condition.c.
Referenced by cond_param_defaults(), and cond_param_json_import_csr().
void cond_param_set_type | ( | struct XCSF * | xcsf, |
const int | a | ||
) |
Definition at line 450 of file condition.c.
Referenced by cond_param_defaults().
int cond_param_set_type_string | ( | struct XCSF * | xcsf, |
const char * | a | ||
) |
Definition at line 440 of file condition.c.
References COND_TYPE_INVALID, condition_type_as_int(), and ArgsCond::type.
Referenced by param_json_import_condition().
Sets a classifier's condition functions to the implementations.
[in] | xcsf | The XCSF data structure. |
[in] | c | The classifier to set. |
Definition at line 41 of file condition.c.
References Cl::act_vptr, cond_dgp_vtbl, cond_dummy_vtbl, cond_ellipsoid_vtbl, cond_gp_vtbl, cond_neural_vtbl, cond_rectangle_vtbl, cond_ternary_vtbl, COND_TYPE_DGP, COND_TYPE_DUMMY, COND_TYPE_GP, COND_TYPE_HYPERELLIPSOID, COND_TYPE_HYPERRECTANGLE_CSR, COND_TYPE_HYPERRECTANGLE_UBR, COND_TYPE_NEURAL, COND_TYPE_TERNARY, Cl::cond_vptr, rule_dgp_act_vtbl, rule_dgp_cond_vtbl, rule_neural_act_vtbl, rule_neural_cond_vtbl, RULE_TYPE_DGP, and RULE_TYPE_NEURAL.
Referenced by cl_load(), and cl_rand().
int condition_type_as_int | ( | const char * | type | ) |
Returns the integer representation of a condition type given a name.
[in] | type | String representation of a condition type. |
Definition at line 123 of file condition.c.
References COND_STRING_DGP, COND_STRING_DUMMY, COND_STRING_GP, COND_STRING_HYPERELLIPSOID, COND_STRING_HYPERRECTANGLE_CSR, COND_STRING_HYPERRECTANGLE_UBR, COND_STRING_NEURAL, COND_STRING_RULE_DGP, COND_STRING_RULE_NETWORK, COND_STRING_RULE_NEURAL, COND_STRING_TERNARY, COND_TYPE_DGP, COND_TYPE_DUMMY, COND_TYPE_GP, COND_TYPE_HYPERELLIPSOID, COND_TYPE_HYPERRECTANGLE_CSR, COND_TYPE_HYPERRECTANGLE_UBR, COND_TYPE_INVALID, COND_TYPE_NEURAL, COND_TYPE_TERNARY, RULE_TYPE_DGP, RULE_TYPE_NETWORK, and RULE_TYPE_NEURAL.
Referenced by cond_json_import(), and cond_param_set_type_string().
const char* condition_type_as_string | ( | const int | type | ) |
Returns a string representation of a condition type from an integer.
[in] | type | Integer representation of a condition type. |
Definition at line 86 of file condition.c.
References COND_STRING_DGP, COND_STRING_DUMMY, COND_STRING_GP, COND_STRING_HYPERELLIPSOID, COND_STRING_HYPERRECTANGLE_CSR, COND_STRING_HYPERRECTANGLE_UBR, COND_STRING_NEURAL, COND_STRING_RULE_DGP, COND_STRING_RULE_NETWORK, COND_STRING_RULE_NEURAL, COND_STRING_TERNARY, COND_TYPE_DGP, COND_TYPE_DUMMY, COND_TYPE_GP, COND_TYPE_HYPERELLIPSOID, COND_TYPE_HYPERRECTANGLE_CSR, COND_TYPE_HYPERRECTANGLE_UBR, COND_TYPE_NEURAL, COND_TYPE_TERNARY, RULE_TYPE_DGP, RULE_TYPE_NETWORK, and RULE_TYPE_NEURAL.
Referenced by cond_json_import(), and cond_param_json_export().