Exploring+Visual+Programming.ppt_第1页
Exploring+Visual+Programming.ppt_第2页
Exploring+Visual+Programming.ppt_第3页
Exploring+Visual+Programming.ppt_第4页
Exploring+Visual+Programming.ppt_第5页
已阅读5页,还剩22页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Exploring Visual Programming,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 e

2、valuate 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., 天津塔吊租赁 河北塔吊租赁 西安塔吊租赁 塔吊租赁 ,Exploring the Water Cycle Model,Double click to open t

3、he 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. Squeak SimBuilder Tutorial Virginia Tech Visual Languages Group AgentShe

4、ets Tutorial Virginia Tech Visual Languages Group-Draft,Squeak,Exploring The Sun,Lets investigate the players To investigate the Sun Click or Click the Sun and its Halo will appear. Select the purple eyedropper Change color tool to and change the Sun from yellow to bright orange. To investigate the

5、rules or that govern the suns 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

6、the world other than the green playground. (Take a few minutes to explore scripts in the viewer) Squeak SimBuilder Tutorial Virginia Tech Visual Languages Group,Changing The Behavior of Clouds,Examine some of the more complicated behaviors by selecting the Cloud and reviewing its behavior. Take a mo

7、ment to review the interaction guide to gain a better understanding of the interactions between agents behaviors Make Clouds more active. Currently the behavior of the cloud is to move forward 5 spaces. Find the script that causes this behavior. Lets make the clouds move a lot more. Click on the des

8、ired 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. Lets try to change the behavior of the cloud so tha

9、t it will move vertically. Click or Click your cloud and its Halo will appear. Select Rotate and move your cloud just a tiny bit for its 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.

10、 Press to see how the simulation has changed. Squeak SimBuilder Tutorial Virginia Tech Visual Languages Group,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 be

11、gin 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

12、 are not a good artist. Once finished Press . Your bird has been added to the playground. Its just as easy as that ! Squeak SimBuilder Tutorial Virginia Tech Visual Languages Group,Giving the Bird Behaviors,In this playground, we want the bird to be able to fly through the sky. Double click on your

13、bird and its viewer will appear. The viewer is a window to select behaviors for your agent. Lets 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 playg

14、round. Your bird should fly across the playground. If it doesnt you may need to check out which direction your bird is flying. Click or Click your bird and its Halo will appear. Select Rotate and move your bird just a tiny bit for its direction arrow to appear. Click on the green arrow and change it

15、s 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! Squeak SimBuilder Tutorial Virginia Tech Visual Languages Group,Creating a Volcano Simulation,A s

16、ample 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 an

17、d 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

18、2-5 minutes brainstorming and drawing.) Squeak SimBuilder Tutorial Virginia Tech Visual Languages Group-Draft,Volcano Simulation,Squeak SimBuilder Tutorial Virginia Tech Visual Languages Group-Draft,Creating a Volcano Simulation,To Leave WaterCycle Select Navigator and Press PREVious project. Now th

19、at 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 creati

20、ng 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 d

21、rawing a player, refer to the interaction guide. Squeak SimBuilder Tutorial Virginia Tech Visual Languages Group-Draft,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

22、, 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

23、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. Squeak SimBuilder Tut

24、orial Virginia Tech Visual Languages Group,Section II,Exploring Visual Programming,Reusing Starter World to CreateErosion 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

25、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 player

26、s for your Ocean World simulation. (Take 2-5 minutes brainstorming and drawing.),Reusing the Starter World,The Starter World is a simulation that contains some of the basic functionality of SimBuilder programs. It contains players that move, erase, emit other players, and change themselves into othe

27、r 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

28、. 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.,Creating new agents and Adding behaviors to create Ocean World Simulation.,A simulation in SimBuilder is simply a set o

29、f players that work together to 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 U

30、nnamed1 at the bottom of the new window and Rename it OceanWorksheetYourInitials Click 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 nee

31、d 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 si

32、mulation interesting. Save your project. Press in the Navigator and then Press and return to the Welcome page.,Reusing Ozone World to CreatePhotosynthesis World Simulation,The new environment that you could simulate is an instance of Photosynthesis. This simulation will involve the interaction of se

33、veral 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 suns energy causes photosynthesis to occur. On the next sheet draw a simple picture of what you would expect a P

34、hotosynthesis Simulation to look like. Also identify candidate agents for your simulation. (Take 2-5 minutes brainstorming and drawing.),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 inact

35、ive 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

36、 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 (e

37、rases) BrCl and is changed into a weaker ozone agent Press after a few minutes of observing the model. Refer to interactions guide for Help.,Creating new agents and Adding behaviors to create Photosynthesis Simulation.,A simulation in Agentsheets is simply a set of agents that work together to creat

38、e visual effects. A key aspect of reusing a simulations is to specialize existing agents and adding new agents. We will begin with the small task of reusing a new agent from the Ozone World. Task 1. Click on Gallery Click on File Save. Name this gallery as Photosynthesis_Gallery_YourInitials Create

