A. Changes to graphical user interface:
1. Unquoted Tk graphics section and created a main window for the GUI.
Refactored code for graphical user interface, splitting EnvFrame
into EnvGUI (main Tk window), EnvToolbar, and EnvCanvas.
2. Disabled binding of Mouse-1 and Mouse-2, which don't do anything
useful.
3. Implemented the add-object pop-up menu. Defined object_classes for
each kind of environment.
4. Added images for ReflexVacuumAgent and Dirt, and a get_image
method. get_image caches images in a dictionary to prevent
them from being garbage-collected and avoid repeated reading
of the same files.
Created image files for reflex vacuum agent and dirt.
B. Changes to XYEnvironment:
1. Implemented find_at method.
2. Implemented move_to method including bumping.
C. Other changes -- to support bumping, defined the Obstacle class,
and made Wall a subclass of Obstacle. A bump occurs when an agent
tries to move to a cell occupied by any kind of Obstacle.
Veuillez vous inscrire ou vous connecter pour commenter