XCSF 1.4.8
XCSF learning classifier system
Loading...
Searching...
No Matches
clset.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
29clset_mean_cond_size(const struct XCSF *xcsf, const struct Set *set);
30
31double
32clset_mean_pred_size(const struct XCSF *xcsf, const struct Set *set);
33
34double
35clset_mean_time(const struct Set *set);
36
37double
38clset_mfrac(const struct XCSF *xcsf);
39
40double
41clset_total_fit(const struct Set *set);
42
43size_t
44clset_pset_load(struct XCSF *xcsf, FILE *fp);
45
46size_t
47clset_pset_save(const struct XCSF *xcsf, FILE *fp);
48
49void
50clset_action(struct XCSF *xcsf, const int action);
51
52void
53clset_add(struct Set *set, struct Cl *c);
54
55void
56clset_free(struct Set *set);
57
58void
59clset_init(struct Set *set);
60
61void
62clset_kill(const struct XCSF *xcsf, struct Set *set);
63
64void
65clset_match(struct XCSF *xcsf, const double *x, const bool cover);
66
67void
69
70void
72
73void
74clset_print(const struct XCSF *xcsf, const struct Set *set,
75 const bool print_cond, const bool print_act, const bool print_pred);
76
77void
78clset_set_times(const struct XCSF *xcsf, const struct Set *set);
79
80void
81clset_update(struct XCSF *xcsf, struct Set *set, const double *x,
82 const double *y, const bool cur);
83
84void
85clset_validate(struct Set *set);
86
87char *
88clset_json_export(const struct XCSF *xcsf, const struct Set *set,
89 const bool return_cond, const bool return_act,
90 const bool return_pred);
91
92void
93clset_json_insert_cl(struct XCSF *xcsf, const cJSON *json);
94
95void
96clset_json_insert(struct XCSF *xcsf, const char *json_str);
double clset_mean_pred_size(const struct XCSF *xcsf, const struct Set *set)
Calculates the mean prediction size of classifiers in the set.
Definition clset.c:693
void clset_pset_init(struct XCSF *xcsf)
Initialises a new population of random classifiers.
Definition clset.c:308
void clset_kill(const struct XCSF *xcsf, struct Set *set)
Frees the set and the classifiers.
Definition clset.c:590
void clset_update(struct XCSF *xcsf, struct Set *set, const double *x, const double *y, const bool cur)
Provides reinforcement to the set and performs set subsumption.
Definition clset.c:448
double clset_total_fit(const struct Set *set)
Calculates the total fitness of classifiers in the set.
Definition clset.c:545
double clset_mean_time(const struct Set *set)
Calculates the mean time stamp of classifiers in the set.
Definition clset.c:562
void clset_validate(struct Set *set)
Removes classifiers with 0 numerosity from the set.
Definition clset.c:480
char * clset_json_export(const struct XCSF *xcsf, const struct Set *set, const bool return_cond, const bool return_act, const bool return_pred)
Returns a json formatted string representation of a classifier set.
Definition clset.c:754
void clset_pset_enforce_limit(struct XCSF *xcsf)
Enforces the maximum population size limit.
Definition clset.c:340
void clset_add(struct Set *set, struct Cl *c)
Adds a classifier to the set.
Definition clset.c:423
void clset_action(struct XCSF *xcsf, const int action)
Constructs the action set from the match set.
Definition clset.c:404
void clset_print(const struct XCSF *xcsf, const struct Set *set, const bool print_cond, const bool print_act, const bool print_pred)
Prints the classifiers in the set.
Definition clset.c:515
double clset_mean_cond_size(const struct XCSF *xcsf, const struct Set *set)
Calculates the mean condition size of classifiers in the set.
Definition clset.c:673
void clset_json_insert(struct XCSF *xcsf, const char *json_str)
Creates classifiers from JSON and inserts into the population.
Definition clset.c:796
size_t clset_pset_save(const struct XCSF *xcsf, FILE *fp)
Writes the population set to a file.
Definition clset.c:610
void clset_init(struct Set *set)
Initialises a new set.
Definition clset.c:328
void clset_set_times(const struct XCSF *xcsf, const struct Set *set)
Sets the time stamps for classifiers in the set.
Definition clset.c:530
double clset_mfrac(const struct XCSF *xcsf)
Returns the fraction of inputs matched by the most general rule with error below E0....
Definition clset.c:713
void clset_match(struct XCSF *xcsf, const double *x, const bool cover)
Constructs the match set - forward propagates conditions and actions.
Definition clset.c:356
void clset_free(struct Set *set)
Frees the set, but not the classifiers.
Definition clset.c:572
void clset_json_insert_cl(struct XCSF *xcsf, const cJSON *json)
Creates a classifier from cJSON and inserts in the population set.
Definition clset.c:780
size_t clset_pset_load(struct XCSF *xcsf, FILE *fp)
Reads the population set from a file.
Definition clset.c:649
Classifier data structure.
Definition xcsf.h:45
Classifier set.
Definition xcsf.h:76
XCSF data structure.
Definition xcsf.h:85
XCSF data structures.