void tree_json_import(struct GPTree *gp, const struct ArgsGPTree *args, const cJSON *json)
Creates a GP tree from a cJSON object.
void tree_args_free(struct ArgsGPTree *args)
Frees memory used by GP tree parameters.
size_t tree_load(struct GPTree *gp, FILE *fp)
Reads a GP tree from a file.
void tree_param_set_max_len(struct ArgsGPTree *args, const int a)
void tree_crossover(struct GPTree *p1, struct GPTree *p2)
Performs sub-tree crossover.
size_t tree_save(const struct GPTree *gp, FILE *fp)
Writes the GP tree to a file.
void tree_print(const struct GPTree *gp, const struct ArgsGPTree *args)
Prints a GP tree.
void tree_param_set_max(struct ArgsGPTree *args, const double a)
void tree_param_set_n_inputs(struct ArgsGPTree *args, const int a)
char * tree_args_json_import(struct ArgsGPTree *args, cJSON *json)
Sets the GP tree parameters from a cJSON object.
double tree_eval(struct GPTree *gp, const struct ArgsGPTree *args, const double *x)
Evaluates a GP tree.
void tree_param_set_n_constants(struct ArgsGPTree *args, const int a)
void tree_args_init_constants(struct ArgsGPTree *args)
Builds global constants used by GP trees.
void tree_param_set_init_depth(struct ArgsGPTree *args, const int a)
bool tree_mutate(struct GPTree *gp, const struct ArgsGPTree *args)
Performs point mutation on a GP tree.
void tree_args_init(struct ArgsGPTree *args)
Sets tree GP parameters to default values.
size_t tree_args_load(struct ArgsGPTree *args, FILE *fp)
Loads Tree GP parameters.
void tree_param_set_min(struct ArgsGPTree *args, const double a)
char * tree_args_json_export(const struct ArgsGPTree *args)
Returns a json formatted string of the GP tree parameters.
char * tree_json_export(const struct GPTree *gp, const struct ArgsGPTree *args)
Returns a json formatted string representation of a GP tree.
void tree_copy(struct GPTree *dest, const struct GPTree *src)
Copies a GP tree.
void tree_free(const struct GPTree *gp)
Frees a GP tree.
size_t tree_args_save(const struct ArgsGPTree *args, FILE *fp)
Saves Tree GP parameters.
void tree_rand(struct GPTree *gp, const struct ArgsGPTree *args)
Creates a random GP tree.
Parameters for initialising GP trees.
double * constants
Constants available for GP trees.
int n_constants
Number of constants available.
int init_depth
Initial depth.
int max_len
Maximum initial length.
double min
Minimum value of a constant.
int n_inputs
Number of inputs.
double max
Maximum value of a constant.
int * tree
Flattened tree representation of functions and terminals.
int pos
Current position in the tree.
double * mu
Mutation rates.