Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 1 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference.

Slides:



Advertisements
Similar presentations
Teaching with Immersive Gaming: CPD 2 Using the NEnet Twigging Slide.
Advertisements

Agents and Pervasive Computing Group Università di Modena e Reggio Emilia System Requirements NetLogo is designed: to run almost any type of computer.
Netlogo and its Relatives Logo (Papert) –Language for teaching mathematics graphically –Tell turtle how to move Starlogo (Resnick) & StarlogoT (Wilensky)
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
How to use a scanner Throughout this slide show there will be hyperlinks (highlighted in blue) follow the hyperlinks to navigate to the specified Topic.
Day 1 Goal: To create a model of people hunting in the forest for mushrooms and then start working on improving their mushroom hunting ability mathematically.
SuperStar Basics Brian Bruderer. Sequence Editors Traditional sequence editors use a large grid to control when channels are turned on and off. This approach.
New Mexico Computer Science For All Breeds and Shapes in NetLogo Maureen Psaila-Dombrowski.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Note if in doubt click the “Help” button
Advanced Tool Management Information Module Advanced Tool Management Information Module.
Introduction to TouchDevelop
2-Day Introduction to Agent-Based Modelling Day 2: Session 5 Variables and Debugging.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
Department of Computer Science What is NetLogo UH-DMML  Multi-agent programmable modeling environment  Well suited for modeling complex systems evolving.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® PowerPoint 2010 © 2011 The McGraw-Hill Companies,
Technology Basics Creating Worksheet Formulas. 2 Understand Formulas Equations used to calculate values in cells are called formulas. Formulas consist.
1 Exercise Two The Digital Camera Helpful Notes 2004.
An Introduction to NetLogo given by Gabriel Wurzer. ,
Do not begin Slide Show. Stay in normal view for now.
Downloading and Installing PAF Insight PAF Insight can be easily downloaded Or can be installed from a CD A license is needed t0 activate the program.
ABM Frameworks Dr Andy Evans With additions from Dr Nick Malleson.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
2-Day Introduction to Agent-Based Modelling Day 2: Session 8 Exploring Model Collections, NetLogo Lists, Further Resources.
Week 11 DO NOW QUESTIONS. An ask turtles block is a set of instructions that is issued to every turtle. Even though computers can do things very quickly,
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
An Introduction to NetLogo Gabriel Wurzer, Vienna University of Technology AnthropologischeGesellschaftWien.
1 Creating Web Pages Part 1. 2 OVERVIEW: HTML-What is it? HyperText Markup Language, the authoring language used to create documents on the World Wide.
Introduction to TouchDevelop
Models in NetLogo Day 3 COLQ 201 Multiagent modeling Harry Howard Tulane University.
Java is an object oriented programming language In this model of programming all entities are objects that have methods and fields Methods perform tasks.
Downloading and Installing Autodesk Revit 2016
Agent-Based Modeling and Simulation (ABMS) Bertan Badur Department of Management Information Systems Boğaziçi University.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
New Mexico Computer Science For All Variables and Scope Maureen Psaila-Dombrowski.
1 ball, 2 ball, red ball, blue ball By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Greenfoot Game Programming Club.
New Mexico Computer Science For All Patches and Agent/Environment Interactions Maureen Psaila-Dombrowski.
Introduction to Drafting and Design In order to begin our drawing we have to set the drawing limits or the paper size.
Getting started with the turtle Find the latest version of this document at
CompSci 4 Chap 6 Sec 2 Sep 30, 2010 Prof. Susan Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were not a Flutterbudget.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Access Module Implementing a Database with Microsoft Access A Great Module on Your CD.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
Turtle Graphics Lesson 2 1. There are 3 homeworks to complete during the six lessons of this unit. Your teacher will let you know when a homework has.
What Is Firefox? __________ is a Web ___________ that you use to search for and view Web pages, save pages for use in the future, and maintain a list.
M10 WS11:Krankenhausbedarfsplanung The World as We See It given by Gabriel Wurzer and Wolfgang E. Lorenz
Yahoo! Mail We gave Google some good press so we’ll use Yahoo! mail as our example for web s. If you don’t have an account Yahoo! will provide.
1 CW11 Visualizing ACE3P Results in ParaView Greg Schussman Menlo Park, CA October 10, 2011.
1 Agent-Based Tools: focus on NetLogo Ing. Cristina Ponsiglione University of Naples Federico II Laboratorio di Simulazione ad Agenti.
M10 WS11:Krankenhausbedarfsplanung More, More and Even-More More given by Gabriel Wurzer and Wolfgang E. Lorenz
Making a 24hr Timer.
An Introduction to NetLogo given by Gabriel Wurzer and Wolfgang E
AnthropologischeGesellschaftWien
Development Environment
Management Information Systems
Management Information Systems
An introduction to Netlogo agent-based software
Hands-On given by Gabriel Wurzer and Wolfgang E. Lorenz
Learning to program with Logo
How to Start This PowerPoint® Tutorial
Using Logo and Logic This presentation uses a version of Logo called StarLogo available through MIT. It can be downloaded for free and installed on your.
creating a ecosystems model in net logo
Presentation transcript:

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 1 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 1 PLEASE HAVE NETLOGO INSTALLED -it‘s open source -available for windows, mac and linux -download: GOOGLE „ NETLOGO “ - FIRST LINK – DOWNLOAD - DON ‘ T FORGET TO INSTALL AFTER DOWNLOADING ( TAKES 3 MINUTES )

