|
XCSF 1.4.8
XCSF learning classifier system
|
Prediction array functions. More...
Go to the source code of this file.
Functions | |
| static void | pa_reset (const struct XCSF *xcsf) |
| Resets the prediction array to zero. | |
| void | pa_init (struct XCSF *xcsf) |
| Initialises the prediction array. | |
| void | pa_build (const struct XCSF *xcsf, const double *x) |
| Builds the prediction array for the specified input. | |
| int | pa_best_action (const struct XCSF *xcsf) |
| Returns the best action in the prediction array. | |
| int | pa_rand_action (const struct XCSF *xcsf) |
| Returns a random action from the prediction array. | |
| double | pa_best_val (const struct XCSF *xcsf) |
| Returns the highest value in the prediction array. | |
| double | pa_val (const struct XCSF *xcsf, const int action) |
| Returns the value of a specified action in the prediction array. | |
| void | pa_free (const struct XCSF *xcsf) |
| Frees the prediction array. | |
| int pa_best_action | ( | const struct XCSF * | xcsf | ) |
Returns the best action in the prediction array.
Ties broken uniformly random.
| [in] | xcsf | The XCSF data structure. |
Definition at line 123 of file pa.c.
References rand_uniform_int().
Referenced by xcs_rl_decision().
| double pa_best_val | ( | const struct XCSF * | xcsf | ) |
Returns the highest value in the prediction array.
| [in] | xcsf | The XCSF data structure. |
Definition at line 165 of file pa.c.
References argmax().
Referenced by xcs_rl_update().
| void pa_build | ( | const struct XCSF * | xcsf, |
| const double * | x | ||
| ) |
Builds the prediction array for the specified input.
Calculates the match set mean fitness weighted prediction for each action. For supervised learning n_actions=1; reinforcement learning y_dim=1.
| [in] | xcsf | The XCSF data structure. |
| [in] | x | The input state. |
Definition at line 62 of file pa.c.
References Cl::action, Clist::cl, cl_predict(), Cl::fit, Set::list, Clist::next, pa_reset(), Cl::prediction, and Set::size.
Referenced by xcs_rl_decision(), xcs_rl_fit(), and xcs_supervised_trial().
| void pa_free | ( | const struct XCSF * | xcsf | ) |
Frees the prediction array.
| [in] | xcsf | The XCSF data structure. |
Definition at line 192 of file pa.c.
Referenced by xcsf_ae_to_classifier(), and xcsf_free().
| void pa_init | ( | struct XCSF * | xcsf | ) |
Initialises the prediction array.
| [in] | xcsf | The XCSF data structure. |
Definition at line 46 of file pa.c.
Referenced by xcsf_ae_to_classifier(), and xcsf_init().
| int pa_rand_action | ( | const struct XCSF * | xcsf | ) |
Returns a random action from the prediction array.
| [in] | xcsf | The XCSF data structure. |
Definition at line 150 of file pa.c.
References rand_uniform_int().
Referenced by xcs_rl_decision().
|
static |
Resets the prediction array to zero.
| [in] | xcsf | The XCSF data structure. |
Definition at line 33 of file pa.c.
Referenced by pa_build().
| double pa_val | ( | const struct XCSF * | xcsf, |
| const int | action | ||
| ) |
Returns the value of a specified action in the prediction array.
| [in] | xcsf | The XCSF data structure. |
| [in] | action | The specified action. |
Definition at line 178 of file pa.c.
Referenced by xcs_rl_end_step(), xcs_rl_error(), and xcs_rl_fit().