The Concord Consortium logo

Modeling Objects

........................................................................................................................................... Quick AgentSheets Instructions to Get You Started

Full instructions are available online at the AgentSheets web site. The instructions below are a quick overview to get you started.

In AgentSheets you give instructions, called "behavior", to agents that then use these instructions to tell them what to do on a sheet called a "Worksheet". An agent can be seen because you edit the way it looks, called its "depiction". In fact, an agent can have more than one depiction that it can change according to rules.

The Worksheet is a grid. Each agent is just the size of one grid. You cannot change the grid size except when you start making a new AgentSheets project.

When you open a project in AgentSheets, you see two windows: a Gallery and a Worksheet. The Gallery shows all the agents and their depictions. Click once on a depiction to select it. Click twice on it to open an editor that allows you to change the depiction.

The Worksheet has run/stop buttons. You can leave the simulation running while you change the depictions and behaviors of the agents. The tools along the left side of the Worksheet have the following use:

[pointer tool] The arrow allows you to pick up and move any agent.

[pencil tool] The pencil lets you drop one instance of the agent selected in the Gallery onto the Worksheet.

[eraser tool]The eraser removes any agent in the Worksheet. Agents pile up on top of each other; the eraser just removes the top one.

[hand tool][hammer tool] The next two tools (the hand and hammer) can be programmed. The Pop programs use the hammer to erase the black dots.

[rectangle fill tool]The gray rectangle allows you to fill a region with the agent selected in the Gallery.

[rectangle erase tool]The empty rectangle allows you to erase a region with the agent selected in the Gallery.

[?  tool]The question mark can be programmed to give information.


To see how the behavior is programmed, select an agent and then pick the menu item Gallery: Edit Behavior. You will see the program in a graphical form that is very easy to read. This program is executed over and over for each agent of this type on the Worksheet.

The program consists of blocks of code called "methods". Within a method there are lines called "rules". Each rule has an "if" part and a "then" part. Inside the "if" box there are " conditions". Double click on a "if" box to see all the possible conditions.

The computer goes down the list of rules checking whether all the "if" conditions for each rule are true. A rule with a blank "if" condition is always true. When the computer finds a rule with a true (or blank) "if" part, it goes on to the "then" part of the rule. Inside the "then" box there will be one or more actions for the computer to execute. Double-click on a "then" box to see all the possible actions. Once the computer finishes doing the actions, it stops executing that method. No other rules are considered.

You will always see a method that starts "While running". As long as the "run" button is on, this method is executed repeatedly for every agent. If there are other methods, they are executed only if asked by an action or by the user clicking on one of the programmable tools, such as the hammer.

To change the program, you can change the values in the conditions and actions, you can make new rules and methods, and you can drag new conditions and actions into rules. Experiment.

Here are some things you may need to know:

To create a new agent, first select the menu item Gallery: New Agent… Then edit its appearance and behavior.

The red dot in a condition or action refers to the current agent. The red dot with an arrow refers to the adjacent agent in the direction of the arrow. Click on the red dot to see the options.

The agent you want in a condition or action can be selected by clicking on the graphic of one of the agents and selecting desired depiction.

Change the order of rules by clicking and dragging on the silver "if" box of a rule you want to move. While you drag the rule, a red line will appear where the rule will go if you release it.

To see the effect of a change, click the "apply" button at the bottom of the Behavior window. Press "OK" when you are done to apply the changes, save them, and close the window.

There is one tricky thing in Pop3 and Moose. A rule in one agent can invoke a method in the behavior of another kind of agent using the "broadcast" action. This is how Pop3 counts how many black balls there are. The counter agent broadcasts a command to all the dots. This causes each, in turn, to broadcast a command to the counters (there is usually only one) to increase their count by one. If the count started at zero, then this results in counting how many dots there are.

The Moose project has agents with different depictions. All the depictions of one agent are linked by lines in the Gallery. You can, for instance, see a male moose facing left or right. These are different depictions of the same male moose agent. All depictions of the same agent have the same behavior. Thus, for instance, the male moose has a behavior but there are not different behaviors for left- and right-facing male moose.

Suggestions for running the programs

To start a program, first close any AgentSheets Gallery windows and then double-click on the Worksheet you want to see.

Click on Run and leave it on.

...........................................................................................................................................
 
[ return to AgentSheets Introduction ]

Copyright © 1999 The Concord Consortium
All rights reserved. Site questions and comments: webmaster@concord.org

Helix Molecule Screenshot

Helix Molecule Screenshot
This helix molecule was generated by the Molecular Workbench software. When you view it in the software, you can manipulate it by rotating and zooming.