XCSF  1.4.7
XCSF learning classifier system
rule_dgp.h File Reference

Dynamical GP graph rule (condition + action) functions. More...

#include "action.h"
#include "condition.h"
#include "dgp.h"
#include "xcsf.h"
Include dependency graph for rule_dgp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RuleDGP
 Dynamical GP graph rule data structure. More...
 

Functions

bool rule_dgp_cond_crossover (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
 
bool rule_dgp_cond_general (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
 
bool rule_dgp_cond_match (const struct XCSF *xcsf, const struct Cl *c, const double *x)
 
bool rule_dgp_cond_mutate (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_cond_copy (const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
 
void rule_dgp_cond_cover (const struct XCSF *xcsf, const struct Cl *c, const double *x)
 
void rule_dgp_cond_free (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_cond_init (const struct XCSF *xcsf, struct Cl *c)
 
void rule_dgp_cond_print (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_cond_update (const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
 
double rule_dgp_cond_size (const struct XCSF *xcsf, const struct Cl *c)
 
size_t rule_dgp_cond_save (const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
 
size_t rule_dgp_cond_load (const struct XCSF *xcsf, struct Cl *c, FILE *fp)
 
char * rule_dgp_cond_json_export (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_cond_json_import (const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
 
bool rule_dgp_act_crossover (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
 
bool rule_dgp_act_general (const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
 
bool rule_dgp_act_mutate (const struct XCSF *xcsf, const struct Cl *c)
 
int rule_dgp_act_compute (const struct XCSF *xcsf, const struct Cl *c, const double *x)
 
void rule_dgp_act_copy (const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
 
void rule_dgp_act_cover (const struct XCSF *xcsf, const struct Cl *c, const double *x, const int action)
 
void rule_dgp_act_free (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_act_init (const struct XCSF *xcsf, struct Cl *c)
 
void rule_dgp_act_print (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_act_update (const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
 
size_t rule_dgp_act_save (const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
 
size_t rule_dgp_act_load (const struct XCSF *xcsf, struct Cl *c, FILE *fp)
 
char * rule_dgp_act_json_export (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_act_json_import (const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
 

Variables

static struct CondVtbl const rule_dgp_cond_vtbl
 Dynamical GP rule condition implemented functions. More...
 
static struct ActVtbl const rule_dgp_act_vtbl
 Dynamical GP rule action implemented functions. More...
 

Detailed Description

Dynamical GP graph rule (condition + action) functions.

Author
Richard Preen rpree.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om
Date
2019–2021.

Definition in file rule_dgp.h.

Function Documentation

◆ rule_dgp_act_compute()

int rule_dgp_act_compute ( const struct XCSF xcsf,
const struct Cl c,
const double *  x 
)

Definition at line 229 of file rule_dgp.c.

References clamp_int(), Cl::cond, RuleDGP::dgp, graph_output(), and RuleDGP::n_outputs.

Referenced by rule_dgp_act_cover().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rule_dgp_act_copy()

void rule_dgp_act_copy ( const struct XCSF xcsf,
struct Cl dest,
const struct Cl src 
)

Definition at line 201 of file rule_dgp.c.

◆ rule_dgp_act_cover()

void rule_dgp_act_cover ( const struct XCSF xcsf,
const struct Cl c,
const double *  x,
const int  action 
)

Definition at line 218 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, graph_rand(), rule_dgp_act_compute(), and rule_dgp_cond_match().

Here is the call graph for this function:

◆ rule_dgp_act_crossover()

bool rule_dgp_act_crossover ( const struct XCSF xcsf,
const struct Cl c1,
const struct Cl c2 
)

Definition at line 256 of file rule_dgp.c.

◆ rule_dgp_act_free()

void rule_dgp_act_free ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 194 of file rule_dgp.c.

◆ rule_dgp_act_general()

bool rule_dgp_act_general ( const struct XCSF xcsf,
const struct Cl c1,
const struct Cl c2 
)

Definition at line 266 of file rule_dgp.c.

◆ rule_dgp_act_init()

void rule_dgp_act_init ( const struct XCSF xcsf,
struct Cl c 
)

Definition at line 187 of file rule_dgp.c.

◆ rule_dgp_act_json_export()

char* rule_dgp_act_json_export ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 302 of file rule_dgp.c.

Referenced by rule_dgp_act_print().

Here is the caller graph for this function:

◆ rule_dgp_act_json_import()

void rule_dgp_act_json_import ( const struct XCSF xcsf,
struct Cl c,
const cJSON *  json 
)

Definition at line 314 of file rule_dgp.c.

◆ rule_dgp_act_load()

size_t rule_dgp_act_load ( const struct XCSF xcsf,
struct Cl c,
FILE *  fp 
)

Definition at line 293 of file rule_dgp.c.

◆ rule_dgp_act_mutate()

bool rule_dgp_act_mutate ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 276 of file rule_dgp.c.

◆ rule_dgp_act_print()

void rule_dgp_act_print ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 210 of file rule_dgp.c.

References rule_dgp_act_json_export().

Here is the call graph for this function:

◆ rule_dgp_act_save()

size_t rule_dgp_act_save ( const struct XCSF xcsf,
const struct Cl c,
FILE *  fp 
)

Definition at line 284 of file rule_dgp.c.

◆ rule_dgp_act_update()

void rule_dgp_act_update ( const struct XCSF xcsf,
const struct Cl c,
const double *  x,
const double *  y 
)

Definition at line 246 of file rule_dgp.c.

◆ rule_dgp_cond_copy()

void rule_dgp_cond_copy ( const struct XCSF xcsf,
struct Cl dest,
const struct Cl src 
)

Definition at line 49 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, graph_copy(), graph_init(), and RuleDGP::n_outputs.

Here is the call graph for this function:

◆ rule_dgp_cond_cover()

void rule_dgp_cond_cover ( const struct XCSF xcsf,
const struct Cl c,
const double *  x 
)

Definition at line 61 of file rule_dgp.c.

◆ rule_dgp_cond_crossover()

bool rule_dgp_cond_crossover ( const struct XCSF xcsf,
const struct Cl c1,
const struct Cl c2 
)

Definition at line 100 of file rule_dgp.c.

◆ rule_dgp_cond_free()

void rule_dgp_cond_free ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 40 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, and graph_free().

Here is the call graph for this function:

◆ rule_dgp_cond_general()

bool rule_dgp_cond_general ( const struct XCSF xcsf,
const struct Cl c1,
const struct Cl c2 
)

Definition at line 110 of file rule_dgp.c.

◆ rule_dgp_cond_init()

void rule_dgp_cond_init ( const struct XCSF xcsf,
struct Cl c 
)

Definition at line 30 of file rule_dgp.c.

References Cl::cond, graph_init(), and graph_rand().

Here is the call graph for this function:

◆ rule_dgp_cond_json_export()

char* rule_dgp_cond_json_export ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 155 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, and graph_json_export().

Referenced by rule_dgp_cond_print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rule_dgp_cond_json_import()

void rule_dgp_cond_json_import ( const struct XCSF xcsf,
struct Cl c,
const cJSON *  json 
)

Definition at line 171 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, graph_free(), and graph_json_import().

Here is the call graph for this function:

◆ rule_dgp_cond_load()

size_t rule_dgp_cond_load ( const struct XCSF xcsf,
struct Cl c,
FILE *  fp 
)

Definition at line 145 of file rule_dgp.c.

References Cl::cond, and graph_load().

Here is the call graph for this function:

◆ rule_dgp_cond_match()

bool rule_dgp_cond_match ( const struct XCSF xcsf,
const struct Cl c,
const double *  x 
)

Definition at line 80 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, graph_output(), and graph_update().

Referenced by rule_dgp_act_cover().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rule_dgp_cond_mutate()

bool rule_dgp_cond_mutate ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 92 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, and graph_mutate().

Here is the call graph for this function:

◆ rule_dgp_cond_print()

void rule_dgp_cond_print ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 120 of file rule_dgp.c.

References rule_dgp_cond_json_export().

Here is the call graph for this function:

◆ rule_dgp_cond_save()

size_t rule_dgp_cond_save ( const struct XCSF xcsf,
const struct Cl c,
FILE *  fp 
)

Definition at line 136 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, and graph_save().

Here is the call graph for this function:

◆ rule_dgp_cond_size()

double rule_dgp_cond_size ( const struct XCSF xcsf,
const struct Cl c 
)

Definition at line 128 of file rule_dgp.c.

References Cl::cond, RuleDGP::dgp, and Graph::n.

◆ rule_dgp_cond_update()

void rule_dgp_cond_update ( const struct XCSF xcsf,
const struct Cl c,
const double *  x,
const double *  y 
)

Definition at line 70 of file rule_dgp.c.

Variable Documentation

◆ rule_dgp_act_vtbl

struct ActVtbl const rule_dgp_act_vtbl
static
Initial value:
= {
}
bool rule_dgp_act_mutate(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:276
char * rule_dgp_act_json_export(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:302
size_t rule_dgp_act_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
Definition: rule_dgp.c:284
void rule_dgp_act_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Definition: rule_dgp.c:201
size_t rule_dgp_act_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
Definition: rule_dgp.c:293
bool rule_dgp_act_general(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Definition: rule_dgp.c:266
void rule_dgp_act_init(const struct XCSF *xcsf, struct Cl *c)
Definition: rule_dgp.c:187
void rule_dgp_act_update(const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
Definition: rule_dgp.c:246
void rule_dgp_act_print(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:210
void rule_dgp_act_free(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:194
bool rule_dgp_act_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Definition: rule_dgp.c:256
void rule_dgp_act_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x, const int action)
Definition: rule_dgp.c:218
int rule_dgp_act_compute(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Definition: rule_dgp.c:229
void rule_dgp_act_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
Definition: rule_dgp.c:314

Dynamical GP rule action implemented functions.

Definition at line 151 of file rule_dgp.h.

Referenced by condition_set().

◆ rule_dgp_cond_vtbl

struct CondVtbl const rule_dgp_cond_vtbl
static
Initial value:
= {
}
void rule_dgp_cond_init(const struct XCSF *xcsf, struct Cl *c)
Definition: rule_dgp.c:30
char * rule_dgp_cond_json_export(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:155
bool rule_dgp_cond_mutate(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:92
void rule_dgp_cond_free(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:40
bool rule_dgp_cond_general(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Definition: rule_dgp.c:110
void rule_dgp_cond_print(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:120
void rule_dgp_cond_copy(const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
Definition: rule_dgp.c:49
bool rule_dgp_cond_crossover(const struct XCSF *xcsf, const struct Cl *c1, const struct Cl *c2)
Definition: rule_dgp.c:100
void rule_dgp_cond_update(const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
Definition: rule_dgp.c:70
bool rule_dgp_cond_match(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Definition: rule_dgp.c:80
void rule_dgp_cond_cover(const struct XCSF *xcsf, const struct Cl *c, const double *x)
Definition: rule_dgp.c:61
size_t rule_dgp_cond_save(const struct XCSF *xcsf, const struct Cl *c, FILE *fp)
Definition: rule_dgp.c:136
double rule_dgp_cond_size(const struct XCSF *xcsf, const struct Cl *c)
Definition: rule_dgp.c:128
size_t rule_dgp_cond_load(const struct XCSF *xcsf, struct Cl *c, FILE *fp)
Definition: rule_dgp.c:145
void rule_dgp_cond_json_import(const struct XCSF *xcsf, struct Cl *c, const cJSON *json)
Definition: rule_dgp.c:171

Dynamical GP rule condition implemented functions.

Definition at line 88 of file rule_dgp.h.

Referenced by condition_set().