GridWorld Case Study Part 1 Experiments to Observe Attributes and Behavior of Actors A Summary by Jim Mims
Mar 27, 2015
GridWorld Case Study
Part 1
Experiments to Observe Attributes and Behavior of Actors
A Summary by Jim Mims
Contents
Introduction and Weighting
Part 1: Observing and Experimenting with GridWorld
Part 2: Bug Variations
Part 3: GridWorld Classes and Interfaces
Part 4: Classes that Extend the Critter Class
Part 5: Grid Data Structures
Classes and Interfaces: Relationships
Introduction and Weighting
The case study provides a graphical environment where visual objects inhabit and interact in a two-dimensional grid.
Students design and creator actor objects, add them to a grid, and determine whether they behave according to specifications.
Weighting Multiple-Choice Questions: Several Free Response Questions: 1
Observing and Experimenting with GridWorld
The first demo contains a two-dimensional grid contaning two actors, a bug and a rock.
Clicking on the step button runs one step, making each actor act once.
Clicking on the run button caries out a series of steps until the Stop button is clicked.
The delay between steps is controlled by the slider.
Observing and Experimenting with GridWorld
Clicking on a empty cell displays a drop-down menu that shows the constructors for different actor types.
The menu lists constructors for the classes of all objects that have ever been placed on the grid.
Selecting one of the constructors places an instance of that type on the grid note the dialog box that appears for parameters.
Observing and Experimenting with GridWorld
The dialog box mentioned on the previous slide is shown on the right.
The grid uses directions as on a map, to include diagonal directions.
One attribute of the bug is its direction (indicated by its antennae).
Initially, the bug faces North.
Observing and Experimenting with GridWorld
Clicking on an actor displays a drop-down menu of the methods that can be invoked on that actor.
Those above the line are specified by the class that defines the actor.
Those below the line are methods inherited from the Actor class.
Observing and Experimenting with GridWorld
Accessor methods will have their results displayed in a dialog window.
Modifier methods will cause an appropriate change in the display of the actor.
If parameters are needed for a method, you provide them through a dialog window as shown on the right.
Observing and Experimenting with GridWorld
Mouse Action Result
Click on empty location Shows constructor menu
Click on occupied location Shows method menu
Select Location-Delete menu item Removes the occupant in the currently selected location from he grid
Click on the Step button Calls act of each actor
Click on the Run button Starts run mode
Observing and Experimenting with GridWorld
Mouse Action Result
Click on the Stop button Stops run mode
Adjust the Slow/Fast slider Changes speed of run mode
Select the Location Zoom in/Zoom out Zooms grid display in or out
Adjust the scroll bars next to grid Scrolls to other parts of the grid (if grid is too large to fit in window)
Observing and Experimenting with GridWorld
Mouse Action Result
Select the World Set grid menu item Changes between bounded and unbounded grids
Select the World Quit menu item Quits GridWorld