XCSF
1.4.7
XCSF learning classifier system
|
Dynamical GP graph condition functions. More...
Go to the source code of this file.
Functions | |
void | cond_dgp_init (const struct XCSF *xcsf, struct Cl *c) |
Creates and initialises a dynamical GP graph condition. More... | |
void | cond_dgp_free (const struct XCSF *xcsf, const struct Cl *c) |
Frees the memory used by a dynamical GP graph condition. More... | |
void | cond_dgp_copy (const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src) |
Copies a dynamical GP graph condition from one classifier to another. More... | |
void | cond_dgp_cover (const struct XCSF *xcsf, const struct Cl *c, const double *x) |
Generates a dynamical GP graph that matches the current input. More... | |
void | cond_dgp_update (const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y) |
Dummy update function. More... | |
bool | cond_dgp_match (const struct XCSF *xcsf, const struct Cl *c, const double *x) |
Calculates whether a dynamical GP graph condition matches an input. More... | |
bool | cond_dgp_mutate (const struct XCSF *xcsf, const struct Cl *c) |
Mutates a dynamical GP graph condition with the self-adaptive rates. More... | |
bool | cond_dgp_crossover (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2) |
Dummy crossover function. More... | |
bool | cond_dgp_general (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2) |
Dummy general function. More... | |
void | cond_dgp_print (const struct XCSF *xcsf, const struct Cl *c) |
Prints a dynamical GP graph condition. More... | |
double | cond_dgp_size (const struct XCSF *xcsf, const struct Cl *c) |
Returns the size of a dynamical GP graph condition. More... | |
size_t | cond_dgp_save (const struct XCSF *xcsf, const struct Cl *c, FILE *fp) |
Writes a dynamical GP graph condition to a file. More... | |
size_t | cond_dgp_load (const struct XCSF *xcsf, struct Cl *c, FILE *fp) |
Reads a dynamical GP graph condition from a file. More... | |
char * | cond_dgp_json_export (const struct XCSF *xcsf, const struct Cl *c) |
Returns a json formatted string representation of a DGP condition. More... | |
void | cond_dgp_json_import (const struct XCSF *xcsf, struct Cl *c, const cJSON *json) |
Creates a DGP condition from a cJSON object. More... | |
char * | cond_dgp_param_json_export (const struct XCSF *xcsf) |
Returns a json formatted string of the DGP parameters. More... | |
char * | cond_dgp_param_json_import (struct XCSF *xcsf, cJSON *json) |
Sets the DGP parameters from a cJSON object. More... | |
void | cond_dgp_param_defaults (struct XCSF *xcsf) |
Initialises default DGP condition parameters. More... | |
Dynamical GP graph condition functions.
Definition in file cond_dgp.c.
Copies a dynamical GP graph condition from one classifier to another.
[in] | xcsf | XCSF data structure. |
[in] | dest | Destination classifier. |
[in] | src | Source classifier. |
Definition at line 63 of file cond_dgp.c.
References Cl::cond, CondDGP::dgp, graph_copy(), and graph_init().
Generates a dynamical GP graph that matches the current input.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition is being covered. |
[in] | x | Input state to cover. |
Definition at line 79 of file cond_dgp.c.
References Cl::cond, cond_dgp_match(), CondDGP::dgp, and graph_rand().
Dummy crossover function.
[in] | xcsf | XCSF data structure. |
[in] | c1 | First classifier whose condition is being crossed. |
[in] | c2 | Second classifier whose condition is being crossed. |
Definition at line 145 of file cond_dgp.c.
Frees the memory used by a dynamical GP graph condition.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition is to be freed. |
Definition at line 48 of file cond_dgp.c.
References Cl::cond, CondDGP::dgp, and graph_free().
Dummy general function.
[in] | xcsf | XCSF data structure. |
[in] | c1 | Classifier whose condition is tested to be more general. |
[in] | c2 | Classifier whose condition is tested to be more specific. |
Definition at line 162 of file cond_dgp.c.
Creates and initialises a dynamical GP graph condition.
[in] | xcsf | The XCSF data structure. |
[in] | c | The classifier whose condition is to be initialised. |
Definition at line 34 of file cond_dgp.c.
References Cl::cond, graph_init(), and graph_rand().
Returns a json formatted string representation of a DGP condition.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition is to be returned. |
Definition at line 238 of file cond_dgp.c.
References Cl::cond, CondDGP::dgp, and graph_json_export().
Referenced by cond_dgp_print().
Creates a DGP condition from a cJSON object.
[in] | xcsf | The XCSF data structure. |
[in,out] | c | The classifier to initialise. |
[in] | json | cJSON object. |
Definition at line 260 of file cond_dgp.c.
References Cl::cond, CondDGP::dgp, graph_free(), and graph_json_import().
Reads a dynamical GP graph condition from a file.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition is to be read. |
[in] | fp | Pointer to the file to be read. |
Definition at line 222 of file cond_dgp.c.
References Cl::cond, and graph_load().
Calculates whether a dynamical GP graph condition matches an input.
Definition at line 113 of file cond_dgp.c.
References Cl::cond, CondDGP::dgp, graph_output(), and graph_update().
Referenced by cond_dgp_cover().
Mutates a dynamical GP graph condition with the self-adaptive rates.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition is being mutated. |
Definition at line 130 of file cond_dgp.c.
References Cl::cond, CondDGP::dgp, and graph_mutate().
void cond_dgp_param_defaults | ( | struct XCSF * | xcsf | ) |
Initialises default DGP condition parameters.
[in] | xcsf | The XCSF data structure. |
Definition at line 300 of file cond_dgp.c.
References graph_args_init(), graph_param_set_evolve_cycles(), graph_param_set_max_k(), graph_param_set_max_t(), graph_param_set_n(), and graph_param_set_n_inputs().
Referenced by cond_param_defaults().
char* cond_dgp_param_json_export | ( | const struct XCSF * | xcsf | ) |
Returns a json formatted string of the DGP parameters.
[in] | xcsf | The XCSF data structure. |
Definition at line 278 of file cond_dgp.c.
References graph_args_json_export().
Referenced by cond_param_json_export().
char* cond_dgp_param_json_import | ( | struct XCSF * | xcsf, |
cJSON * | json | ||
) |
Sets the DGP parameters from a cJSON object.
[in,out] | xcsf | The XCSF data structure. |
[in] | json | cJSON object. |
Definition at line 290 of file cond_dgp.c.
References graph_args_json_import().
Referenced by cond_param_json_import().
Prints a dynamical GP graph condition.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition is to be printed. |
Definition at line 177 of file cond_dgp.c.
References cond_dgp_json_export().
Writes a dynamical GP graph condition to a file.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition is to be written. |
[in] | fp | Pointer to the file to be written. |
Definition at line 206 of file cond_dgp.c.
References Cl::cond, CondDGP::dgp, and graph_save().
Returns the size of a dynamical GP graph condition.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition size to return. |
Definition at line 191 of file cond_dgp.c.
References Cl::cond, CondDGP::dgp, and Graph::n.
void cond_dgp_update | ( | const struct XCSF * | xcsf, |
const struct Cl * | c, | ||
const double * | x, | ||
const double * | y | ||
) |
Dummy update function.
[in] | xcsf | XCSF data structure. |
[in] | c | Classifier whose condition is to be updated. |
[in] | x | Input state. |
[in] | y | Truth/payoff value. |
Definition at line 96 of file cond_dgp.c.