XCSF  1.4.7
XCSF learning classifier system
env_mux.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 "env.h"
27 #include "xcsf.h"
28 
32 struct EnvMux {
33  double *state;
34  int pos_bits;
35 };
36 
37 bool
38 env_mux_is_done(const struct XCSF *xcsf);
39 
40 bool
41 env_mux_multistep(const struct XCSF *xcsf);
42 
43 double
44 env_mux_execute(const struct XCSF *xcsf, const int action);
45 
46 double
47 env_mux_maxpayoff(const struct XCSF *xcsf);
48 
49 const double *
50 env_mux_get_state(const struct XCSF *xcsf);
51 
52 void
53 env_mux_free(const struct XCSF *xcsf);
54 
55 void
56 env_mux_init(struct XCSF *xcsf, int bits);
57 
58 void
59 env_mux_reset(const struct XCSF *xcsf);
60 
64 static struct EnvVtbl const env_mux_vtbl = {
68 };
Built-in problem environment interface.
void env_mux_free(const struct XCSF *xcsf)
Frees the multiplexer environment.
Definition: env_mux.c:63
const double * env_mux_get_state(const struct XCSF *xcsf)
Returns a random multiplexer problem instance.
Definition: env_mux.c:76
double env_mux_execute(const struct XCSF *xcsf, const int action)
Returns the reward for executing a multiplexer action.
Definition: env_mux.c:92
void env_mux_reset(const struct XCSF *xcsf)
Dummy method since no multiplexer reset is necessary.
Definition: env_mux.c:110
bool env_mux_is_done(const struct XCSF *xcsf)
Returns whether the multiplexer is in a terminal state.
Definition: env_mux.c:121
void env_mux_init(struct XCSF *xcsf, int bits)
Initialises a real multiplexer environment of specified length.
Definition: env_mux.c:44
static struct EnvVtbl const env_mux_vtbl
Real multiplexer environment implemented functions.
Definition: env_mux.h:64
bool env_mux_multistep(const struct XCSF *xcsf)
Returns whether the multiplexer is a multistep problem.
Definition: env_mux.c:145
double env_mux_maxpayoff(const struct XCSF *xcsf)
Returns the maximum payoff value possible in the multiplexer.
Definition: env_mux.c:133
Definition: __init__.py:1
Real multiplexer environment data structure.
Definition: env_mux.h:32
int pos_bits
Number of position bits.
Definition: env_mux.h:34
double * state
Current state.
Definition: env_mux.h:33
Built-in problem environment interface data structure.
Definition: env.h:35
XCSF data structure.
Definition: xcsf.h:85
XCSF data structures.