Package kuimaze :: Module baseagent :: Class BaseAgent
[hide private]
[frames] | no frames]

Class BaseAgent

source code

Base class for players. All student solutions must inherit from this class.

Instance Methods [hide private]
 
__init__(self, problem)
All inherited players must call this method.
source code
 
find_path(self)
Method that must be implemented.
source code
Method Details [hide private]

__init__(self, problem)
(Constructor)

source code 

All inherited players must call this method. Expects problem to be instance of kuimaze.Maze. If problem has show_level other than kuimaze.SHOW.NONE, it will start a GUI automatically.

Parameters:
  • problem (Maze) - Maze to associate your player with:
Raises:
  • AssertionError - if problem is not an instance of Maze

find_path(self)

source code 

Method that must be implemented. Otherwise raise NotImplementedError. Expects to return a path_section as a list of positions [(x1, y1), (x2, y2), ... ].

Returns:
path_section as a list of positions [(x1, y1), (x2, y2), ... ]. Must