Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle...

26
Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial is a draft of materials being developed as part of behavioral research underway in the CSSE at Auburn. It is provided on an "as-is" basis; however, we welcome comments and suggestions. Please direct any feedback to [email protected]. SimBuilder Tutorial © AU Visual Languages Group
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    217
  • download

    0

Transcript of Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle...

Page 1: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Exploring Visual Programming

Squeak SimBuilder Tutorial

Implementing a Model of the Water Cycle

Human Computer Interaction

@

Auburn University

This tutorial is a draft of materials being developed as part of behavioral research underway in the CSSE at Auburn. It is provided on an "as-is" basis; however, we welcome comments and suggestions. Please direct any feedback to [email protected].

SimBuilder Tutorial © AU Visual Languages Group

Page 2: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Preliminaries The purpose of this document is to introduce you to SimBuilder by

helping you create a small project.

SimBuilder is designed for building simulations, such as a model of the water cycle.

No programming experience is required.

In this experiment we want to evaluate the usefulness of this tool to a science teacher to simulate environments or lab experiments as curricula aids in their classrooms with SimBuilder.

The last page of this document contains an interaction guide.

Page 3: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Exploring the Water Cycle Model

Double click to open the Squeak environment.

Select Water Cycle

This will open your first example of a simulation.

Now, Press to start this model.

Watch the Simulation. What actions are taking place?

Press after a few minutes of observing the model.

AgentSheets Tutorial © Virginia Tech Visual Languages Group-Draft

Squeak

Page 4: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Exploring The Sun

Let’s investigate the playersTo investigate the Sun <Alt> Click or <Middle button> Click the Sun and it’s Halo will appear.

Select the purple eyedropper Change color tool to and change the Sun from yellow to bright orange.

To investigate the rules or that govern the sun’s behavior, Select the blue eyeball to Open a Viewer of me.

This will show you the set of graphical rules for this player.

What does the Sun do?

You program by simply selecting a rule, then dragging and dropping the out of the scripting window and placing it somewhere in the world other than the green playground.

(Take a few minutes to explore scripts in the viewer…)

Page 5: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Changing The Behavior of Clouds Examine some of the more complicated behaviors by selecting the Cloud and reviewing its behavior.

Take a moment to review the interaction guide to gain a better understanding of the interactions between player’s behaviors

Make Clouds more active. Currently the behavior of the cloud is to move forward 5 spaces. Find the script that causes this behavior. Let’s make the clouds move a lot more.

Select the desired script

Increase the value to 10 for moving forward.

Press to see how your changes affect the simulation.

Press and try another change.

Make the clouds move vertically.

Currently the behavior of the cloud is to move horizontally across the sky. Let’s try to change the behavior of the cloud so that it will move vertically.

<Alt> Click or <Middle button> Click your cloud and it’s Halo will appear.

Select Rotate and move your cloud just a tiny bit for it’s direction arrow to appear.

In order to change the direction that the player moves Click on the green arrow and change its direction so that it points to the right.

Press to see how the simulation has changed.

Page 6: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Creating a Bird

A simulation in Agentsheets is simply a set of agents that work together to create visual effects.A key aspect of creating new simulations is to build new agents. We will begin with the small task of

adding a new agent to the Water Cycle project.

Drawing a bird

Select .

Use a brush and the color palette to draw something that looks like a bird.

Refer to the interaction guide for Gallery Tools if you need to refresh your memory.This is just for fun. Do not worry if you are not a good artist.

Once finished Press . Your bird has been added to the playground. It’s just as easy as that !!!

Page 7: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Giving the Bird Behaviors

In this playground, we want the bird to be able to fly through the sky.

Double click on your bird and it’s viewer will appear. The viewer is a window to select behaviors for your agent. Let’s add the behavior that your agent will move in one direction. Select

and Drag it out of the viewer and place it anywhere, preferably not in the playground.

