XCSF  1.4.7
XCSF learning classifier system
env_mux.h File Reference

The real multiplexer problem environment. More...

#include "env.h"
#include "xcsf.h"
Include dependency graph for env_mux.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  EnvMux
 Real multiplexer environment data structure. More...
 

Functions

bool env_mux_is_done (const struct XCSF *xcsf)
 Returns whether the multiplexer is in a terminal state. More...
 
bool env_mux_multistep (const struct XCSF *xcsf)
 Returns whether the multiplexer is a multistep problem. More...
 
double env_mux_execute (const struct XCSF *xcsf, const int action)
 Returns the reward for executing a multiplexer action. More...
 
double env_mux_maxpayoff (const struct XCSF *xcsf)
 Returns the maximum payoff value possible in the multiplexer. More...
 
const double * env_mux_get_state (const struct XCSF *xcsf)
 Returns a random multiplexer problem instance. More...
 
void env_mux_free (const struct XCSF *xcsf)
 Frees the multiplexer environment. More...
 
void env_mux_init (struct XCSF *xcsf, int bits)
 Initialises a real multiplexer environment of specified length. More...
 
void env_mux_reset (const struct XCSF *xcsf)
 Dummy method since no multiplexer reset is necessary. More...
 

Variables

static struct EnvVtbl const env_mux_vtbl
 Real multiplexer environment implemented functions. More...
 

Detailed Description

The real multiplexer problem environment.

Author
Richard Preen rpree.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om
Date
2015–2020.

Definition in file env_mux.h.

Function Documentation

◆ env_mux_execute()

double env_mux_execute ( const struct XCSF xcsf,
const int  action 
)

Returns the reward for executing a multiplexer action.

Parameters
[in]xcsfThe XCSF data structure.
[in]actionThe selected action.
Returns
The payoff from performing the action.

Definition at line 92 of file env_mux.c.

References MAX_PAYOFF, EnvMux::pos_bits, and EnvMux::state.

◆ env_mux_free()

void env_mux_free ( const struct XCSF xcsf)

Frees the multiplexer environment.

Parameters
[in]xcsfThe XCSF data structure.

Definition at line 63 of file env_mux.c.

References EnvMux::state.

◆ env_mux_get_state()

const double* env_mux_get_state ( const struct XCSF xcsf)

Returns a random multiplexer problem instance.

Parameters
[in]xcsfThe XCSF data structure.
Returns
A random multiplexer problem.

Definition at line 76 of file env_mux.c.

References rand_uniform(), and EnvMux::state.

Here is the call graph for this function:

◆ env_mux_init()

void env_mux_init ( struct XCSF xcsf,
const int  bits 
)

Initialises a real multiplexer environment of specified length.

The biggest mux problem is chosen that fits the specified length.

Parameters
[in]xcsfThe XCSF data structure.
[in]bitsThe problem length.

Definition at line 44 of file env_mux.c.

References param_init(), EnvMux::pos_bits, and EnvMux::state.

Referenced by env_init().

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

◆ env_mux_is_done()

bool env_mux_is_done ( const struct XCSF xcsf)

Returns whether the multiplexer is in a terminal state.

Parameters
[in]xcsfThe XCSF data structure.
Returns
True.

Definition at line 121 of file env_mux.c.

◆ env_mux_maxpayoff()

double env_mux_maxpayoff ( const struct XCSF xcsf)

Returns the maximum payoff value possible in the multiplexer.

Parameters
[in]xcsfThe XCSF data structure.
Returns
The maximum payoff.

Definition at line 133 of file env_mux.c.

References MAX_PAYOFF.

◆ env_mux_multistep()

bool env_mux_multistep ( const struct XCSF xcsf)

Returns whether the multiplexer is a multistep problem.

Parameters
[in]xcsfThe XCSF data structure.
Returns
False.

Definition at line 145 of file env_mux.c.

◆ env_mux_reset()

void env_mux_reset ( const struct XCSF xcsf)

Dummy method since no multiplexer reset is necessary.

Parameters
[in]xcsfThe XCSF data structure.

Definition at line 110 of file env_mux.c.

Variable Documentation

◆ env_mux_vtbl

struct EnvVtbl const env_mux_vtbl
static
Initial value:
= {
}
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
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

Real multiplexer environment implemented functions.

Definition at line 59 of file env_mux.h.

Referenced by env_init().