1
2
3
4 '''
5 Contains class BaseAgent from which all of players must inherit.
6 @author: Zdeněk Rozsypálek, and the KUI-2018 team
7 @contact: svobodat@fel.cvut.cz
8 @copyright: (c) 2017, 2018
9 '''
10
11 import collections
12 import random
13
14 import kuimaze.maze
15
16
18 '''
19 Base class for players. All student solutions must inherit from this class.
20 '''
21
23 '''
24 All inherited players must call this method. Expects problem to be instance of L{kuimaze.Maze}.
25 If problem has L{show_level<kuimaze.SHOW>} other than L{kuimaze.SHOW.NONE}, it will start a GUI automatically.
26
27 @param problem: Maze to associate your player with:
28 @type problem: L{Maze}
29 @raise AssertionError: if problem is not an instance of L{Maze}
30 '''
31 assert(isinstance(problem, kuimaze.maze.Maze))
32 self.problem = problem
33 self.problem.set_player(self)
34
35
37 '''
38 Method that must be implemented. Otherwise raise NotImplementedError. Expects to return a path_section as a list of positions [[x1, y1], [x2, y2], ... ].
39
40 @return: path_section as a list of positions [(x1, y1), (x2, y2), ... ]. Must
41
42 '''
43 raise NotImplementedError('Not implemented yet')
44