Press to see how your bird acts within the playground. Your bird should fly across the playground. If it doesn’t you may need to check out which direction your bird is flying.

<Alt> Click or <Middle button> Click your bird and it’s Halo will appear.

Select Rotate and move your bird just a tiny bit for it’s direction arrow to appear.

Click on the green arrow and change its direction so that it points to the right.

Try putting a bird on the ground. Does it move? What would you need to make it move?

Now you have all the basic tools you need to create your own Simulations!!

Page 8: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Creating a Volcano Simulation

A sample environment that you could simulate is a volcano erupting. A volcano involves the interaction of several complex factors. Pressure is built up over a period of time. Once the pressure reaches a certain level the pressure is released as sparks, smoke, lava, and heat.The lava causes the earth and the mountain to become larger as a by-product. After the volcano has erupted the pressure has been released and the Volcano becomes quiescent.

On the next sheet Draw a simple picture of what you would expect a volcano to look like. Also identify candidate agents for your volcano simulation.

(Take 2-5 minutes brainstorming and drawing.)

Page 9: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Volcano Simulation

Page 10: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Creating a Volcano Simulation

To Leave WaterCycle Select Navigator and Press PREVious project.

Now that you are back in the Welcome page.Select Navigator and Press NEW project at the end of

Navigator.

Click Unnamed1 at the bottom of the new window and Replace it with volcano_yourInitials.

Click to begin a New Project.

Once you have an idea of the new environment you want to create, begin by creating new players. You can use a your

to paint whatever you like.

You can create a mountain, sparks(that fly out of the volcano), lava and any other players that will improve the aesthetic view of your playground. Perhaps you would like to include a sky for background, or trees, etc. If you need help drawing a player, refer to the interaction guide.

Page 11: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Adding Behaviors to Volcano Simulation

To make your volcano erupt, the players need to interact with each other. To add actions and behaviors to your simulation in your next session, we would like you to think about the possible behaviors that your players can possess.

For example, in the simulation that you reviewed, a cloud moves from place to place, produces rain and changes itself to a rain cloud.

Think of interactions that happen to cause a volcano to erupt. The eruption of a volcano is caused by pressure within the earth crust that needs to be released.

Have fun trying to get your agents to collaborate in interesting ways.

When finished Save your project.

Press in the Navigator and then

Press project and you should be back at the Welcome page.

Page 12: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Section II

Exploring Visual Programming

Page 13: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Reusing Starter World to Create

Erosion and Ocean World Simulation

The new environment that you could simulate is an Ocean biosphere. This simulation will involve the interaction of several complex factors. There will be an ocean, the ocean produces waves, the waves hit the beach, and after they hit the beach they cause the amount of the sand on the beach to decrease from erosion…

On the next sheet draw a simple picture of what you would expect an Ocean World Simulation to look like. Also identify candidate players for your Ocean World simulation.

(Take 2-5 minutes brainstorming and drawing.)

Page 14: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Ocean World Simulation

Page 15: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Reusing the Starter WorldThe Starter World is a simulation that contains some of the basicfunctionality of SimBuilder programs. It contains players that move,erase, emit other players, and change themselves into other forms.

Open the Starter World Simulation.

Now, Press to start this model. Investigate each player to discover its’ behavior.

The Mover just moves in one direction.

The Emitter produces another agent.

The Eraser erases other agents that it contacts.

The Replacer replaces the Mover with another agent.

The Changer will change another player into a new player when it comes in contact with it.

Press after a few minutes of observing the model.

Refer to interactions guide for Help.

Page 16: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Creating new agents and Adding behaviors to create Ocean World Simulation.

A simulation in SimBuilder is simply a set of players that work togetherto create visual effects.

A key aspect of reusing a simulation is to reusing existing players and adding new agents.We will begin with the small task of reusing a new player from the Starter World.

Task 1. Create a new project In the Navigator and Press project.

