XCSF 1.4.8
XCSF learning classifier system
Loading...
Searching...
No Matches
xcs_rl.h
Go to the documentation of this file.
1/*
2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
15
24#pragma once
25
26#include "xcsf.h"
27
28double
29xcs_rl_error(struct XCSF *xcsf, const int action, const double reward,
30 const bool reset, const double max_p);
31
32double
33xcs_rl_exp(struct XCSF *xcsf);
34
35int
36xcs_rl_decision(struct XCSF *xcsf, const double *state);
37
38void
39xcs_rl_end_step(struct XCSF *xcsf, const double *state, const int action,
40 const double reward);
41
42void
44
45void
47
48void
50
51void
52xcs_rl_update(struct XCSF *xcsf, const double *state, const int action,
53 const double reward, const bool reset);
54
55double
56xcs_rl_fit(struct XCSF *xcsf, const double *state, const int action,
57 const double reward);
XCSF data structure.
Definition xcsf.h:85
double xcs_rl_fit(struct XCSF *xcsf, const double *state, const int action, const double reward)
Creates and updates an action set for a given (state, action, reward).
Definition xcs_rl.c:104
int xcs_rl_decision(struct XCSF *xcsf, const double *state)
Selects an action to perform in a reinforcement learning problem.
Definition xcs_rl.c:247
void xcs_rl_init_step(struct XCSF *xcsf)
Initialises a step in a reinforcement learning trial.
Definition xcs_rl.c:157
double xcs_rl_error(struct XCSF *xcsf, const int action, const double reward, const bool reset, const double max_p)
Returns the reinforcement learning system prediction error.
Definition xcs_rl.c:223
void xcs_rl_end_trial(struct XCSF *xcsf)
Frees memory used by a reinforcement learning trial.
Definition xcs_rl.c:145
void xcs_rl_update(struct XCSF *xcsf, const double *state, const int action, const double reward, const bool reset)
Provides reinforcement to the sets.
Definition xcs_rl.c:192
double xcs_rl_exp(struct XCSF *xcsf)
Executes a reinforcement learning experiment.
Definition xcs_rl.c:78
void xcs_rl_init_trial(struct XCSF *xcsf)
Initialises a reinforcement learning trial.
Definition xcs_rl.c:126
void xcs_rl_end_step(struct XCSF *xcsf, const double *state, const int action, const double reward)
Ends a step in a reinforcement learning trial.
Definition xcs_rl.c:171
XCSF data structures.