AgentSheets Mini-Manual

These are just some tips on how to use AgentSheets. For a comprehensive manual, please refer to: http://www.cs.colorado.edu/~l3d/systems/agentsheets/manuals

The AgentSheets Environment has the following components:

  1. Gallery: The place where you define your agents
  2. Worksheet: The place where your simulation occurs. The simulated world.
  3. Tool Panel: The set of tools available for using on the Worksheet. It includes the following tools:

    Pointer Tool: use it to select and drag agents

    Draw (Pencil) Tool: use it to draw the agent selected in the Gallery

    Eraser Tool: use it to erase agents

    Hand Tool: define your own interactions with this tool in the behavior of an agent

    Whack Tool: define your own interactions with this tool in the behavior of an agent

    Draw Rectangle Tool: use it to draw a rectangle full of the agents selected in the Gallery

    Question Mark Tool:	use it to inquire agents about the values of their attributes

  4. Background: A picture you can use as a background for your Worksheet.

Here are some pointers on how to perform various operations in the AgentSheets environment:


Starting the Simulation Press the button
Stopping the Simulation Press the button
Opening a Project Go to File ->Open Project…

Choose a project from the list provided and wait for it to load.

Creating a New Project Go to File ->New Project… The system will ask you to give a Project Name. Type in a name and click "OK". A window will appear in which you need to select the size of your agents.



From the pop-up menu, choose the dimensions of your agents. Note that this decision is final. You cannot go back and change the size of your agents after you have created them! A new Gallery will appear on your screen. Make sure you save it, using File ->Save and giving it a name of your choice.
Opening a Worksheet Go to File ->Open Worksheet…

Choose a worksheet from the list provided. If there are no worksheets, you can create your own.
Creating a New Worksheet Go to File ->New Worksheet

A new untitled worksheet appears.
Saving a Worksheet Select the worksheet to be saved.

Go to File ->Save and provide a name (if this is a new worksheet that you are saving).
Placing Agents on a Worksheet In the Gallery, select the agent you want to place on the worksheet.

Go to the worksheet.

Select the "Pencil Tool" from the Tool Panel.

Click wherever you want your new agent to be on the worksheet.

If you want to add a bunch of agents at once, select the agent you want to place on the worksheet from the gallery, then select the "Draw Rectangle Tool" and draw a rectangle where you want the new agents to appear in your worksheet.
Erasing an Agent Select the "Eraser Tool" from the Tool Panel, then click on the agent you want to have erased in the Worksheet.
Creating a New Agent Go to Gallery->New Agent…



You will be prompted to give the name of your new agent. Type in a name and click "OK". A new agent is created for you in the Gallery. To define its look (depiction), double click on the new agent. You will get the Depiction Editor where you can draw the look of your agent.



If you do not wish to draw your agent from scratch, but have found a good picture that you can use, select the agent in the Gallery, and then use Gallery->Grab Screen 1:1 or to Gallery->Grab Screen Any Size.
Creating Behaviors

Put the agent to be programmed in the worksheet and open its Behavior Editor by double-clicking on it. A Behavior Editor is the place where the behavior of an agent is defined, in the form of IF-THEN rules. It has the following components:

  1. Behavior Editor Window
  2. While Running Method: what gets executed once you run the simulation
  3. Rule: an IF-THEN pair which contains conditions and actions
  4. Condition: Situations for the agent to check if they apply
  5. Action: Things to perform, given that the conditions of the rule are met
  6. Buttons
    • New Rule: creates new rule
    • New Method: creates new method
    • Copy: copies the selected item (rule, condition, or action)
    • Apply: applies the changes that you made in the behavior, but without closing the window and without saving the changes
    • OK: applies the changes that you made in the behavior, closes the window and saves the changes
  7. Trash: where you drag unwanted methods, rules, conditions or actions to delete them

The rules are ordered from top to bottom and the rules at the top have higher priority than the rules at the bottom. This basically means that when the simulation is running and the rules of an agent are checked, the first rule whose conditions are met gets executed and the rest are ignored. If none of the conditions of an agent's rules is met, the agent does nothing.

Getting the Condition and Action Palettes Go to Tools ->Conditions Palette to get the Conditions Palette and to Tools ->Actions Palette to get the Actions Palette.

Choosing Conditions From the Conditions Palette chose which conditions you wish to use and drag it to the IF part of the rule. You have the following to chose from:
 
See: Detect agents in the direction specified that look like the depiction specified
See a: Detect agents in the direction specified that are of the type specified
Next to: Check if the agent is next to a number of the agents specified
Empty: Check whether the direction specified is empty
Key: Check if the key specified is pressed
%Chance: With the percentage specified (e.g. 50%), the condition evaluates to true
Once every: The condition evaluates to true periodically, for example, once every second
Sound Level: Check if the noise level is greater than the value specified (range: 0-255)
Hear: Check to see if the string specified was spoken by an agent around you
Is: Check whenther the value of an attribute (such as age) is equal, greater than, or less than a specified number
Has Attribute: Check to see if an agent at the direction specified has a particular attribute
WWW Read: Go to the URL specified and look for the string specified and read the value that follows in the attribute specified. For example, go to the yahoo Web page, look for the string "Dow" and save the value that follows it into the dow attribute. This will give you the current Dow Jones index.
Choosing Actions From the Actions Palette chose which conditions you wish to use and drag it to the THEN part of the rule. You have the following to chose from:
Move: Move the agent one square over in the direction specified
Move Random On: Move the agent randomly on the backround agent specified
Change: Change the look of the agent at the direction specified to the new depiction
New: Create a new agent of the kind that was specified, in the direction specified
Erase: Erase the agent at the direction specified
Set Color to: set the color of the agent to the color specified
Make: Make the agent at the direction specified perform the action specified (this needs to be a valid method in that agent)
Broadcast: Broadcast a message (e.g. animate) to all the agents of the type specified
Wait: Make the simulation stop for the amount of time specified
: Play the sound specified
Sound: Play the sound specified at the pitch specified
Record: Record a sound
: Speak the string specified
Play the pitch specified with the instrument specified
Set: Set the value of an agent’s attibute to a number or formula
Map: Map the value of the attribute specified to a color using the first color for the one extreme of the range of values and the second color for the other
Plot: Plot the value of the attribute specified between the two values specified, using the foreground and background colors specified
: Open the URL specified in a Web Browser
Load Background: Load the background picture specified
Help: When the Balloon Help on a Macintosh is on, print the specified string in a balloon, when the mouse is over the agent.
Reordering rules In the Rule Editor, grab a rule and drag it where you want it to be. You will see red lines indicating where the rule will be placed if it is dropped at that moment.
Adding a New Rule In the Rule Editor, click on the button.
Copying a Rule, Action, or Condition Select the rule, action, or condition you want copied and click on the button in the Rule Editor .
Deleting a Rule, Action, or Condition Drag the rule, action, or condition you want to delete and drag it to the Trash of the Rule Editor