XCSF 1.4.8
XCSF learning classifier system
Loading...
Searching...
No Matches
pred_constant.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 "prediction.h"
27#include "xcsf.h"
28
29bool
30pred_constant_crossover(const struct XCSF *xcsf, const struct Cl *c1,
31 const struct Cl *c2);
32
33bool
34pred_constant_mutate(const struct XCSF *xcsf, const struct Cl *c);
35
36double
37pred_constant_size(const struct XCSF *xcsf, const struct Cl *c);
38
39size_t
40pred_constant_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp);
41
42size_t
43pred_constant_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp);
44
45void
46pred_constant_compute(const struct XCSF *xcsf, const struct Cl *c,
47 const double *x);
48
49void
50pred_constant_copy(const struct XCSF *xcsf, struct Cl *dest,
51 const struct Cl *src);
52
53void
54pred_constant_free(const struct XCSF *xcsf, const struct Cl *c);
55
56void
57pred_constant_init(const struct XCSF *xcsf, struct Cl *c);
58
59void
60pred_constant_print(const struct XCSF *xcsf, const struct Cl *c);
61
62void
63pred_constant_update(const struct XCSF *xcsf, const struct Cl *c,
64 const double *x, const double *y);
65
66char *
67pred_constant_json_export(const struct XCSF *xcsf, const struct Cl *c);
68
69void
70pred_constant_json_import(const struct XCSF *xcsf, struct Cl *c,
71 const cJSON *json);
72
size_t pred_constant_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
Dummy function since constant predictions have no data structure.
void pred_constant_init(const struct XCSF *xcsf, struct Cl *c)
Dummy function since constant predictions have no data structure.
void pred_constant_free(const struct XCSF *xcsf, const struct Cl *c)
Dummy function since constant predictions have no data structure.
void pred_constant_compute(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Dummy function since constant predictions are not computed.
char * pred_constant_json_export(const struct XCSF *xcsf, const struct Cl *c)
Returns a json formatted string representation of a prediction.
void pred_constant_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
Creates a constant prediction from a cJSON object.
bool pred_constant_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Dummy function since constant predictions do not perform crossover.
double pred_constant_size(const struct XCSF *xcsf, const struct Cl *c)
Returns the size of a constant prediction.
void pred_constant_print(const struct XCSF *xcsf, const struct Cl *c)
Prints a constant prediction.
void pred_constant_update(const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
Updates a constant prediction for a given input and truth sample.
bool pred_constant_mutate(const struct XCSF *xcsf, const struct Cl *c)
Dummy function since constant predictions do not perform mutation.
static struct PredVtbl const pred_constant_vtbl
Constant prediction implemented functions.
void pred_constant_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Dummy function since constant predictions have no data structure.
size_t pred_constant_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
Dummy function since constant predictions have no data structure.
Interface for classifier predictions.
Classifier data structure.
Definition xcsf.h:45
Prediction interface data structure.
Definition prediction.h:96
XCSF data structure.
Definition xcsf.h:85
XCSF data structures.