XCSF  1.4.7
XCSF learning classifier system
env_mux.c File Reference

The real multiplexer problem environment. More...

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

Go to the source code of this file.

Macros

#define MAX_PAYOFF   (1.)
 Payoff provided for making a correct classification. More...
 

Functions

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

Generates random real vectors of length k+pow(2,k) where the first k bits determine the position of the output bit in the last pow(2,k) bits. E.g., for a 3-bit problem, the first rounded bit addresses which of the following 2 bits are the (rounded) output.

Example valid lengths: 3, 6, 11, 20, 37, 70, 135, 264.

Definition in file env_mux.c.

Macro Definition Documentation

◆ MAX_PAYOFF

#define MAX_PAYOFF   (1.)

Payoff provided for making a correct classification.

Definition at line 35 of file env_mux.c.

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.