XCSF  1.4.7
XCSF learning classifier system
rule_dgp.c File Reference

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

#include "rule_dgp.h"
#include "utils.h"
Include dependency graph for rule_dgp.c:

Go to the source code of this file.

Functions

void rule_dgp_cond_init (const struct XCSF *xcsf, struct Cl *c)
 
void rule_dgp_cond_free (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_update (const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
 
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)
 
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)
 
void rule_dgp_cond_print (const struct XCSF *xcsf, const struct Cl *c)
 
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)
 
void rule_dgp_act_init (const struct XCSF *xcsf, struct Cl *c)
 
void rule_dgp_act_free (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_act_copy (const struct XCSF *xcsf, struct Cl *dest, const struct Cl *src)
 
void rule_dgp_act_print (const struct XCSF *xcsf, const struct Cl *c)
 
void rule_dgp_act_cover (const struct XCSF *xcsf, const struct Cl *c, const double *x, const int action)
 
int rule_dgp_act_compute (const struct XCSF *xcsf, const struct Cl *c, const double *x)
 
void rule_dgp_act_update (const struct XCSF *xcsf, const struct Cl *c, const double *x, const double *y)
 
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)
 
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)
 

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–2022.

Definition in file rule_dgp.c.

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.