39、a new Worksheet Click on File New Worksheet. Name this worksheet as Photosynthesis_Worksheet_YourInitials Task 2. Draw a new agent Refer to interactions guide for Gallery/Worksheet Tools and more help. Task 3. Reusing and creating new behavior for your new agent Some agents already have behaviors. Y

40、ou may need to look at there behaviors to get started. You can reuse their behavior by just dragging the entire rule that you would like to reuse into your agents behavior palette. Add new behaviors. Refer to interactions guide for more Help. Think of other interactions to make your Photosynthesis W

41、orld simulation an interesting representation. Save and close your new world when complete.,Reusing Ozone World to CreateErosion 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. Ther

42、e 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

43、 players for your Ocean World simulation. (Take 2-5 minutes brainstorming and drawing.),Creating new agents and Adding behaviors to create Ocean World Simulation.,A simulation in SimBuilder is simply a set of players that work together to create visual effects. A key aspect of reusing a simulation i

44、s to specialize existing agents and adding new agents. We will begin with the small task of reusing a new agent from the Ozone World. Task 1. Click on Gallery Click on File Save. Name this gallery as Ocean_Gallery_YourInitials Create a new worksheet Click on File New Worksheet Name this worksheet as

45、 Ocean_Worksheet_YourInitials Task 2. Draw a new agent Refer to interactions guide for Gallery/Worksheet Tools and more help. Task 3. Reusing and creating new behavior for your new agent Some agents already have behaviors. You may need to look at there behaviors to get started. You can reuse their b

46、ehavior by just dragging the entire rule that you would like to reuse into your agents behavior palette. Add new behaviors. Refer to interactions guide for more Help. Think of other interactions to make your Ocean World simulation an interesting representation. Save and close your new world when com

47、plete.,Reusing Starter World to CreatePhotosynthesis 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 sunra

48、ys shine on plants, and after they hit the plants, the plants grow bigger because the suns 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

49、minutes brainstorming and drawing.),Creating new agents and Adding behaviors to create Photosynthesis Simulation.,A simulation in Agentsheets is simply a set of agents that work together to create visual effects. A key aspect of reusing a simulations is to specialize existing agents and adding new a

50、gents. We will begin with the small task of reusing a new agent from the Starter World. Task 1. Click on Gallery Click on File Save. Name this gallery as Photosynthesis_Gallery_YourInitials Create a new Worksheet Click on File New Worksheet. Name this worksheet as Photosynthesis_Worksheet_YourInitia

51、ls Task 2. Draw a new agent Refer to interactions guide for Gallery/Worksheet Tools and more help. Task 3. Reusing and creating new behavior for your new agent Some agents already have behaviors. You may need to look at there behaviors to get started. You can reuse their behavior by just dragging th

52、e entire rule that you would like to reuse into your agents behavior palette. Add new behaviors. Refer to interactions guide for more Help. Think of other interactions to make your Photosynthesis World simulation an interesting representation. Save and close your new world when complete.,Interaction

53、 Guide(Worksheet & Gallery Tools),The Cursor Tool allows users to drag agents around within a worksheet. The Pencil Tool allows users to add agents to a worksheet. To use the Pencil Tool an agent in the current gallery must be highlighted. When you then click in a worksheet, an instance of the highl

54、ighted agent is placed in the worksheet where you click. The Eraser Tool erases agents in a worksheet. Click on an agent with the Eraser Tool to make it disappear. The Finger Tool ,Whack Tool, Link Tool, Unlink Tool have no preset behavior associated with it. It can be programmed by users through th

55、e use of Tool Triggers. The Block Draw Tool allows users to place multiple agents in a worksheet. Like the Pencil Tool, the Block Draw Tool requires that an agent in the current gallery be highlighted. The Block Draw Tool creates a bounding box that expands as a user clicks and drags within a worksh

56、eet. After the mouse is released, all cells in the block bounded by the bounding box will be filled with instances of the previously highlighted agent. This Block works for agents on the worksheet and is a Block fill that you can use when creating an agent. The Fill Tool fills in any closed and empt

57、y region of a depiction with the color indicated in the Ink Color box. The Color Sampler Tool looks like an eyedropper and acts like one metaphorically. You can use the Color Sampler to grab colors from pixels anywhere in the depiction window. Choose the Color Sampler and sample from colors in the I

58、nk Color Palette. Attributes can be defined for any AgentSheets agent. Clicking on an agent in a worksheet with the Attribute Query Tool brings up an attribute window showing the agents attributes and their values. Gallery Tools To create a new depiction press . To change look press . See page 6 for

59、 details. To Edit Behavior or change rule press . To get an alternative look for an agent press . After creating a new depiction or agent you always want to define a Mask Color for it. Masks are like filters or films of a given color that cover the cell a depiction inhabits. For a transparent mask select Color Mask Color upper left pixel (is the most common mask).,Create a new Pro

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论