MazeFromDict

This module provides a maze that is created from a fixed description as a dictionary. It extends Maze to create a specific type of maze with a fixed structure. This class is especially useful to allow exporting a maze to a file, and then reusing it later. It is also useful to test a player on a fixed maze.

class MazeFromDict.MazeFromDict(description, *args, **kwargs)[source]

(This class inherits from Maze ).

This is a maze that is created from a fixed description as a dictionary, where keys are cell indices. Associated values are dictionaries, where keys are neighbors of the corresponding cell, and values are the weights of the corresponding edges. This class is especially useful to allow exporting a maze to a file, and then reusing it later. It is also useful to test a player on a fixed maze, to compare its performance with other players.

__init__(description, *args, **kwargs)[source]

Initializes a new instance of the class.

Parameters:
  • description (dict[int, dict[int, int]]) – Fixed maze as a dictionary.

  • *args (object) – Arguments to pass to the parent constructor.

  • **kwargs (object) – Keyword arguments to pass to the parent constructor.