XCSF
1.4.7
XCSF learning classifier system
|
The discrete maze problem environment module. More...
Go to the source code of this file.
Data Structures | |
struct | EnvMaze |
Maze environment data structure. More... | |
Macros | |
#define | MAX_SIZE (50) |
The maximum width/height of a maze. More... | |
Functions | |
bool | env_maze_is_done (const struct XCSF *xcsf) |
Returns whether the maze is in a terminal state. More... | |
bool | env_maze_multistep (const struct XCSF *xcsf) |
Returns whether the environment is a multistep problem. More... | |
double | env_maze_execute (const struct XCSF *xcsf, const int action) |
Executes the specified action and returns the payoff. More... | |
double | env_maze_maxpayoff (const struct XCSF *xcsf) |
Returns the maximum payoff value possible in the maze. More... | |
const double * | env_maze_get_state (const struct XCSF *xcsf) |
Returns the current animat perceptions in the maze. More... | |
void | env_maze_free (const struct XCSF *xcsf) |
Frees the maze environment. More... | |
void | env_maze_init (struct XCSF *xcsf, const char *filename) |
Initialises a maze environment from a specified file. More... | |
void | env_maze_reset (const struct XCSF *xcsf) |
Resets the animat to a random empty position in the maze. More... | |
Variables | |
static struct EnvVtbl const | env_maze_vtbl |
Maze environment implemented functions. More... | |
The discrete maze problem environment module.
Definition in file env_maze.h.
#define MAX_SIZE (50) |
The maximum width/height of a maze.
Definition at line 29 of file env_maze.h.
double env_maze_execute | ( | const struct XCSF * | xcsf, |
const int | action | ||
) |
Executes the specified action and returns the payoff.
[in] | xcsf | The XCSF data structure. |
[in] | action | The action to perform. |
Definition at line 217 of file env_maze.c.
References EnvMaze::done, MAX_PAYOFF, EnvMaze::maze, x_moves, EnvMaze::xpos, EnvMaze::xsize, y_moves, EnvMaze::ypos, and EnvMaze::ysize.
void env_maze_free | ( | const struct XCSF * | xcsf | ) |
Frees the maze environment.
[in] | xcsf | The XCSF data structure. |
Definition at line 147 of file env_maze.c.
References EnvMaze::state.
const double* env_maze_get_state | ( | const struct XCSF * | xcsf | ) |
Returns the current animat perceptions in the maze.
[in] | xcsf | The XCSF data structure. |
Definition at line 187 of file env_maze.c.
References env_maze_sensor(), EnvMaze::maze, EnvMaze::state, EnvMaze::xpos, EnvMaze::xsize, EnvMaze::ypos, and EnvMaze::ysize.
void env_maze_init | ( | struct XCSF * | xcsf, |
const char * | filename | ||
) |
Initialises a maze environment from a specified file.
[in] | xcsf | The XCSF data structure. |
[in] | filename | The file name of the specified maze environment. |
Definition at line 100 of file env_maze.c.
References MAX_SIZE, EnvMaze::maze, param_init(), EnvMaze::state, EnvMaze::xsize, and EnvMaze::ysize.
Referenced by env_init().
bool env_maze_is_done | ( | const struct XCSF * | xcsf | ) |
Returns whether the maze is in a terminal state.
[in] | xcsf | The XCSF data structure. |
Definition at line 175 of file env_maze.c.
References EnvMaze::done.
double env_maze_maxpayoff | ( | const struct XCSF * | xcsf | ) |
Returns the maximum payoff value possible in the maze.
[in] | xcsf | The XCSF data structure. |
Definition at line 259 of file env_maze.c.
References MAX_PAYOFF.
bool env_maze_multistep | ( | const struct XCSF * | xcsf | ) |
Returns whether the environment is a multistep problem.
[in] | xcsf | The XCSF data structure. |
Definition at line 271 of file env_maze.c.
void env_maze_reset | ( | const struct XCSF * | xcsf | ) |
Resets the animat to a random empty position in the maze.
[in] | xcsf | The XCSF data structure. |
Definition at line 159 of file env_maze.c.
References EnvMaze::done, EnvMaze::maze, rand_uniform_int(), EnvMaze::xpos, EnvMaze::xsize, EnvMaze::ypos, and EnvMaze::ysize.
|
static |
Maze environment implemented functions.
Definition at line 66 of file env_maze.h.
Referenced by env_init().