|
XCSF 1.4.8
XCSF learning classifier system
|
integer action functions. More...
Go to the source code of this file.
Macros | |
| #define | N_MU (1) |
| Number of integer action mutation rates. | |
Functions | |
| bool | act_integer_crossover (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2) |
| Dummy function since integer actions do not perform crossover. | |
| bool | act_integer_general (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2) |
| Returns whether the action of classifier c1 is more general than c2. | |
| bool | act_integer_mutate (const struct XCSF *xcsf, const struct Cl *c) |
| Mutates an integer action. | |
| int | act_integer_compute (const struct XCSF *xcsf, const struct Cl *c, const double *x) |
| Returns a classifier's integer action. | |
| void | act_integer_copy (const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src) |
| Copies an integer action from one classifier to another. | |
| void | act_integer_print (const struct XCSF *xcsf, const struct Cl *c) |
| Prints an integer action. | |
| void | act_integer_cover (const struct XCSF *xcsf, const struct Cl *c, const double *x, const int action) |
| Sets an integer action to a specified value. | |
| void | act_integer_free (const struct XCSF *xcsf, const struct Cl *c) |
| Frees the memory used by an integer action. | |
| void | act_integer_init (const struct XCSF *xcsf, struct Cl *c) |
| Initialises an integer action. | |
| void | act_integer_update (const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y) |
| Dummy function since integer actions are not updated. | |
| size_t | act_integer_save (const struct XCSF *xcsf, const struct Cl *c, FILE *fp) |
| Writes an integer action to a file. | |
| size_t | act_integer_load (const struct XCSF *xcsf, struct Cl *c, FILE *fp) |
| Reads an integer action from a file. | |
| char * | act_integer_json_export (const struct XCSF *xcsf, const struct Cl *c) |
| Returns a json formatted string representation of an integer action. | |
| void | act_integer_json_import (const struct XCSF *xcsf, struct Cl *c, const cJSON *json) |
| Creates an integer action from a cJSON object. | |
Variables | |
| static const int | MU_TYPE [(1)] = { (0) } |
| Self-adaptation method for mutating integer actions. | |
| #define N_MU (1) |
Number of integer action mutation rates.
Definition at line 28 of file act_integer.c.
Returns a classifier's integer action.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | The classifier whose action to return. |
| [in] | x | The input state. |
Definition at line 101 of file act_integer.c.
References Cl::act, and ActInteger::action.
Copies an integer action from one classifier to another.
| [in] | xcsf | The XCSF data structure. |
| [in] | dest | The destination classifier. |
| [in] | src | The source classifier. |
Definition at line 117 of file act_integer.c.
References Cl::act, ActInteger::action, ActInteger::mu, and N_MU.
| void act_integer_cover | ( | const struct XCSF * | xcsf, |
| const struct Cl * | c, | ||
| const double * | x, | ||
| const int | action | ||
| ) |
Sets an integer action to a specified value.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | The classifier whose action is being covered. |
| [in] | x | The input state to cover. |
| [in] | action | The action to cover. |
Definition at line 149 of file act_integer.c.
References Cl::act, and ActInteger::action.
Dummy function since integer actions do not perform crossover.
| [in] | xcsf | The XCSF data structure. |
| [in] | c1 | The first classifier whose action is being crossed. |
| [in] | c2 | The second classifier whose action is being crossed. |
Definition at line 43 of file act_integer.c.
Frees the memory used by an integer action.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | The classifier whose action is to be freed. |
Definition at line 164 of file act_integer.c.
References Cl::act, and ActInteger::mu.
Returns whether the action of classifier c1 is more general than c2.
| [in] | xcsf | The XCSF data structure. |
| [in] | c1 | The classifier whose action is tested to be more general. |
| [in] | c2 | The classifier whose action is tested to be more specific. |
Definition at line 60 of file act_integer.c.
References Cl::act, and ActInteger::action.
Initialises an integer action.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | The classifier whose action is to be initialised. |
Definition at line 178 of file act_integer.c.
References Cl::act, MU_TYPE, N_MU, rand_uniform_int(), and sam_init().
Returns a json formatted string representation of an integer action.
| [in] | xcsf | XCSF data structure. |
| [in] | c | Classifier whose action is to be returned. |
Definition at line 249 of file act_integer.c.
References Cl::act, ActInteger::action, ActInteger::mu, and N_MU.
Referenced by act_integer_print().
Creates an integer action from a cJSON object.
| [in] | xcsf | The XCSF data structure. |
| [in,out] | c | The classifier to initialise. |
| [in] | json | cJSON object. |
Definition at line 270 of file act_integer.c.
References Cl::act, ActInteger::action, ActInteger::mu, N_MU, and sam_json_import().
Reads an integer action from a file.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | The classifier whose action is to be read. |
| [in] | fp | Pointer to the file to be read. |
Definition at line 230 of file act_integer.c.
Mutates an integer action.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | The classifier whose action is being mutated. |
Definition at line 79 of file act_integer.c.
References Cl::act, ActInteger::action, ActInteger::mu, MU_TYPE, N_MU, rand_uniform(), rand_uniform_int(), and sam_adapt().
Prints an integer action.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | The classifier whose action is to be printed. |
Definition at line 134 of file act_integer.c.
References act_integer_json_export().
Writes an integer action to a file.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | The classifier whose action is to be written. |
| [in] | fp | Pointer to the file to be written. |
Definition at line 212 of file act_integer.c.
References Cl::act, ActInteger::action, ActInteger::mu, and N_MU.
| void act_integer_update | ( | const struct XCSF * | xcsf, |
| const struct Cl * | c, | ||
| const double * | x, | ||
| const double * | y | ||
| ) |
Dummy function since integer actions are not updated.
| [in] | xcsf | The XCSF data structure. |
| [in] | c | A classifier data structure. |
| [in] | x | The input state. |
| [in] | y | The payoff value. |
Definition at line 195 of file act_integer.c.
|
static |
Self-adaptation method for mutating integer actions.
Definition at line 33 of file act_integer.c.
Referenced by act_integer_init(), and act_integer_mutate().