XCSF 1.4.8
XCSF learning classifier system
Loading...
Searching...
No Matches
env_maze.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
29#define MAX_SIZE (50)
30
34struct EnvMaze {
35 double *state;
37 int xpos;
38 int ypos;
39 int xsize;
40 int ysize;
41 bool done;
42};
43
44bool
45env_maze_is_done(const struct XCSF *xcsf);
46
47bool
48env_maze_multistep(const struct XCSF *xcsf);
49
50double
51env_maze_execute(const struct XCSF *xcsf, const int action);
52
53double
54env_maze_maxpayoff(const struct XCSF *xcsf);
55
56const double *
57env_maze_get_state(const struct XCSF *xcsf);
58
59void
60env_maze_free(const struct XCSF *xcsf);
61
62void
63env_maze_init(struct XCSF *xcsf, const char *filename);
64
65void
66env_maze_reset(const struct XCSF *xcsf);
67
Built-in problem environment interface.
#define MAX_SIZE
The maximum width/height of a maze.
Definition env_maze.h:29
bool env_maze_is_done(const struct XCSF *xcsf)
Returns whether the maze is in a terminal state.
Definition env_maze.c:175
void env_maze_free(const struct XCSF *xcsf)
Frees the maze environment.
Definition env_maze.c:147
const double * env_maze_get_state(const struct XCSF *xcsf)
Returns the current animat perceptions in the maze.
Definition env_maze.c:187
bool env_maze_multistep(const struct XCSF *xcsf)
Returns whether the environment is a multistep problem.
Definition env_maze.c:271
double env_maze_execute(const struct XCSF *xcsf, const int action)
Executes the specified action and returns the payoff.
Definition env_maze.c:217
void env_maze_init(struct XCSF *xcsf, const char *filename)
Initialises a maze environment from a specified file.
Definition env_maze.c:100
static struct EnvVtbl const env_maze_vtbl
Maze environment implemented functions.
Definition env_maze.h:71
void env_maze_reset(const struct XCSF *xcsf)
Resets the animat to a random empty position in the maze.
Definition env_maze.c:159
double env_maze_maxpayoff(const struct XCSF *xcsf)
Returns the maximum payoff value possible in the maze.
Definition env_maze.c:259
Maze environment data structure.
Definition env_maze.h:34
int xsize
Maze size in x dimension.
Definition env_maze.h:39
int ysize
Maze size in y dimension.
Definition env_maze.h:40
bool done
Whether the maze is in a terminal state.
Definition env_maze.h:41
double * state
Current state.
Definition env_maze.h:35
int xpos
Current x position.
Definition env_maze.h:37
int ypos
Current y position.
Definition env_maze.h:38
char maze[(50)][(50)]
Maze.
Definition env_maze.h:36
Built-in problem environment interface data structure.
Definition env.h:35
XCSF data structure.
Definition xcsf.h:85
XCSF data structures.