N ETLOGO F IRST S TEPS (A RTIFICIAL S OCIETIES ) Gabriel Wurzer Vienna University of Technology

„Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 3 YOU GET WHAT YOU SEE HERE place user interface elements here see the world here type code here

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 4 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 4 THE NETLOGO WORLD..is a 3D grid, of which we show only a 2D slice: origin in the middle X+ goes right Y+ goes into screen Z+ goes up (not shown, assuming that z=0)

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 5 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 5 THE NETLOGO WORLD grid consists of patches (grid cells) each patch is identified by the coordinate at its center, e.g. patch at origin

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 6 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 6 THE NETLOGO WORLD grid consists of patches (grid cells) each patch is identified by the coordinate at its center, or patch as shown here

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 7 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 7 AGENTS („ TURTLES “) movable entities within NetLogo heading xcor ycor zcor degrees - 0 is north, 90 east, etc. - in grid coordinates - e.g. 0, 0, 0 pitch degrees - 0 is level, 90 up, 270 down roll degrees - rotation of wingtip - 0 is parallel to XY plane

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 8 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 8 AGENTS („ TURTLES “) movable entities within NetLogo heading xcor ycor zcor degrees - 0 is north, 90 east, etc. - in grid coordinates - e.g. 0, 0, 0 or 0.5, 0.5, 0 pitch degrees - 0 is level, 90 up, 270 down roll degrees - rotation of wingtip - 0 is parallel to XY plane

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 9 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 9 can change their appearence AGENTS („ TURTLES “) shape color size - e.g. „default“

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 10 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 10 can change their appearence AGENTS („ TURTLES “) shape color size - e.g. „default“ or „person“

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 11 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 11 can change their appearence AGENTS („ TURTLES “) shape color size - e.g. „default“ or „person“ - relative to patch size - 1 is the default

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 12 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 12 can change their appearence AGENTS („ TURTLES “) shape color size - e.g. „default“ or „person“ - relative to patch size - 1 is the default - but can be 2 as well

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 13 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 13 can change their appearence AGENTS („ TURTLES “) shape color size - e.g. „default“ or „person“ - relative to patch size - 1 is the default - but can be 2 as well - can be specified using words, - e.g. RED, GREEN, BLUE

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 14 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 14 can change their appearence AGENTS („ TURTLES “) shape color size - e.g. „default“ or „person“ - relative to patch size - 1 is the default - but can be 2 as well - can be specified using words, - e.g. RED, GREEN, BLUE or MAGENTA

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 15 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 15 can change their appearence AGENTS („ TURTLES “) hidden? - default: false

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 16 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 16 can change their appearence AGENTS („ TURTLES “) hidden? - default: false - can set to true as well

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 17 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 17 have a pen glued to their belly AGENTS („ TURTLES “) pen-mode - default: „up“, can also be „down“ pen-size

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 18 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 18 have a pen glued to their belly AGENTS („ TURTLES “) pen-mode - default: „up“, can also be „down“ -when the turtle moves with pen down, it will leave trails - trail colors corresponds to the turtle‘s color pen-size

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 19 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 19 have a pen glued to their belly AGENTS („ TURTLES “) pen-mode - default: „up“, can also be „down“ -when the turtle moves with pen down, it will leave trails - trail colors corresponds to the turtle‘s color pen-size - may also influence the thickness of the trail

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 20 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 20 change these to make an agent move AGENTS („ TURTLES “)

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 21 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 21 change these to make an agent move AGENTS („ TURTLES “) - special property containing the ID of the turtle (e.g. turtle 0)

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 22 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 22 cannot movePATCHES - are addressed by their center, e.g. patch 0 0 0

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 23 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 23 HANDS ON start NetLogo 3D type into the observer create-turtles 1

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 24 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 24 SEE THE RESULT

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 25 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 25 RIGHT MOUSE - CLICK THE TURTLE

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 26 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 26 CHOOSE TURTLE 0 > INSPECT TURTLE 0 … turtle 0 inspect patch inspect patch inspect turtle 0 watch turtle 0 follow turtle 0 ride turtle 0

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 27 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 27 HERE YOU GO, NOW … see the properties we talked about here change them & see the 3D view: pen-mode „down“ xcor 10 ycor 10 zcor 10 hidden? true

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 28 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 28NUMBERS are entered as-is you cannot change „who“ colors are numbers, too (see Tools>Color Swatches) color namenumber RED15 BLACK0 WHITE9.9

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 29 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 29STRINGS enter with quotation marks pen-mode: „up“ or „down“ shapes(see Tools>Turtle Shapes Editor) are for example: shape namelooks like „default“ „person“ „arrow“

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 30 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 30BOOLEANS enter either true or false

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 31 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 31 AGAIN, RIGHT - CLICK

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 32 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 32 CHOOSE INSPECT PATCH SEE THAT YOU CAN CHANGE THE PROPERTIES THERE THE SAME WAY SEE THAT YOU CAN CHANGE THE PROPERTIES THERE THE SAME WAY … turtle 0 inspect patch inspect patch

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 33 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 33 NETLOGO ENTITIES observer turtles patches creates live on

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 34 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 34 CREATE - TURTLES observer create-turtles 1 turtle 0

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 35 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 35INSPECT observer turtle 0 inspect turtle 0

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 36 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 36 ASK AND SET observer turtle 0 ask turtle 0 [ ] set color BLUE

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 37 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 37 ALSO FOR PATCHES observer ask patch [ ] set pcolor CYAN

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 38 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 38 TRY THIS ask and set are general commands, everything else is entity-specific, see Help > NetLogo Dictionary codewon‘t work because… ask turtle 0 [ create-turtles 1 ] only the observer can create-turtles ask patch 0 0 0[ set color red ] a patch has no property color. perhaps you meant pcolor?

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 39 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 39 COMMANDS SPECIFICALLY FOR TURTLES forward patch-units, back patch-units moves a turtle in the current direction left degrees, right degrees alters the heading of a turtle pen-down, pen-up changes pen-mode try this yourself! ask turtle 0 [forward 1]

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 40 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 40 COMMANDS SPECIFICALLY FOR OBERSERVER clear-all erases everything clear-drawing erases only the tracks of turtles create-turtles number […commands…] creates the specified number of turtles and runs commands on each one of them.

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 41 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 41 ASKING ALL AGENTS observer ask turtles [ ] set shape „person“

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 42 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 42 ASKING ALL PATCHES observer ask patches [ ] set pcolor cyan

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 43 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 43 THE „ WITH “ QUERY Can address entities based on their properties using a “with” query: observer ask turtles with [ycor > 0] [ ]

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 44 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 44 MORE EXAMPLES WITH „ AND “/„ OR “ ask turtles with[…] ask patches with[…] ycor > 0 ycor > 0 and xcor < 0 ycor > 0 or xcor < 0

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 45 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 45 WRITING A PROGRAM code is written on the „code“ tab click on this tab

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 46 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 46 YOUR FIRST PROGRAM to setup clear-all create-turtles 1 end write this

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 47 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 47 GIVE YOUR PROGRAM A USER INTERFACE get back to the interface add a button type this here setup

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 48 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 48 PRESS IT ! this will go to code and execute „setup“ the view will turn black and one turtle will be created at the origin

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 49 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 49 YOUR SECOND PROGRAM to go ask turtles [ set pen-mode „down“ forward 1 ] end write this

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 50 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 50 GIVE YOUR PROGRAM A USER INTERFACE get back to the interface add a button type this here go check this!

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 51 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 51 PRESS TO SEE THE DIFFERENCE will execute „go“ in a loop (forever) lots of trails will appear on screen

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 52 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 52 TYPICAL NETLOGO PROGRAM LAYOUT setup (executes once) clear everything set the environment (patches) –generate or load per-patch data create agents (turtles) –set shape, color, position and orientation set simulation time to 0 –…using reset-ticks go (called in a loop) simulate environment –e.g. changes to patches simulate agent behavior –orient and move turtles –simulate interactions between turtles and environment update statistics –using e.g. charts and plots advance time –…using tick see File > Models library

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 53 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 53 USER INTERFACE instead of using constant values, e.g.: create-turtles 10 you may 1.add a slider named num-turtles 2.use that as a placeholder, i.e. create-turtles num-turtles num-turtles

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 54 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 54 WHERE TO GO FROM HERE replacing hard-coded values by UI elements is always a good idea: after having finished, your program look like our our prototype implementation (which we present in the following slides): produces a number produces true or false) lets you enter a list of values to choose from

