Home
NetLogo Implementation of Evacuation Scenario
Contents
1. EX Grass settings On grass NNN NNNM oft 9 grass regrowth time 30 Sheep settings Wolf settings initial number sheep 100 initial number wolves 50 r sheep gain from food 4 wolf gain from food 20 sheep reproduce 49 wolf reproduce 293 H sheep l H wolves Horass 4 pop Wd ticks 50 globals grass keep track of how much grass there is Sheep and wolves are both breeds of turtle breed sheep a sheep sheep is its own plural so we use a sheep as the singular breed wolves wolf turtles own energy patches own countdown both wolves and sheep have energy to setup ar al k patches set pcolor green HH dud GRASS switch if it is true then grass grows and the sheep eat it if it false then the sheep don t need to eat if grass ask patches et countdown random grass regrowth time initialize grass grow clocks randomly set pcolor one of green brown s efault shape sheep sheep create sheep initial number sheep create the sheep then initialize their variables or white e 1 5 3 easier to see blue 2 2 sheep gain from food or random ycor default shape wolves wolf create wolves initial number wolves create the wolves then initialize their variables easier to see 2 wolf gain from food random ycor display labels update plot Introduction to Ne
2. J nt ticks 200 set time since last found time since last found 1 The modelling cycle for the Mushroom hunter problem 1 Formulate the problem e What search strategy maximizes the rate of finding items if are distributed in clusters 2 Formulate hypothesis for essential processes and structures e process switches from large scale movements to small scale searching depending on previous e discoveries 3 Choose scales entities state variables processes and parameters 4 Implement the model 5 Analyse test and revise the model e we could the model by trying different search algorithms and parameter values analyse to see which produces the highest rates
3. Introduction to NetLogo Intelligent Systems Interaction and Multimedia Seminar 2012 2013 Outline Introduction to NetLogo Turtles Patches and others GUI Programming Concepts Extensions amp Tools Asimple example Introduction to NetLogo 1 What is NetLogo A programmable modelling environment for simulating natural and social phenomena Uri Winlensky 1999 Agent based M amp S tool Well suited for modelling complex systems Hundreds or thousands of independent agents operating concurrently Exploring the connection between the micro level behaviour of individuals and the macro level patterns that emerge from the interaction of many individuals Introduction to NetLogo 1 What is NetLogo Easy to use application development environment Quickly testing hypotheses about self organized systems e Open simulations and play with them Large collection of pre written simulations in natural and social sciences that can be used and modified Simple scripting language User friendly graphical interface Introduction to NetLogo II The World of NetLogo NetLogo consists of agents living in a 2 D world divided into a grid of patches hree different type of agents plus one more e Turtles are the agents that move around the world e Patches are the pieces of ground on which turtles can move e Links are agents that connect two turtles Observer is an agent without location that oversee
4. d gt gt Adjust speed 9 vA view updates gt on ticks re Settings normal speed right click brings up turtle patch inspector who 12 color 15 heading 277 moor 3 454237346990778 yoor 11 264423472480127 shape bug label label color 9 9 breed turtles hidden false size 2 pen size 1 pen mode up Introduction to NetLogo VI Programming Concepts Agents Procedures Variables Ask Agentsets Breeds oynchronization Introduction to NetLogo VI Programming Concepts Agents Each agent can carry out its own activity all simultaneously Patches e Form the 2D world They don t move but they sense e They have integer coordinates pxcor pycor Can generate turtles Turtles move on top of the patches have decimal coordinates xcor ycor and orientation heading Observer Can create new turtles Can have read write access to all the agents and variables Introduction to NetLogo VI Programming Concepts Procedures Procedures tell agents what to do e Command is an action for an agent to carry out Usually begin with verbs to setup to draw polygon num sides size clear all pd repeat num sides create 10 fd size rt 360 num sides end end Introduction to NetLogo VI Programming Concepts Procedures Reporter computes a result and report it Usually begin with nouns or nouns phrases to report absolute value number
5. definition of a subset of agents e Contain either turtles or patches e sin arandom order e Allows to construct agentsts that contain some turtles or patches Example all red turtles e turtles with color red all red turtles on the patch of the current caller turtle or patch e turtles here with color red all patches on right side of screen e patches with pxcor gt 0 all turtles less than 3 patches away from caller turtle or patch turtles in radius 3 Introduction to NetLogo VI Programming Concepts Agentsets ii Using agentsets e ask such agents to execute a command e ask agentset e checkif there are such agents show any agentset e count such agents show count lt agentset gt example remove the richest turtle with the maximum assets value e ask max one of turtles sum assets die Introduction to NetLogo VI Programming Concepts Breeds e Breed a natural kind of agentset e Different breeds can behave differently e breed wolves wolf e breed sheep a sheep Anew breed comes with automatically derived primitives e create lt breed gt create custom lt breed gt lt breed gt here lt breed gt at Breed is a turtle variable e askturtle 5 if breed sheep A turtle agent can change breed e ask turtle 5 set breed sheep Introduction to NetLogo VI Programming Concepts Synchronization Agents run i
6. ifelse number gt 0 report number report O number end Procedures Commands or Reporters implemented by the user Primitives Commands or Reporters built into NetLogo language keywords Introduction to NetLogo VI Programming Concepts Variables i Variables e Global variables e Turtle 8 patch variables e Local variable Global variables e Every agent can access it e Only one value for the variable Turtle amp Patch variables e Each turtle patch has its own value for every turtle patch variable Local variables e PSN and accessible only inside a procedure Introduction to NetLogo VI Programming Concepts Variables ii e Built in Turtle variables color xcor ycor heading etc e Patch variables pcolor pxcor pycor etc Defining global variables e global clock Defining turtle patch variables e turtles own energy speed e patches own friction Defining a local variable e to swap colors turtle1 turtle2 let temp color of turtle1 Introduction to NetLogo VI Programming Concepts Ask Ask specify commands to be run by turtles or patches e Examples e asking all turtles ask turtles fd 50 e asking one turtle e ask turtle 5 e asking all patches ask patches diffuse Only the observer can ask all turtles or all patches Introduction to NetLogo VI Programming Concepts Agentsets i Agentset
7. ize the World and run the model e setup procedure go procedure Interface tab gt Button NetLi eo b Interface v Code t t tt G re a e Se up U O n M Na 2 ac Button v mum t G Setgs WS ticks x similarly create a go button Agent s f observer H O Forever O Disable until ticks start Agent s l observer re M Forever Commands ketup Disable until ticks start Commands gol Display name Display name MEN Cancel C o Action key ul C Cancel Co Command Center Clear observer Y f n Code tab o setup to go e Create the skeleton of setup A go ca l eset ticks end end e to setup Change setup to Age n set pcolor red end e Create the clusters of mushrooms patches e The cluster can be a model parameter e Define a global variable num clusters 9 9 bels num clusters e Modify the setup to turn in red randomly a num cluster patches to setup ask n of num clusters patches ask n of 26 patches in radius 5 C set pcolor red 1 reset ticks end create the turtles e use the primitive create turtles EXER Del interface Info Code 8 O view updates J abc Button Settings te Add M hormaispeed continuous normal speed VA4b ticks 0 create turtles 2 J set size set color yellow e In the g
8. n parallel each agent is an independent thread e asynchronous commands e ask turtles fd random 10 do something turte 1 XEM turtie 2 BEEN turte 3 r Agent threads wait and join at the end of a block Ren Doursat 2008 time e synchronous commands askturtles fd random 10 e ask turtles do something urie 1 n ie E RR Introduction to NetLogo VII Extensions 8 Tools Extensions Guide Sound Robotics NetLogoLab GIS Bitmap Quicktime for Java BDI architecture FIPA Applets Shapes Editor Behaviour Space System Dynamics HubNet Logging Controlling Mathematica link NetLogo 3D NetLogo References NetLogo user manual http ccl northwestern edu netlogo docs Agent based and Individual based Modeling A Practical Introduction by Steven F Railsback and Volker Grimm NetLogo v5 0 NetLogo Learning Lab http www professorgizzi org modelingcomplexity netlogo index html NetLogo 5 0 Quick Guide Luis R Izquierdo Fundamentals of Multi agent Systems with NetLogo Examples Jos M Vidal http multiagent com p fundamentals of multiagent systems html Origins of Life From Geochemistry to the Genetic Code http origins santafe edu tutorials netlogo A simple tutorial Create via File New a new NetLogo program Save it via File Save as with the name MushroomHunt nlogo From the Settings button e view of the World s geometry To initial
9. o procedure e Tellto turtles what to do In this case to search for mushrooms e So we need a search procedure to go ask turtles search end to search end e ets define search to search ifelse time since last found lt 20 right random 181 98 right random 21 18 forward 1 end globals num clusters e After globals statement define Luster turtles own time since last found 5 e We update the setup procedure to setup ca set num clusters 4 ask n of num clusters patches ask n of 28 patches in radius 5 L set pcolor red create turtles 2 set size 2 set color yellow set time since last found 999 6 and the search procedure as well as to search ifelse time since last found lt 26 right random 181 96 right random 21 10 forward 1 ifelse pcolor b red L set time since last found set pcolor yellow J set time since last found time since last found 1 end s num clusters time since last found setup ca set num clusters 4 ask n of num clusters patches L ask n of 20 patches in radius 5 L set pcolor red J create turtles 1 L set size 2 set color yellow set time since last found 999 J reset ticks go tick ask turtles search search ifelse time since last found lt 20 right random 181 90 right random 21 10 forward 1 ifelse pcolor red L set time since last found set pcolor yellow
10. s everything going on in the world e Ask agents to perform a command e Collects data from models Patches Turtles System Patches Elements of space e Change e Donot move e Turtles Social actors e Change e Mobile All turtles and patches put together e ypically we wish to observe the system e How many turtles are sick Alive Rules Turtles and patches have rules that can e Change themselves reflexive e Change other turtles e Change other patches Rules for Turtles Reflexive behaviour e askturtles forward 1 e Reflexive state e ask turtles if sick set color blue Change other turtles e f sick ask turtles here set sick true set color blue Change patches e askturtles if sick ask patch here set grass grass 5 Rules for Patches e Reflexive state patches change themselves e ask patches set grass grass 1 Change other patches e ask patches in radius 1 set grass 0 1 my grass e Change turtles e ask turtles here set sick true set color blue in Summary e self e Pself Stop utor S op n lo suc ewe CZ Introduction to NetLogo III GUI 4 ux Button v Edit Delete Add Interface Information Procedures v view POP normal speed on ticks v onticks 1 Controls Settings Views Inte edures j Procedures v V Indent automatic n n L
11. tLogo Ill GUI Controls Settings Views controls BLUE allow to run and control the flow of execution e buttons e command centre settings GREEN allow to modify parameters e sliders e switches e choosers views BEIGE allow to display information e monitors e plots output text areas 7 Wie NAIL 4 VA ICE W OM Introduction to NetLogo Ill GUI Controls e Controls allow to run and control the flow of execution e Buttons e Command center Buttons initialize start stop step through the model e Once buttons execute one action one step setup e Forever buttons repeat the same action E Command center ask observer patches or turtles to execute specific commands during the execution O ask patches set pcolor yellow N jsk turtles set color brown v Introduction to NetLogo IV GUI Settings e Settings allow to modify parameters e Sliders e Switches e Sliders adjust a quantity from min to max by an increment Switches set a Boolean variable true false Choosers select a value from a list Introduction to NetLogo V GUI Views Views allow to display information e Monitors e Plots e Graphics window Monitors display the current value of variables je dm e Plots display the history of a variable s value Introduction to NetLogo V GUI Views Graphics window The main view of the 2 D NetLogo worl
Download Pdf Manuals
Related Search
Related Contents
Labels Platform (Stand : 12.3.1996) Heat recovery units SLV-662HF/679HF Samsung Galaxy 550 Εγχειρίδιο χρήσης(Froyo) Tacens Orum II 500W Blender Batidora de Vaso Operating Instructions ST 20 Programmation des gradateurs Télécharger le pdf Nevion - Sublime Telecom - AV User`s Manual - SICES Brasil Copyright © All rights reserved.
Failed to retrieve file