Click Unnamed1 at the bottom of the new window and Rename it OceanWorksheetYourInitialsClick the Ocean Project to enter it.

Task 2. new players Refer to interactions guide if you need Help.

Task 3. Reusing and creating new behavior for your new player Some player already have behavior scripts. You may need to look at their behaviors to

get started. You can also reuse the player by just using the grey repaint brush to change their look and just reusing their behavior

Add behaviors for new players you create. Refer to interactions guide for Help.

Think of other interactions to make your Ocean World simulation interesting.

Press and then

Press and return to the Welcome page.

Page 17: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Reusing Ozone World to Create

Photosynthesis World Simulation

The new environment that you could simulate is an instance of Photosynthesis. This simulation will involve the interaction of several complex factors. There will be a sun, the sun produces solar energy energy as sunrays, the sunrays shine on plants, and after they hit the plants, the plants grow bigger because the sun’s energy causes photosynthesis to occur.

On the next sheet draw a simple picture of what you would expect a Photosynthesis Simulation to look like. Also identify candidate agents for your simulation.

(Take 2-5 minutes brainstorming and drawing.)

Page 18: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Photosynthesis World Simulation

Page 19: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Reusing Ozone World In the Ozone depletion Cycle a factory emits CFC into the atmosphere and a heterogeneous reaction takes place. This

reaction converts the inactive chlorine and bromine reservoirs to more active form. No ozone loss occurs until sunlight initiates the catalytic ozone destruction.

Open the Ozone Depletion Simulation.

Now, Press to start this model. Investigate each agent to discover its’ behavior.

The Smoke_stack agent emits chemicals into the atmosphere.

The Chemicals are emitted by the smoke stack and move up into the atmosphere. They are changed into active BrCl when contacted by the sun.

The Sun agent replaces the inactive chemicals with active BrCl.

The BrCl agent moves randomly until it contacts an ozone agent.

The ozone absorbs (erases) BrCl and is changed into a weaker ozone agent

Press after a few minutes of observing the model.

Refer to interactions guide for Help.

Page 20: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Creating new agents and Adding behaviors to create Photosynthesis Simulation.

A simulation in SimBuilder is simply a set of players that work togetherto create visual effects.

A key aspect of reusing a simulation is to reusing existing players and adding new agents.We will begin with the small task of reusing a new player from the Ozone World.

Task 1. Create a new project In the Navigator and Press project.

Click Unnamed1 at the bottom of the new window and Rename it PhotosynthesisYourInitialsClick the Photosynthesis Project to enter it.

Task 2. new players. Refer to interactions guide if you need Help.

Task 3. Reusing and creating new behavior for your new player Some player already have behavior scripts. You may need to look at their behaviors to

get started. You can also reuse the player by just using the grey repaint brush to change their look and just reusing their behavior

Add behaviors for new players you create. Refer to interactions guide for Help.

Think of other interactions to make your Photosynthesis simulation interesting.

Press and then

Press and return to the Welcome page.

Page 21: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Reusing Ozone World to Create

Erosion and Ocean World Simulation

The new environment that you could simulate is an Ocean biosphere. This simulation will involve the interaction of several complex factors. There will be an ocean, the ocean produces waves, the waves hit the beach, and after they hit the beach they cause the amount of the sand on the beach to decrease from erosion…

On the next sheet draw a simple picture of what you would expect an Ocean World Simulation to look like. Also identify candidate players for your Ocean World simulation.

(Take 2-5 minutes brainstorming and drawing.)

Page 22: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Creating new agents and Adding behaviors to create Ocean World Simulation.

A simulation in SimBuilder is simply a set of players that work togetherto create visual effects.

A key aspect of reusing a simulation is to reusing existing players and adding new agents.We will begin with the small task of reusing a new player from the Ozone World.

Task 1. Create a new project In the Navigator and Press project.

Click Unnamed1 at the bottom of the new window and Rename it OceanWorksheetYourInitialsClick the Ocean Project to enter it.

