4f2f3bd9196bedc0610a3e9380bdcc07.ppt
- Количество слайдов: 16
ABM Frameworks Dr Andy Evans With additions from Dr Nick Malleson
ABM Frameworks What are they? Pieces of software to help people build ABMs Wide range of tools Pre-written functions Entire graphical environment Somewhere in the middle
Why use them? For non-programmers: Graphical “point-and-click” model development. Easier than having to learn a programming language. For programmers: No need to write ‘external’ functionality (e. g. drawing graphs, scheduling events, creating displays). Can concentrate on model logic. Save time (? )
Other Advantages Create an Applet (Netlogo). Talk to other programs, e. g. R, Weka, MATLAB. Output information (to databases, flat files, reports etc). many more…
Commonly Used Platforms Netlogo: http: //ccl. northwestern. edu/netlogo/ Repast: http: //repast. sourceforge. net/ MASON: http: //cs. gmu. edu/~eclab/projects/mason/ Ascape: http: //ascape. sourceforge. net/ ABLE: http: //www. research. ibm. com/able/ Modelling 4 All: http: //www. modelling 4 all. org/ Second. Life: http: //secondlife. com/ Agent Analyst: http: //www. spatial. redlands. edu/agentanalyst/
Introduction to Netlogo Based on “Star. Logo” Popular teaching tool Aimed at school children, very easy to learn and use Implemented in Java Cross-platform (models will run on any computer which runs Java). Uses its own scripting language –Java is hidden Excellent documentation http: //ccl. northwestern. edu/netlogo/docs/
Model Examples Demo “Ants” from model library
Net. Logo basics Two windows: Interface and Procedures Interface contains graphical elements Procedures are user-defined functions
Net. Logo Basics: The Interface Lots of items can be added to view or control the simulation These are linked to model code Sliders: set a variable value Buttons: call a procedure Monitors: output the value of a variable Plots: create a graph of variable(s)
Net. Logo Basics: Turtles and Patches Turtles are the agents Move around Make decisions Interact with other turtles Interact with patches Patches are the grid cells Cannot move, but can interact with other patches, and with turtles
Net. Logo Basics: buttons Example: ‘setup’ button and code
Net. Logo Basics: Built-in Commands Set the colour of all patches: ask patches [ set pcolor yellow ] Set the name of turtle 12: ask turtle 12 [ set name “bob”] 0. 01 probability that each turtle will give birth ask turtles [ if random 100 <1 [ set give-birth? True] ] Change colour of houses surrounding person 12 ask turtle 12 [ ask neighbors 4 [ set pcolor blue ] ]
Net. Logo Basics: Commands make complicated functions easy: Net. Logo command: Set the colour of the houses surrounding person 12: ask person 12 [ ask neighbors 4 with [ ptype= "house" ] [ set pcolor blue ] ] Java command: for (int i=0; i<people. size(); i++) { if (people. get(i). get. ID() == 12 ) { for (int j=0; j<houses. size(); j++) { if ( <house next to person> ) { house. set. Colour(blue); } } // // // Loop over all people Find person 12 Loop over all houses Work out house/person position Set the house colour
What’s Netlogo good for? Rapid model design. Abstract thought experiments. Verification testing on abstract landscapes.
Further info Steven Wolfram “A new kind of science” A major project applying CAs to Life, the Universe and Everything. Multi. Agent Systems and Simulation http: //www. geog. leeds. ac. uk/groups/mass/ Craig Reynold’s website. http: //www. red 3 d. com/cwr/boids/
Further info Flake (2000) The Computational Beauty of Nature: Computer Explorations of Fractals, Chaos, Complex Systems, and Adaptation. Wooldridge (2009) An Introduction to Multi. Agent Systems.
4f2f3bd9196bedc0610a3e9380bdcc07.ppt