Grid World - Actors

Actors

The GridWorld Case Study employs an Actor class to construct objects in the grid. The Actor class manages the object's color, direction, location, what the object does in the simulation, and how the object interacts with other objects.

Actors are broken down into the classes "Flower", "Rock", "Bug", and "Critter", which inherit the Actor class and often override certain methods (most notably the Act method). Flowers can't move, and when forced to Act, they become darker. Flowers are dropped by Bugs and eaten by Critters. Rocks are also immobile and aren't dropped or eaten. Bugs move directly ahead of themselves, unless blocked by a rock or another bug, in which case the Bug will make a 45 degree turn and try again. They drop flowers in every space they occupy, eat flowers that are directly on their space of grid, and are consumed by Critters. Critters move in a random direction to a space that isn't occupied by a Rock or other Critter and consume Flowers and Bugs.

Read more about this topic:  Grid World

Famous quotes containing the word actors:

    It was modesty that invented the word “philosopher” in Greece and left the magnificent overweening presumption in calling oneself wise to the actors of the spirit—the modesty of such monsters of pride and sovereignty as Pythagoras, as Plato.
    Friedrich Nietzsche (1844–1900)

    Today the young actors regard their environment with rage and disgust. They regard their Master not as disciples regard their Master, but as slaves regard their Master.
    Judith Malina (b. 1926)

    The great actors are the luminous ones. They are the great conductors of the stage.
    Minnie Maddern Fiske (1865–1932)