MIS 643 Agent-Based Modeling and Simulation 2016/2017 Fall.

Slides:



Advertisements
Similar presentations
Got Gas? Jim and Michael. Problem Statement (Weight 15%) An investigation of a gas pump queue as a function of rationing policy We modeled the queue at.
Advertisements

Netlogo! NetLogo is a programmable modeling environment for simulating complex systems. Modelers can give instructions to hundreds or thousands of independent.
Agents and Pervasive Computing Group Università di Modena e Reggio Emilia System Requirements NetLogo is designed: to run almost any type of computer.
13 giugno 2006Master in economia e politica sanitaria - Simulazione per la sanità 1 _Strumenti, seguito _______________________________________ Un modello.
Netlogo and its Relatives Logo (Papert) –Language for teaching mathematics graphically –Tell turtle how to move Starlogo (Resnick) & StarlogoT (Wilensky)
Spatial Analysis with ArcView: 2-D. –Calculating viewshed –Calculating line of sight –Add x and y coordinates –Deriving slope from surface data –Deriving.
New Mexico Computer Science For All Designing and Running Simulations Maureen Psaila-Dombrowski.
SWARMFEST An Agent-Based Simulation For Emergency Response Management Timothy Schoenharl, R. Ryan McCune, Greg Madey of the University of Notre Dame.
Logo Lesson 3 TBE 540 Fall 2004 Farah Fisher. Prerequisites for Lesson 3 Before beginning this lesson, the student must be able to… Use simple Logo commands.
Lec 5 Feb 10 Goals: analysis of algorithms (continued) O notation summation formulas maximum subsequence sum problem (Chapter 2) three algorithms image.
Probability Grid: A Location Estimation Scheme for Wireless Sensor Networks Presented by cychen Date : 3/7 In Secon (Sensor and Ad Hoc Communications and.
The If/Else Statement, Boolean Flags, and Menus Page 180
2-Day Introduction to Agent-Based Modelling Day 2: Session 5 Variables and Debugging.
New Mexico Computer Science For All More Looping in NetLogo Maureen Psaila-Dombrowski.
Teaching Contemporary Mathematics Conference January 25, 2013 Christine Belledin NC School of Science and Mathematics.
Department of Computer Science What is NetLogo UH-DMML  Multi-agent programmable modeling environment  Well suited for modeling complex systems evolving.
Agent-Based Modeling and Simulation (ABMS) Bertan Badur Department of Management Information Systems Boğaziçi University.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
UNLOCKING THE SECRETS HIDDEN IN YOUR DATA PART 1 Data and Data Analysis.
ABM Frameworks Dr Andy Evans With additions from Dr Nick Malleson.
Chapter 1: Introduction to Statistics
NetLogo Dr. Feng Gu. NetLogo NetLogo is a programmable modeling environment for simulating natural and social phenomena, authored by Uri Wilensky in 1999.
Agent-Based Modeling and Simulation (ABMS) Bertan Badur Department of Management Information Systems Boğaziçi University.
CISC 1600 – Lecture 3.2 Simulations Complex Input & Output NetLogo.
2-Day Introduction to Agent-Based Modelling Day 2: Session 8 Exploring Model Collections, NetLogo Lists, Further Resources.
Agent-Based Modeling and Simulation (ABMS) Bertan Badur Department of Management Information Systems Boğaziçi University.
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,
UNLOCKING THE SECRETS HIDDEN IN YOUR DATA Data Analysis.
A Look Inside Some NetLogo Simulations Bruce Edmonds Centre for Policy Modelling Manchester Metropolitan University.
Why Is It There? Getting Started with Geographic Information Systems Chapter 6.
New Mexico Computer Science For All Interface Input in NetLogo Maureen Psaila-Dombrowski.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Agent-Based Modeling and Simulation (ABMS) Bertan Badur Department of Management Information Systems Boğaziçi University.
Models, Agent-Based Models and the Modeling Cycle Universidad Politécnica Salesiana.
Agent-Based Modeling and Simulation (ABMS) Bertan Badur Department of Management Information Systems Boğaziçi University.
Week 10 DO NOW QUESTIONS. A programmer has created 100 turtles of random colors and randomly distributes green patches. Every time the turtles land on.
New Mexico Computer Science For All Variables and Scope Maureen Psaila-Dombrowski.
Agent-Based Modeling and Simulation (ABMS) Bertan Badur Department of Management Information Systems Boğaziçi University.
New Mexico Computer Science For All Patches and Agent/Environment Interactions Maureen Psaila-Dombrowski.
MIS 585 Special Topics in IMS Agent-Based Modeling Bertan Badur Department of Management Information Systems Boğaziçi University.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
MIS 585 Special Topics in MIS: Agent-Based Modeling 2015/2016 Fall.
From: CHAPTER 9– Advance Compound Objects 3DS MAX AND ITS APPLICATIONS Advanced Compound Objects James Martin High School Computer Multimedia and Animation.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Biology: foraging Day 6 COLQ 201 Multiagent modeling Harry Howard Tulane University.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
M10 WS11:Krankenhausbedarfsplanung The World as We See It given by Gabriel Wurzer and Wolfgang E. Lorenz
Why Is It There? Chapter 6. Review: Dueker’s (1979) Definition “a geographic information system is a special case of information systems where the database.
March 1, 2016Introduction to Artificial Intelligence Lecture 11: Machine Evolution 1 Let’s look at… Machine Evolution.
1 Agent-Based Tools: focus on NetLogo Ing. Cristina Ponsiglione University of Naples Federico II Laboratorio di Simulazione ad Agenti.
The rise of statistics Statistics is the science of collecting, organizing and interpreting data. The goal of statistics is to gain understanding from.
An Introduction to NetLogo given by Gabriel Wurzer and Wolfgang E
AnthropologischeGesellschaftWien
OPERATING SYSTEMS CS 3502 Fall 2017
Management Information Systems
MIS 643 Agent-Based Modeling NetLogo: Summary of Manual and Dictionary.
Creating Simple Agent-Based Models
Data Mining: Concepts and Techniques
Management Information Systems
An introduction to Netlogo agent-based software
A Cellular Automata Approach to Population Modeling
The Nature of Probability and Statistics
Coding Concepts (Sub- Programs)
Introduction to Artificial Intelligence Lecture 11: Machine Evolution
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
CHAPTER 1 Exploring Data
First Exam 18/10/2010.
creating a ecosystems model in net logo
MIS 643 Agent-Based Modeling and Simulation 2016/2017 Fall
MIS 585 Special Topics in MIS: Agent-Based Modeling 2015/2016 Fall
Presentation transcript:

MIS 643 Agent-Based Modeling and Simulation 2016/2017 Fall

Outline Virtual Corridors of Butterflies From ODD to NetLogo Implementation

Chapters 4,5 of RG-IABM

Virtual Corridors of Butterflies virtual corridores – Peer et al. (2005) mate-finding by butterflies (bf) “hilltopping” strategy - males and females uphills for meet and mate Simple model formulation by ODD protocol

Purpose questions about virtual corridores (VC) under what conditions interactions of bfs hilltopping behavior and topograhpy emergence of virtusl corridores relatively nerrow paths bfs move variabiity in bf. strategy affects formation of VCs

Entities, State Variables and Scales butterflies square patches of land – State Variables: elevation – land positions of butterflies on patches – x,y coordinates Scales: time and patch not impotant but time length – time fo fly 25-35 meters patch size 25 x25 meters 1000 time steps with a 150x150 square landscape

Process Overview and Schedulling Process – movement of the bfs. at each time bfs. move one step order of movements – not impotant no interraction among bfs.

Design Concepts basic principle - virtual corridores emergence – how corridores emerge from 1 - adaptive movement behavior of bfs 2 – topograhy of landscape adaptive behavior – moving behavior of butterflies based on an emprical law objective, learning, prediction – not included

Design Concepts (cont.) sensing – how bfs percive higher elevation interraction – not included stocasticity – each bf. at each step move uphill its neighbors with probability q and move random to its neighbors with probability 1-q

Initilization topography of the landscape 1- artificial 2- real values from a file 500 bfs set to a patch

Input Data Environment is not chaning not needed

Submodels movement submodel: uphill: highest neigboring patch how bfs decide to move uphill: highest neigboring patch random: randomly on of the eight naighboring pathces For each butterfly at each time step whether move uphill or random is by a contol parameter q q: global variable from a uiform distribution

Submodels (cont.) at each time step each bf draws a random variable x from a uniform distribution between 0.0 and 1.0 if x < q move uphill otherwise move randomly

From ODD to NetLogo Implementation Purpose – information tab model description Entities, State variables and Scales tutles-own [ ] patches-own [ ] globals [ ]

From ODD to NetLogo Implementation Process and Schedule – go Design concepts Initilization - setup Input data – from file input Submodels - processes called from go

Entities State Variables Scales globals [] turtles-own [] patches-own [elevation] For a 150x150 landscape from settings – corner – buttom left max-pxcor: 149,max-pycor: 149 Square landscape – turn off world wrapper patch size 3 or so

Initialization to setup ca ask patches [ ] reset-ticks end Templeate for initialization

Initialization – set elevations ask patches [ let elev1 100 - distancexy 30 30 let elev2 50 - distancexy 120 100 ifelse elev1 > elev2 [ set elevation elev1] [ set elevation elev2] set pcolor scale-color green elevation 0 100 ]

Initialization – set elevations elev1 elev2 local variables for creating two hills hill1 at 30 30 at a height of 100 hill2 at 120 100 at a height of 50 primitives:distancexy,scale-color set pcolor scale-color green elevation 0 100 Scales color

Initialization - turtles crt 1 [ set sıze 2 setxy 85 95 ] create one turtle at 85 95 with a size of 2

Process Schedule to go ask turtles [move] tick if ticks >= 1000 [stop] end to move in go procedure primitives tick, ticks stop

Submodels - move to move ifelse random-float 1 < q [uphill elevation] [move-to one-of neighbors] end

Submodels - move probability q uphill with 1-q to random neighbor move-to one-of define and initilize q

Chapter 5 of IABM Introduction Observation of Corridors Analazing the Model Time Series Resutls: Adding Plots and File Output A Real Landscape Summary and Conclusions

5.1 Introduction modeling – not formulating and implementing iterative process – modifying refining model

The Problem Problem: where and how corridors are formed? quantitative outputs to be analized replace artificial landscape with a real topography

Learning Objectives version control quantitative outputs and simulation experiments slider or switchs for global variables, reporters output window time series plot exporting to a file importing data from a file

5.2 Observation of Corridors How to caracterize a corridore? if all bfs have the same path: start from same posstion and q = 1.0 corridor - very nerrow if movement – completely random q = 0.0 no corridore like feature How width of paths change as q or topography varies

quantifying width bfs can start and end – different places Assume: bfs stop – rich a local hilltop – a patch higher than all its neighboringpatches quantify width of the corridor – all bfs #pathces visited – any bf divided by mean distance – starting and edning locations – all bfs

quantifying width lower bound 1.0 when all bfs follow a streigth line increases as bfs diverge Analysis: plot q v.s. corridor width

First modifications slider for q modify setup from 0.0 to 1.0 with increments 0.01 modify setup create 50 bfs starting from same position experiment with different q values Programming Notes: moving variables to the interface remove from globals remove initialization in setup procedure indicate with a comment

modifying move bfs stop when they rich a local hill a patch with an elevation higher than its neighbors stop rest of the move procedure code – start of the move if elevation >= [elevation] of max-one-of neighbors [elevation] [stop] if condition ; turtle context move - in turtle context turtles get patch veriable - elevation

right side of condition of and max-one-of commands: of: [reporter or agent variable] of agent or agentset

right side of condition agent variable: elevation agent: agent in the neighborhood of the current turtle with maximum elevation max-one-of agentset [reporter or agent variable] report an agent from the agentset based on the reporters value

width of the bf population a - # of patches visited b- mean distanc between bfs starting and ending positions two new state variables for each patch – keep track of whether a turtle ever visited it or not for each turtle – store its starting patch

width of the bf population Add a boolean variable to pathces – used? patchs-own [used?] turn to true is the patch is ever visited

width of the bf population Add a variable to turtles – start-patch turtles-own [start-patch] set to the start patch when inilizing bfs

initilize in setup ask patches [ ... set used? false ] create-turtles [ set start-patch patch-here patch-here: reports the patch the turtle is currently on Programming note: initializing variables all variables has an initial value of 0

move and go procedure When a bf moves to a patch set the patch variable to true at the end of move in the go procedure before the program stops let final-corridor-width corridor-width a laocal variable is assigned the value of the corridor width computed by another procedure (reporter) to-report corridor-width calculate and report corridor width print the value of final-corridor-width to an output

go procedure to go ask turtles [move] tick if ticks >= 1000 [ let final-corridor-width corridor-width output-print word "corridor width " final-corridor-width stop ] end

corridor-width reporter to-report corridor-width let patches-visited count patches with [used?] let mean-distance mean [distance start-patch] of turtles report patches-visited / mean-distance end

move to move if elevation >= [elevation] of max-one-of neighbors [elevation] [stop] ifelse random-float 1 < q [uphill elevation] [move-to one-of neighbors] set used? true end

5.3 Analazing the Model How corridor width output is affected from q plot corridor width v.s. q as q increases – corridor width falls as expected but when q=1.0 corridor widthis <1.0 How can this be?

5.4 Time Series Resutls: Adding Plots and File Output to go ask turtles [move] plot corridor-width if ticks >= 1000 [ ... stop] end add a ploter to tthe interface add an output to the interface

add a ploter to tthe interface give plot name “corridor width” export-plot “corridor width” word “corridor-output-for-q ” q

exporting plots to a file write the results of plots to a file add the command to the end of go before the program stops export-plot “corridor width” word “corridor-output-for-q” q export-plot ploter_name filr_name

write coridor width to output print the final coridor width to an output widow in the interface create and add an output to the interface add the command to the end of go before the program stops output-print word "corridor width " final-corridor-width

before program stops if ticks >= 1000 [ let final-corridor-width corridor-width output-print word "corridor width " final-corridor-width export-plot "corridor width" word "corridor-output-for-q" q stop ]

go procedure to go ask turtles [move] plot corridor-width tick if ticks >= 1000 [ let final-corridor-width corridor-width output-print word "corridor width " final-corridor-width export-plot "corridor width" word "corridor-output-for-q" q stop ] end

5.5 A Real Landscape real data from “ElevationData.txt” from books web side Programming Note: grid-based: x-coordinate, y-coordinate and a value one data line for each grid point

add to setup file-open “ElevationData.txt” while [not file-at-end?] [ let next-x file-read let next-y file-read let next-elevation file-read ask patch next-x next-y [set elevation next-elevation] ] file-close

next do determine dimensions of the world examining the data file adjust the scale of the color for the new max and min values of the elevations initial positions of bfs in a 10x10 area randomly asign xcor and ycor of bfs setxy (80 + radnom 10) (90 + radnom 10)

scaling color let min-elevation min [elevation] of patches let max-elevation max [elevation] of patches ask patches [ set pcolor scale-color green elevation min-elevation max-elevation set used? false ]

5.6 Summary and Conclusions NetLogo for agent-based science Modeling a system of multiple agents quantitative variables analyzing ouputs simulation experiments real spatial data

5.6 Summary and Conclusions (cont.) butterfly model – simple but... other environments movement of ideas people social networks economic or political lanscapes