Getting started

This page attempts to help you get started with using the Behaviour Composer. If you get stuck please let us know by posting a message to the Discussion Forum, and if you find a bug or have an idea for a new feature please let us know by posting an item to the Bugs & Suggestions tool.

Prototypes and micro-behaviours

We use the words prototype and micro-behaviour in the following sense:

  • A prototype is the generic name for the thing(s) that constitutes your model e.g. ants, foxes, people, cars.
  • A micro-behaviour is a block of computer code that you can add to a prototype.

Let's do something with these concepts!

  1. Go to the Behaviour Composer website
  2. You'll see a number of tabs across the top of the screen and you should currently be on the "Help Tab".
  3. Go to the "Behaviour Composer" Tab
  4. Left click the box that is labelled "Prototype 1" to bring up a menu, then select "Rename"
  5. Use this text editor to change the name of the prototype to "Fish"
  6. Press the "Save" button

Add a micro-behaviour to a prototype

Now we 'animate' your Fish prototype by adding a block of code or "micro-behaviour":

  1. Navigate to the "Full-Library" Tab
  2. Find the micro-behaviour called "MOVE-FORWARD" and click the hyper-link
  3. Press the button labelled "MOVE FORWARD" in this page
  4. By clicking the MOVE FORWARD button you will automatically be taken to the Behaviour Composer Tab
  5. Click on the text box for the Fish prototype where it says "Fish". This will add the MOVE-FORWARD micro-behaviour block of code to the Fish prototype.

Run model

So you've just created your first model, let's see what it does:

  1. Press the "Run" button in the "Behaviour Composer" tab.
  2. Press the link titled "Run the model" in a new browser window or tab.
  3. This will open a new tab in your browser to load the model. Please give the model time to load in your browser, the first time you do this may take a bit longer!
  4. When the "applet" has loaded press the button on the left of the screen labelled "GO"
  5. You should now see a triangle moving forward continuously (- your very unrealistic Fish prototype).

Changing micro-behaviours

First of all repeat the process you've just gone through to add the following micro-behaviours to your model:

  • SET-SHAPE
  • WANDER-RANDOMLY-BY-TURNING
  • SET-SHAPE-FISH
  • SET-SIZE-2

Now run this new model. What your fish is doing is moving 1 step forward and turning randomly each unit of time. You can change the model to make the fish move forward more slowly by:

  1. Go back to the "Behaviour Composer" tab
  2. Left-click with your mouse the MOVE-FORWARD micro-behaviour to bring up the menu and select "Open"
  3. Within the code section of the micro-behaviour:
do-every delta-t
  [go-forward  1 delta-t]
  1. Type 0.5 instead of 1 into the text box within the code
  2. Go back to the "Behaviour Composer" tab and press the "Run" button
  3. You should now see a fish looking like it is swimming in treacle!

Add copies

Remember a prototype is like something made in a factory, once you've designed the product, you can then make many copies of it. The Behaviour Composer works in a similar way:

  1. Go back to the "Full-Library" tab, find the ADD-COPIES micro-behaviour and add it to your "Fish" prototype
  2. Now run your model

You should now have a school of fish, swimming completely oblivious to each other in what must be for them, rather annoying treacle. (If you're feeling a bit guilty about the treacle scenario you could always go back and change the MOVE-FORWARD micro-behaviour!)

Share you models

One of the main advantages of constructing computers models through a web browser is that it makes it very easy for you to quickly share your models with other people. The Behaviour Composer allows you to share your models in many different ways. The easiest way to find out more about this is to simply follow the instructions on the "Share" tab.

What next?

Here we've tried to step through just enough to get you started. Now you should be ready to explore the Behaviour Composer at your own pace.

Explore the library, try create some models, and then tell others about what you've done on the Modelling4All Discussion Group.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License