Maze class takes care of GUI and interaction functions.
|
__init__(self,
image,
grad,
node_rewards=None,
path_costs=None,
trans_probs=None,
show_level=SHOW.FULL_MAZE,
start_node=None,
goal_nodes=None)
Parameters node_rewards, path_costs and trans_probs are meant for
defining more complicated mazes. |
source code
|
|
|
|
namedtuple
state
|
|
|
|
|
|
boolean
|
|
|
|
list
|
|
list of namedtuple weighted_state
|
|
tuple
|
|
action from
ACTION
|
get_actions(self,
current_state)
Generate (yield) actions possible for the current_state It does not
check the outcome this is left to the result method |
source code
|
|
namedtuple
state
|
result(self,
current_state,
action)
Apply the action and get the state; deterministic version |
source code
|
|
list of tuples
|
|
|
|
|
set_probs(self,
obey,
confusionL,
confusionR,
confusion180) |
source code
|
|
|
set_probs_table(self,
obey,
confusionL,
confusionR,
confusion180) |
source code
|
|
|
|
|
|
boolean
|
|
boolean
|
|
|
clear_player_data(self)
Clear player data for using with different player or running another
find_path |
source code
|
|
|
__clear_player_data(self)
Clear player data for using with different player or running another
find_path |
source code
|
|
|
|
|
show_and_break(self,
drawed_nodes=None)
Main GUI function - call this from BaseAgent.find_path() to update GUI
and break at this point to be able to step your actions. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
__renew_gui(self)
Renew GUI if a new player connects to a problem object. |
source code
|
|
|
__set_show_level_cb(self)
Just a simple callback for tkinter radiobuttons for selecting show
level |
source code
|
|
|
__clear_lines(self)
Clear path_section lines if running same player twice. |
source code
|
|
|
|
|
save_as_eps(self,
disabled)
Save canvas as color EPS - response for third button. |
source code
|
|
|
|
|
|
|
|
|
|
|
__draw_text(self,
current_node,
string)
Draw text in the center of cells in the same manner as draw colors is
done. |
source code
|
|
|
__text_to_top(self)
Move text fields to the top layer of the canvas - to cover arrow
:return: |
source code
|
|
|
|
|
|
|
__set_grad_data(self)
Sets data needed for rendering 3D ilusion :return: None |
source code
|
|