Package kuimaze :: Module maze
[hide private]
[frames] | no frames]

Module maze

source code

Main part of kuimaze - framework for working with mazes. Contains class Maze (capable of displaying it) and couple helper classes


Author: Otakar Jašek, Tomas Svoboda

Contact: jasekota(at)fel.cvut.cz, svobodat@fel.cvut.cz

Copyright: (c) 2017, 2018

Classes [hide private]
  SHOW
Enum class used for storing what is displayed in GUI - everything higher includes everything lower (except NONE, of course).
  ACTION
Enum class to represent actions in a grid-world.
  ProbsRoulette
Class for probabilistic maze - implements roulette wheel with intervals
  ActionProbsTable
  Maze
Maze class takes care of GUI and interaction functions.
Variables [hide private]
  fw_orig = warnings.formatwarning
  weighted_state = collections.namedtuple('State', ['x', 'y', 'r...
Namedtuple to hold state position with reward.
  state = collections.namedtuple('State', ['x', 'y'])
Namedtuple to hold state position.
  path_section = collections.namedtuple('Path', ['state_from', '...
Namedtuple to hold path_section from state A to state B.
  MAX_CELL_SIZE = 200
Maximum size of one cell in GUI in pixels.
  MAX_WINDOW_PERCENTAGE = 0.85
Maximal percentage of smaller screen size, GUI window can occupy.
  BORDER_SIZE = 0
Border size of canvas from border of GUI window, in pixels.
  LINE_SIZE_PERCENTAGE = 0.1
Percentage of actuall cell size that specifies thickness of line size used in show_path.
  DRAW_LABELS = True
Draw the x,y labels
  LINE_COLOR = "#FFF555333"
  WALL_COLOR = "#000000000"
  EMPTY_COLOR = "#FFFFFFFFF"
  EXPLORED_COLOR = "#000BBB000"
  SEEN_COLOR = "#BBBFFFBBB"
  START_COLOR = "#000000FFF"
  FINISH_COLOR = "#000FFFFFF"
  DANGER_COLOR = "#FFF000000"
  FONT_FAMILY = "Helvetica"
Font family used in GUI
  FONT_SIZE = round(12* MAX_CELL_SIZE/ 50)
Text size in GUI (not on Canvas itself)
Variables Details [hide private]

weighted_state

Namedtuple to hold state position with reward. Interchangeable with state

Value:
collections.namedtuple('State', ['x', 'y', 'reward'])

state

Namedtuple to hold state position. Mostly interchangeable with weighted_state

Value:
collections.namedtuple('State', ['x', 'y'])

path_section

Namedtuple to hold path_section from state A to state B. Expects state_from and state_to to be of type state or weighted_state

Value:
collections.namedtuple('Path', ['state_from', 'state_to', 'cost', 'act\
ion'])

MAX_CELL_SIZE

Maximum size of one cell in GUI in pixels. If problem is too large to fit on screen, the cell size will be smaller

Value:
200

LINE_SIZE_PERCENTAGE

Percentage of actuall cell size that specifies thickness of line size used in show_path. Line thickness is then determined by max(1, int(LINE_SIZE_PERCENTAGE * cell_size))

Value:
0.1