XCSF 1.4.8
XCSF learning classifier system
Loading...
Searching...
No Matches
cond_dgp.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 "condition.h"
27#include "dgp.h"
28#include "xcsf.h"
29
33struct CondDGP {
34 struct Graph dgp;
35};
36
37char *
39
40char *
41cond_dgp_param_json_import(struct XCSF *xcsf, cJSON *json);
42
43void
45
46bool
47cond_dgp_crossover(const struct XCSF *xcsf, const struct Cl *c1,
48 const struct Cl *c2);
49
50bool
51cond_dgp_general(const struct XCSF *xcsf, const struct Cl *c1,
52 const struct Cl *c2);
53
54bool
55cond_dgp_match(const struct XCSF *xcsf, const struct Cl *c, const double *x);
56
57bool
58cond_dgp_mutate(const struct XCSF *xcsf, const struct Cl *c);
59
60void
61cond_dgp_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src);
62
63void
64cond_dgp_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x);
65
66void
67cond_dgp_free(const struct XCSF *xcsf, const struct Cl *c);
68
69void
70cond_dgp_init(const struct XCSF *xcsf, struct Cl *c);
71
72void
73cond_dgp_print(const struct XCSF *xcsf, const struct Cl *c);
74
75void
76cond_dgp_update(const struct XCSF *xcsf, const struct Cl *c, const double *x,
77 const double *y);
78
79double
80cond_dgp_size(const struct XCSF *xcsf, const struct Cl *c);
81
82size_t
83cond_dgp_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp);
84
85size_t
86cond_dgp_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp);
87
88char *
89cond_dgp_json_export(const struct XCSF *xcsf, const struct Cl *c);
90
91void
92cond_dgp_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json);
93
char * cond_dgp_param_json_import(struct XCSF *xcsf, cJSON *json)
Sets the DGP parameters from a cJSON object.
Definition cond_dgp.c:290
void cond_dgp_print(const struct XCSF *xcsf, const struct Cl *c)
Prints a dynamical GP graph condition.
Definition cond_dgp.c:177
size_t cond_dgp_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
Reads a dynamical GP graph condition from a file.
Definition cond_dgp.c:222
void cond_dgp_init(const struct XCSF *xcsf, struct Cl *c)
Creates and initialises a dynamical GP graph condition.
Definition cond_dgp.c:34
char * cond_dgp_json_export(const struct XCSF *xcsf, const struct Cl *c)
Returns a json formatted string representation of a DGP condition.
Definition cond_dgp.c:238
bool cond_dgp_general(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Dummy general function.
Definition cond_dgp.c:162
void cond_dgp_update(const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
Dummy update function.
Definition cond_dgp.c:96
void cond_dgp_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Generates a dynamical GP graph that matches the current input.
Definition cond_dgp.c:79
char * cond_dgp_param_json_export(const struct XCSF *xcsf)
Returns a json formatted string of the DGP parameters.
Definition cond_dgp.c:278
static struct CondVtbl const cond_dgp_vtbl
Dynamical GP graph condition implemented functions.
Definition cond_dgp.h:97
bool cond_dgp_match(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Calculates whether a dynamical GP graph condition matches an input.
Definition cond_dgp.c:113
bool cond_dgp_mutate(const struct XCSF *xcsf, const struct Cl *c)
Mutates a dynamical GP graph condition with the self-adaptive rates.
Definition cond_dgp.c:130
void cond_dgp_free(const struct XCSF *xcsf, const struct Cl *c)
Frees the memory used by a dynamical GP graph condition.
Definition cond_dgp.c:48
double cond_dgp_size(const struct XCSF *xcsf, const struct Cl *c)
Returns the size of a dynamical GP graph condition.
Definition cond_dgp.c:191
void cond_dgp_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Copies a dynamical GP graph condition from one classifier to another.
Definition cond_dgp.c:63
size_t cond_dgp_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
Writes a dynamical GP graph condition to a file.
Definition cond_dgp.c:206
void cond_dgp_param_defaults(struct XCSF *xcsf)
Initialises default DGP condition parameters.
Definition cond_dgp.c:300
bool cond_dgp_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Dummy crossover function.
Definition cond_dgp.c:145
void cond_dgp_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
Creates a DGP condition from a cJSON object.
Definition cond_dgp.c:260
Interface for classifier conditions.
An implementation of dynamical GP graphs with fuzzy activations.
Classifier data structure.
Definition xcsf.h:45
Dynamical GP graph condition data structure.
Definition cond_dgp.h:33
struct Graph dgp
DGP graph.
Definition cond_dgp.h:34
Condition interface data structure.
Definition condition.h:104
Dynamical GP graph data structure.
Definition dgp.h:42
XCSF data structure.
Definition xcsf.h:85
XCSF data structures.