|
Public Member Functions |
| | grid (void) |
| | Default constructor.
|
| | grid (int x, int y) |
| | Constructor specifying size of maze.
|
| CELL_STATE | state (int x, int y) const |
| CELL_STATE | heading (int x, int y, atomic_rotation) const |
| void | solve_maze (int cx, int cy, atomic_rotation face, const pose_chain &waypoints, int itarget, motion_chain &path, bool obstacles) |
| | Solves maze starting from point cx,cy heading direction "face".
|
| void | wall (int x, int y, CELL_STATE ctype) |
| | Fills specified coordinate with specified cell state. (blocked open, etc.).
|
| int | height (void) const |
| | Returns height of maze.
|
| int | width (void) const |
| | Returns width of maze.
|
| void | save_rom_map (long ROM_ADDRESS) const |
| | Save internal map to ROM (or battery backed RAM).
|
| void | load_rom_map (long ROM_ADDRESS) |
| | Load internally stored map from ROM/RAM.
|
| bool | obstacles (void) |
| | Returns whether obstacles are present or not.
|
| void | branches (short) |
| | Sets how many branches from each map cell.
|
Private Member Functions |
| CELL_TYPE | value (int x, int y) const |
| void | whipitgood (motion_chain &path) |
| void | generate_bellman_matrix (void) |
| void | update_frontiers (int, int, atomic_rotation) |
| void | process_frontiers (int, int) |
| bool | unique_frontier (int, int) |
| void | traverse_back2goal (motion_chain &path) |
| bool | check_heading (atomic_rotation AR, int x, int y, int &imin) |
| void | init (void) |
| void | reinit (void) |
Private Attributes |
| pose_chain | _frontiers |
| pose_chain | _visited |
| maze_cell | _maze [22][22] |
| int | _starting_x |
| int | _starting_y |
| int | _starting_face |
| int | _destination_x |
| int | _destination_y |
| atomic_rotation | _destination_face |
| atomic_rotation | _new_face |
| int | _new_x |
| int | _new_y |
| int | _size_x |
| int | _size_y |
| bool | _done |
| bool | _obstacles |
| short | BRANCHES |
void init_maze()
{
for (int j=0; j<maze.height(); j++)
{
for (int i=0; i<maze.width(); i++)
{
if (i == (maze.width()-1)) maze.wall(i,j,WALL);
if (i == 0) maze.wall(i,j,WALL);
if (j == 0) maze.wall(i,j,WALL);
if (j == (maze.height()-1)) maze.wall(i,j,WALL);
}
}
}