Task 2. new players Refer to interactions guide if you need Help.

Task 3. Reusing and creating new behavior for your new player Some player already have behavior scripts. You may need to look at their behaviors to

get started. You can also reuse the player by just using the grey repaint brush to change their look and just reusing their behavior

Add behaviors for new players you create. Refer to interactions guide for Help.

Think of other interactions to make your Ocean World simulation interesting.

Press and then

Press and return to the Welcome page.

Page 23: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Reusing Starter World to Create

Photosynthesis World Simulation

The new environment that you could simulate is an instance of Photosynthesis. This simulation will involve the interaction of several complex factors. There will be a sun, the sun produces solar energy energy as sunrays, the sunrays shine on plants, and after they hit the plants, the plants grow bigger because the sun’s energy causes photosynthesis to occur.

On the next sheet draw a simple picture of what you would expect a Photosynthesis Simulation to look like. Also identify candidate players for your simulation.

(Take 2-5 minutes brainstorming and drawing.)

Page 24: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Creating new agents and Adding behaviors to create Photosynthesis Simulation.

A simulation in SimBuilder is simply a set of players that work togetherto create visual effects.

A key aspect of reusing a simulation is to reusing existing players and adding new agents.We will begin with the small task of reusing a new player from the Starter World.

Task 1. Create a new project In the Navigator and Press project.

Click Unnamed1 at the bottom of the new window and Rename it PhotosynthesisYourInitialsClick the Photosynthesis Project to enter it.

Task 2. new players. Refer to interactions guide if you need Help.

Task 3. Reusing and creating new behavior for your new player Some player already have behavior scripts. You may need to look at their behaviors to

get started. You can also reuse the player by just using the grey repaint brush to change their look and just reusing their behavior

Add behaviors for new players you create. Refer to interactions guide for Help.

Think of other interactions to make your Photosynthesis simulation interesting.

Press and then

Press and return to the Welcome page.

Page 25: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Interaction Guide (Object Halo & Handles & Paint Tools)

Halo Tools

To manipulate objects in Squeak SimBuilder select the object and

<Alt> Click or <Middle button> Click your object and it’s Halo will appear.

The pink Close handle will move your object to the trash.

The red Menu handle will open a menu of other options for your object.

The black Pick Up handle will let you Lift Your Object and move it.

The brown Move handle will let you Drag your object.

The green Duplicate handle will let you Copy your object.

The light grey Debug handle is used for script debugging.

The grey Repaint handle will let you Repaint your object.

The purple Change Color handle lets you change the color of your object.

The yellow Change Scale handle will let you Resize your object to make it larger and smaller.

The dark yellow Make a tile representing this object handle will make a Label for this object. The light blue Open a viewer of Me handle will let you view the characteristics of an object..

Paint ToolsJust click on the Paint brush and Paint tools will appear.

Use the Paint Brush to create.Use Paint Bucket to fill areas.Use Dropper to select a color.Use Eraser to modify.Multiple Circles choose brush size.Color palette will change color.Press Keep when complete.

Page 26: Exploring Visual Programming Squeak SimBuilder Tutorial Implementing a Model of the Water Cycle Human Computer Interaction @ Auburn University This tutorial.

Interaction Guide (Object Behavior & Scripting Tools)

The Search area allows you to quickly locate a script with the search.

The scripts category is where user created scripts are located.

The basic category is to make sounds and move your object.

The color & border category is to make sounds and move your object.

The tests category contains scripts that help you to test conditions.

The graphics category is to make sounds and move your object.

The miscellaneous category contains many scripts (copy, show, hide, delete, etc. )

Scripting ToolsTo open more tools click

Scripting Categories

A user defines the behavior of objects by creating a script for that object.

To use one of the predefined scripts. Select a script and drag it from the script window into the world any place other than the playground.

Press to Test an individual script.

To Save your projects.Press and

then

Scripts define behaviors

Saving your Work