XCSF 1.4.8
XCSF learning classifier system
Loading...
Searching...
No Matches
cond_dummy.c
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#include "cond_dummy.h"
25#include "utils.h"
26
32void
33cond_dummy_init(const struct XCSF *xcsf, struct Cl *c)
34{
35 (void) xcsf;
36 (void) c;
37}
38
44void
45cond_dummy_free(const struct XCSF *xcsf, const struct Cl *c)
46{
47 (void) xcsf;
48 (void) c;
49}
50
57void
58cond_dummy_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
59{
60 (void) xcsf;
61 (void) dest;
62 (void) src;
63}
64
71void
72cond_dummy_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x)
73{
74 (void) xcsf;
75 (void) c;
76 (void) x;
77}
78
86void
87cond_dummy_update(const struct XCSF *xcsf, const struct Cl *c, const double *x,
88 const double *y)
89{
90 (void) xcsf;
91 (void) c;
92 (void) x;
93 (void) y;
94}
95
103bool
104cond_dummy_match(const struct XCSF *xcsf, const struct Cl *c, const double *x)
105{
106 (void) xcsf;
107 (void) c;
108 (void) x;
109 return true;
110}
111
119bool
120cond_dummy_crossover(const struct XCSF *xcsf, const struct Cl *c1,
121 const struct Cl *c2)
122{
123 (void) xcsf;
124 (void) c1;
125 (void) c2;
126 return false;
127}
128
135bool
136cond_dummy_mutate(const struct XCSF *xcsf, const struct Cl *c)
137{
138 (void) xcsf;
139 (void) c;
140 return false;
141}
142
150bool
151cond_dummy_general(const struct XCSF *xcsf, const struct Cl *c1,
152 const struct Cl *c2)
153{
154 (void) xcsf;
155 (void) c1;
156 (void) c2;
157 return false;
158}
159
165void
166cond_dummy_print(const struct XCSF *xcsf, const struct Cl *c)
167{
168 char *json_str = cond_dummy_json_export(xcsf, c);
169 printf("%s\n", json_str);
170 free(json_str);
171}
172
179double
180cond_dummy_size(const struct XCSF *xcsf, const struct Cl *c)
181{
182 (void) xcsf;
183 (void) c;
184 return 0;
185}
186
194size_t
195cond_dummy_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
196{
197 (void) xcsf;
198 (void) c;
199 (void) fp;
200 return 0;
201}
202
210size_t
211cond_dummy_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
212{
213 (void) xcsf;
214 (void) c;
215 (void) fp;
216 return 0;
217}
218
225char *
226cond_dummy_json_export(const struct XCSF *xcsf, const struct Cl *c)
227{
228 (void) xcsf;
229 (void) c;
230 cJSON *json = cJSON_CreateObject();
231 cJSON_AddStringToObject(json, "type", "dummy");
232 char *string = cJSON_Print(json);
233 cJSON_Delete(json);
234 return string;
235}
236
243void
244cond_dummy_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
245{
246 (void) xcsf;
247 (void) c;
248 (void) json;
249}
char * cond_dummy_json_export(const struct XCSF *xcsf, const struct Cl *c)
Returns a json formatted string representation of a dummy condition.
Definition cond_dummy.c:226
void cond_dummy_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Dummy cover function.
Definition cond_dummy.c:72
void cond_dummy_init(const struct XCSF *xcsf, struct Cl *c)
Dummy initialisation function.
Definition cond_dummy.c:33
bool cond_dummy_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Dummy crossover function.
Definition cond_dummy.c:120
bool cond_dummy_match(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Dummy match function.
Definition cond_dummy.c:104
bool cond_dummy_mutate(const struct XCSF *xcsf, const struct Cl *c)
Dummy mutate function.
Definition cond_dummy.c:136
void cond_dummy_print(const struct XCSF *xcsf, const struct Cl *c)
Dummy print function.
Definition cond_dummy.c:166
void cond_dummy_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Dummy copy function.
Definition cond_dummy.c:58
size_t cond_dummy_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
Dummy save function.
Definition cond_dummy.c:195
bool cond_dummy_general(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Dummy general function.
Definition cond_dummy.c:151
double cond_dummy_size(const struct XCSF *xcsf, const struct Cl *c)
Dummy size function.
Definition cond_dummy.c:180
void cond_dummy_update(const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
Dummy update function.
Definition cond_dummy.c:87
size_t cond_dummy_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
Dummy load function.
Definition cond_dummy.c:211
void cond_dummy_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
Dummy import function.
Definition cond_dummy.c:244
void cond_dummy_free(const struct XCSF *xcsf, const struct Cl *c)
Dummy free function.
Definition cond_dummy.c:45
Always-matching dummy condition functions.
Classifier data structure.
Definition xcsf.h:45
XCSF data structure.
Definition xcsf.h:85
Utility functions for random number handling, etc.