XCSF  1.4.7
XCSF learning classifier system
param.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 "loss.h"
27 #include "xcsf.h"
28 
29 #define PARAM_INVALID (-1)
30 #define PARAM_NOT_FOUND (0)
31 #define PARAM_FOUND (1)
32 
33 char *
34 param_json_export(const struct XCSF *xcsf);
35 
36 void
37 param_json_import(struct XCSF *xcsf, const char *json_str);
38 
39 void
40 param_free(struct XCSF *xcsf);
41 
42 void
43 param_print(const struct XCSF *xcsf);
44 
45 void
46 param_init(struct XCSF *xcsf, const int x_dim, const int y_dim,
47  const int n_actions);
48 
49 size_t
50 param_load(struct XCSF *xcsf, FILE *fp);
51 
52 size_t
53 param_save(const struct XCSF *xcsf, FILE *fp);
54 
55 /* setters */
56 
57 const char *
58 param_set_omp_num_threads(struct XCSF *xcsf, const int a);
59 
60 const char *
61 param_set_random_state(struct XCSF *xcsf, const int a);
62 
63 const char *
64 param_set_population_file(struct XCSF *xcsf, const char *a);
65 
66 const char *
67 param_set_pop_init(struct XCSF *xcsf, const bool a);
68 
69 const char *
70 param_set_max_trials(struct XCSF *xcsf, const int a);
71 
72 const char *
73 param_set_perf_trials(struct XCSF *xcsf, const int a);
74 
75 const char *
76 param_set_pop_size(struct XCSF *xcsf, const int a);
77 
78 int
79 param_set_loss_func_string(struct XCSF *xcsf, const char *a);
80 
81 void
82 param_set_loss_func(struct XCSF *xcsf, const int a);
83 
84 const char *
85 param_set_stateful(struct XCSF *xcsf, const bool a);
86 
87 const char *
88 param_set_compaction(struct XCSF *xcsf, const bool a);
89 
90 const char *
91 param_set_huber_delta(struct XCSF *xcsf, const double a);
92 
93 const char *
94 param_set_gamma(struct XCSF *xcsf, const double a);
95 
96 const char *
97 param_set_teletransportation(struct XCSF *xcsf, const int a);
98 
99 const char *
100 param_set_p_explore(struct XCSF *xcsf, const double a);
101 
102 const char *
103 param_set_alpha(struct XCSF *xcsf, const double a);
104 
105 const char *
106 param_set_beta(struct XCSF *xcsf, const double a);
107 
108 const char *
109 param_set_delta(struct XCSF *xcsf, const double a);
110 
111 const char *
112 param_set_e0(struct XCSF *xcsf, const double a);
113 
114 const char *
115 param_set_init_error(struct XCSF *xcsf, const double a);
116 
117 const char *
118 param_set_init_fitness(struct XCSF *xcsf, const double a);
119 
120 const char *
121 param_set_nu(struct XCSF *xcsf, const double a);
122 
123 const char *
124 param_set_theta_del(struct XCSF *xcsf, const int a);
125 
126 const char *
127 param_set_m_probation(struct XCSF *xcsf, const int a);
128 
129 const char *
130 param_set_set_subsumption(struct XCSF *xcsf, const bool a);
131 
132 const char *
133 param_set_theta_sub(struct XCSF *xcsf, const int a);
134 
135 const char *
136 param_set_x_dim(struct XCSF *xcsf, const int a);
137 
138 const char *
139 param_set_explore(struct XCSF *xcsf, const bool a);
140 
141 const char *
142 param_set_y_dim(struct XCSF *xcsf, const int a);
143 
144 const char *
145 param_set_n_actions(struct XCSF *xcsf, const int a);
Loss functions for calculating prediction error.
Definition: __init__.py:1
const char * param_set_e0(struct XCSF *xcsf, const double a)
Definition: param.c:794
const char * param_set_perf_trials(struct XCSF *xcsf, const int a)
Definition: param.c:666
const char * param_set_population_file(struct XCSF *xcsf, const char *a)
Definition: param.c:639
void param_json_import(struct XCSF *xcsf, const char *json_str)
Sets the parameters from a json formatted string.
Definition: param.c:437
const char * param_set_nu(struct XCSF *xcsf, const double a)
Definition: param.c:824
void param_print(const struct XCSF *xcsf)
Prints all XCSF parameters.
Definition: param.c:481
const char * param_set_stateful(struct XCSF *xcsf, const bool a)
Definition: param.c:710
const char * param_set_set_subsumption(struct XCSF *xcsf, const bool a)
Definition: param.c:854
const char * param_set_beta(struct XCSF *xcsf, const double a)
Definition: param.c:774
const char * param_set_max_trials(struct XCSF *xcsf, const int a)
Definition: param.c:656
const char * param_set_pop_size(struct XCSF *xcsf, const int a)
Definition: param.c:676
const char * param_set_explore(struct XCSF *xcsf, const bool a)
Definition: param.c:881
const char * param_set_random_state(struct XCSF *xcsf, const int a)
Definition: param.c:627
const char * param_set_m_probation(struct XCSF *xcsf, const int a)
Definition: param.c:844
const char * param_set_y_dim(struct XCSF *xcsf, const int a)
Definition: param.c:888
const char * param_set_omp_num_threads(struct XCSF *xcsf, const int a)
Sets the number of OMP threads.
Definition: param.c:614
const char * param_set_init_fitness(struct XCSF *xcsf, const double a)
Definition: param.c:814
void param_set_loss_func(struct XCSF *xcsf, const int a)
Definition: param.c:699
const char * param_set_huber_delta(struct XCSF *xcsf, const double a)
Definition: param.c:724
const char * param_set_gamma(struct XCSF *xcsf, const double a)
Definition: param.c:734
const char * param_set_teletransportation(struct XCSF *xcsf, const int a)
Definition: param.c:744
char * param_json_export(const struct XCSF *xcsf)
Returns a json formatted string representation of the parameters.
Definition: param.c:113
const char * param_set_compaction(struct XCSF *xcsf, const bool a)
Definition: param.c:717
const char * param_set_init_error(struct XCSF *xcsf, const double a)
Definition: param.c:804
const char * param_set_p_explore(struct XCSF *xcsf, const double a)
Definition: param.c:754
const char * param_set_theta_del(struct XCSF *xcsf, const int a)
Definition: param.c:834
const char * param_set_n_actions(struct XCSF *xcsf, const int a)
Definition: param.c:898
int param_set_loss_func_string(struct XCSF *xcsf, const char *a)
Definition: param.c:686
void param_init(struct XCSF *xcsf, const int x_dim, const int y_dim, const int n_actions)
Initialises default XCSF parameters.
Definition: param.c:45
void param_free(struct XCSF *xcsf)
Definition: param.c:93
const char * param_set_alpha(struct XCSF *xcsf, const double a)
Definition: param.c:764
const char * param_set_x_dim(struct XCSF *xcsf, const int a)
Definition: param.c:871
size_t param_load(struct XCSF *xcsf, FILE *fp)
Reads the XCSF data structure from a file.
Definition: param.c:548
const char * param_set_delta(struct XCSF *xcsf, const double a)
Definition: param.c:784
size_t param_save(const struct XCSF *xcsf, FILE *fp)
Writes the XCSF data structure to a file.
Definition: param.c:495
const char * param_set_theta_sub(struct XCSF *xcsf, const int a)
Definition: param.c:861
const char * param_set_pop_init(struct XCSF *xcsf, const bool a)
Definition: param.c:649
XCSF data structure.
Definition: xcsf.h:85
XCSF data structures.