ARTIFICIAL SOCIETIES

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 56 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 56 WHAT IS THIS naively, a bunch of turtles interacting with patches having a behaviour (both patches AND turtles!) …interaction (turtle-turtle, turtle-patch, patch-turtle) is the key to complex systems

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 57 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 57INTERACTION per-patch data (e.g. „amount of wood“) is read or set by a turtle (e.g. get amount of wood here; set amount of wood to 0) per-turtle data is influenced likewise - can be read or set by a patch (e.g. if any turles here then set color to my color) data behaviour actor

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 58 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 58 DATA : PER - PATCH is written as: patches-own [ wood food ] at begin of your code. all data is initially set to zero, must explicitly ask patches [set wood 10] in setup if you want to change that wood = 0 food = 0

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 59 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 59 try it, e.g. using patches-own [ value ] and going to the interface tab YOUR TURN !

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 60 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 60 DATA : PER - TURTLE is likewise written as: turtles-own [ carries-wood carries-food ] try this out to see how it looks carries-wood = 0 carries-food = 0

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 61 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 61 BEHAVIOUR : SETTING A PATCH VALUE TOP VIEW value SIDE VIEW 1.each turtle is in exactly one patch 2.it can access a value of a patch by writing its name, e.g.: ask turtle 0 [set value (value + 1)] try it! +1

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 62 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 62 MORE OPTIONS you can get a value from… SAME PATCH PATCH AHEADSURROUNDING PATCH

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 63 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 63 GET VALUE AT Figure taken from McLoughlin, Laramee and Zhang 2009, “Easy integral surfaces “ optioncode same patchvalue [value] of patch-here patch one step ahead[value] of patch-ahead 1 surrounding patches (mean, minimum or maximum) mean [value] of neighbors or max [value] of neighbors or min [value] of neighbors

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 64 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 64 SET VALUE AT however, to set a value at a different patch, you must ask: ask turtle 0 [ ask patch-ahead 1 [ set value (value + 1) ] yes that‘s right you can nest asks (in fact, you can nest almost everything)

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 65 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 65 NEED FOR INTERMEDIATE MEMORY ask turtle 0 [ ask patch-ahead 1 [ set pcolor color ] pcolor doesn‘t work which of these two colors do you mean? color

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 66 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 66 INTERMEDIATE MEMORY ask turtle 0 [ let the-color color ask patch-ahead 1 [ set pcolor the-color ] use let to remember things even after nesting, like here: the color RED

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 67 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 67 BEHAVIOUR : SETTING TURTLE VALUES ask patch [ ask turtles-here [ set color red ] remember: there can be many turtles in the same patch color RED color

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 68 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 68 MORE OPTIONS you can also set a value to… RED one-of turtles-here with [color = purple] RED one-of turtles in- radius 2

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 69 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 69 SELECTING TURTLES sample model: garden.nlogo – used as demo for selecting turtles

Wurzer, Lorenz, Popov: „NetLogo Workshop (Part 1)“, in eCAADe 2012 Prague, Slide 70 „Netlogo First Steps (Artif. Societies) “, in Social Simulation Conference 2014, Barcelona, Slide 70 S O WE COME TO BREE DS NetLogo predefines one „breed“ of agents called turtles As programmer, you are free to define more breeds using the „breed“ keyword: breed inherits properties of turtle (no multiple inheritence, no patch breeds) breed [persons person] plural singular

THANK YOU