Home

Netlogo Tutorials!

image

Contents

1. patches own elevation to setup ca setup patches setup turtles end Patches and Variables to setup patches ask patches set elevation random 10000 diffuse elevation 1 ask patches set pcolor scale color green elevation 1000 9000 end to setup turtles crt 100 ask turtles fd random screen edge x end Landscape Press the setup button back in the model s interface m Voila A lush NetLogo landscape complete with turtles and patches appears Intelligenza Artificiale AA 2006 2007 globals highest lowest highest and lowest patch elevation to setup patches ask patches set elevation random 10000 diffuse elevation 1 ask patches set pcolor scale color green elevation 1000 9000 set highest max values from patches elevation set lowest min values from patches elevation ask patches if elevation gt highest 100 set pcolor white if elevation lt lowest 100 highest lowes A set pcolor black E Artificiale end AA 2006 2007 Simple Algorithm to move turtles ask turtles set heading random 360 fd 1 end the turtles cannot see ahead farther than just one patch each turtle can move only one square each turn turtles are blissfully ignorant of each other An Uphill Algorithm each turtle goes to the highest elevation in a radius of one to move to local max ask turtles
2. Lucidi a cura di Stefano Cacciaguerra Netlogo Tutorials ran acciaguerr Intelligenza B Artificiale AA 2006 2007 System Requirements NetLogo is designed to run almost any type of computer problems with older less powerful systems or older versions of system Software f you have any trouble with NetLogo not working on your system we would like to offer assistance Please write bugs ccl northwestern edu Intelligenza Artificiale AA 2006 2007 Application or Applet There are two ways to run NetLogo Download application this enables you to run NetLogo as a normal application Run applet on the web within your browser window Intelligenza Artificiale AA 2006 2007 Running on the web is convenient but downloading the application has some significant advantages e Fewer compatibility issues with various operating systems and browsers Starts up faster Models run faster Window is resizable Edit menu is available Keyboard shortcuts for menu items are available Intelligenza Artificiale AA 2006 2007 NetLogo Downloads Attention Windows users MetLogo runs fastest with the IBMi 1 1 VM Therefore we strongly recommend the Includes Java VM option Questions See below if you are running anti virus software there may be a long pause fas much as two minutes near the end of t
3. finished the button pops back up e Forever buttons do an action over and over again When you z want the action to stop press the button again It will finish the eg current action then pop back up Most models have a once button called setup and a forever button called go Many models also have a once button called go once or step once You can also stop a model with the Halt button on the Interface toolbar e The Halt button may interrupt the model in the middle of an action and as the result the model could get confused Intelligenza Artificiale AA 2006 2007 Adjusting Settings Sliders and Switches The settings within a model give you an opportunity to work out different scenarios or hypotheses Altering the settings and then running the model to see how it reacts to those changes can give you a deeper understanding of the phenomena being modeled sheen setings Wolf setinas Grass settings Switches and sliders give you access to a model s settings Intelligenza Artificiale AA 2006 2007 Switches are set up in an on off format Switches turn on off a separate set of directions These directions are usually not necessary for the model to run but might add another dimension to the model Turning the grass switch on affected the outcome of the model gt Prior to this run the growth of the grass stayed constant This is not a re
4. set heading uphill elevation if elevation of patch at dx dy gt elevation td 1 end a f none of the patches around it have a higher elevation than the patch it is on it ll stay put Our turtles rapidly arrive at local maxima in our landscape Intelligenza Artificiale AA 2006 2007 An Uphill Algorithm a Our goal is to still get the turtles to find an optimal maximum which is one of the white patches to recolor patches ask patches set elevation pycor set pcolor scale color green elevation 0 screen edge y screen edge y end After Replace the line diffuse elevation 1 with repeat 5 diffuse elevation 1 Intelligenza Artificiale AA 2006 2007 An Uphill Algorithm a NetLogo allows us to plot data as we go along To make plotting work we ll need to create a plot in the Interface tab and set some settings in it Then we ll add one more procedure to the Procedures tab which will update the plot for us to do plots set current plot Turtles at Peaks plot count turtles with elevation gt highest 100 end The plot primitive adds the next point to a plot we need to tell NetLogo which plot we want update HubNet is a technology that lets you use NetLogo to run participatory simulations in the classroom a Ina participatory simulation a whole class takes part in enacting the behavior o
5. yellow a B a ask turtles set color brow Ja inteligenza E Artificiale AA 2006 2007 Working With Colors m In NetLogo all colors have a numeric value black 0 white 9 999 gray 8 9 9 999 a In all of the red 15 19 19 999 orange 25 29 29 999 exercises We brown 35 39 39 999 yellow 45 Bese 44 45 46 47 48 49 49 999 have been USING green 55 59 59 999 the name of the lime 65 68 69 69 999 turquoise 75 78 79 79 999 color 1 6 cyan 85 88 89 89 999 sky 95 98 99 99 999 blue 105 109 109 999 violet 115 119 119 999 l magenta 125 129 129 999 T pink 135 139 139 999 AA 2006 2007 We used the set command to change the colors of all the cars Let s look at how to change only R one car s color D poo a Click on the red car with the right m mouse button C false From the popup menu We choose inspect turtle 0 We can see all of the variables Ls of the red car es Es p Intelligenza Artificiale AA 2006 2007 Agent Commanders m An Agent Commander found at the bottom of an Agent Monitor You type commands here just like in the Command Center but the commands you type here are only done by this particular turtle Idem for Patches Intelligenza Artificiale AA 2006 2007 Procedures The heart of a NetLogo Model is the Procedures tab m Keep in mind how people usually think of these three differ
6. alistic look at the predator prey relationship so by setting and turning on a grass growth rate we were able to model all three factors sheep wolf and grass populations A slider has a range of numeric values that can be adjusted As you move the marker from the minimum to the maximum value the number on the right side of the slider is currently set to Sheep settings Wolf settings For example the initial sheep slider has a minimum value of O and a maximum value of 250 The model could run with O sheep or it could run with 250 sheep or anywhere in between Try this out and see what happens Intelligenza Artificiale AA 2006 2007 Gathering Information Plots and Monitors A purpose to modeling is to gather data on a subject or topic that would be very difficult to do in a laboratory situation m NetLogo has two main ways of displaying data populations E sheep to the user Bi oies M grass 4 plots and monitors Intelligenza Artificiale AA 2006 2007 The lines show what s happening in the model over time o see which line is which click on Pens in the upper right corner of the plot window to open the plot pens legend lo view or analyze the data from a plot in another program you can use the Export Plot item on the File menu populations Pens E sheep Bi walves E grassi4 Intelligenza Artificiale AA 2006 2007 The monitor labeled time t
7. ent kinds of agents e The turtles and patches mostly use information about what s close to them e The observer typically uses and accesses the whole world m While patches can t move and often represent some sort of environment turtles can move around in the world Intelligenza Artificiale AA 2006 2007 Setup and Go To start a new model select New from the File menu called setup Now you have a button called setup It will execute the procedure setup when pressed cancel OK gt set up the NetLogo world Intelligenza Artificiale AA 2006 2007 Now switch to the Procedures Tab and create the setup procedure shown below crt 100 ask turtles C fd random screen edge x Intelligenza end Artificiale AA 2006 2007 Press your setup Press your setup button when you re done writing the code Intelligenza Artificiale AA 2006 2007 a Make a forever button called go Again begin by creating a button but this time check the forever checkbox in the edit window to go move turtles end to move turtles ask turtles set heading random 360 fd 1 Intelligenza Artificiale AA 2006 2007 en d Patches and Variables Now you ve got 100 turtles aimlessly moving around completely unaware of anything else around them Let s give these turtles a nice background against which to move
8. f a system as each student controls a part of the system by using an individual device such as a Tl 83 calculator or a networked computer For example in the Gridlock simulation each student controls a traffic light in a simulated city Intelligenza Artificiale AA 2006 2007 THE RUBNET ARCHITECTURE Intelligenza Artificiale AA 2006 2007 BehaviorSpace BehaviorSpace is a software tool integrated with NetLogo that allows you to perform experiments with models a t systematically varying the values of sliders and records the results of each corresponding model run This way you can explore the model s space of possible behaviors and determine which combinations of slider values cause the behaviors of interest Intelligenza Artificiale AA 2006 2007 References In the Netlogo site you can find e the last version of Netlogo e the Netlogo User Manual e the new Netlogo model e and a group discussion about Netlogo http www ccl sesp northwestern edu netlogo i Ee ae by i sees Sa Ns De ee EZ A Intelligenza Be S E EEE 3 of at ha A A R a a Artificiale AA 2006 2007
9. he download process Platform includes Java VM without Java VM Instructions recommended W Windows Download 15 66 Download 10 7M View El Mac OS 8oar9 Download 146M Download 106M View X Mac OS X Download 10 4M Views A Linux Download i43 1M Download 106M View UNIX Unix Download 106M View L Other Java enabled Platforms Download 105M View Sample Model Wolf Sheep Predation In this Model you open and run models file A Tools Zoom Library amp M asso asia ee Export World Export Plot pressing buttons a m changing slider and switch values and gathering information from a model using plots and monitors Intelligenza Artificiale AA 2006 2007 Interface Tab The Interface tab will fill up with lots of buttons switches sliders and monitors Grass settings settings i These interface elements allow you to interact with the Model e Buttons set up start and stop the model a e Sliders and Switches alter model settings e Monitors and Plots display data you can use the zoom menu at the top of the window To begin the model you will first need to set it up Intelligenza Artificiale AA 2006 2007 Controlling the Model Buttons When a button is pressed the model responds with an action e Once buttons do one action and then stop When the action is Psuv
10. icks tells us how much time has passed in the model The other monitors show us the population of sheep and wolves and the amount of grass The numbers displayed in the monitors update continuously as the model runs ticks sheep wolves Grassi 4 Intelligenza Artificiale AA 2006 2007 Intelligenza Artificiale AA 2006 2007 Changing Graphics Window Settings The size of the Graphics Window is determined by three separate settings 8 s _ Editing Graphics Screen Edge X Screen Edge Y D Exact Turtle Positions experimental and Patch Size Intelligenza Artificiale AA 2006 2007 The Models Library The Library contains four sections Sample Models The Sample Models section is organized by subject area Code Examples These are simple demonstrations of particular features of NetLogo HubNet Activities This section contains participatory simulations for use in the classroom Unverified Models These models are still in the process of being tested and reviewed for content and accuracy Sample Model Traffic Basic In this Model the focus will start to shift from observing models to manipulating models Intelligenza Artificiale AA 2006 2007 m The Command Center allows you to enter commands or directions to the model Commands are instructions you can give to turtles patches and the observer D gt ask patches set pcolor

Download Pdf Manuals

image

Related Search

Related Contents

  FAZOL Antifongique local Dans quel cas le médicament  HP Workstation x1000 User's Manual  Accelerated Interoperability & Troubleshooting HP Networks, Rev  Aprendizagem Sobre Artefatos Tecnologicos    K7T266 Pro-R Quick Guide  AdderLink iPEPS  SE 706  HP Officejet 7110 All-in-One Printer Setup Poster  

Copyright © All rights reserved.
Failed to retrieve file