demos-script.txt ---------------- Some demo's of "classic" (and other) Swarm/Repast models, as well as a pointer to netlogo at cscs. Schelling's Tipping model ------------------------- This is truly a classic ABM. See the handout from the first class, as well as the demo-short.txt file below, for more information (also the course syllabus as tipping-demo-short.txt). To run the Swarm version: /users/rlr/SwarmStuff/CSCS-Demos/Tipping2-swarm2.1.1/tipping & Follow this script /users/rlr/SwarmStuff/CSCS-Demos/Tipping2-swarm2.1.1/demo-short.txt Lets run the RePast version instead. See /users/rlr/RePast/Demos-3/Tipping1/Readme.txt for information about it. To run it: /users/rlr/RePast/Demos-3/Tipping1/bin/guirun.sh & Click the initialize button (semi-circle arrow) Two types. Threshold is 0.20 -- will stay put if 79% different neighbors! Click step button a few times (vertical bar, right wedge) Stops -- everyone happy. Note slight increase in segregation (see graphs, and in world). Repeat: Set randomMoveProbability to 1, step a few times. Set rMP=0, run (right wedge) till stops Note average segregation at end of each "run". Change thresholds to 0.3, run; 0.4, run. (randomize between runs) Change thresholds back to 0.2, rMP=0.3, run/pause (two vertical bars) Change to rMP=0.1, run; 0.01, run; 0.001 run; Nowak and May 2D Iterated Prisoner's Dilemma (IPD) -------------------------------------------------- To run a Swarm version of this model: /users/rlr/SwarmStuff/CSCS-Demos/IPDm0-swarm2.1.1/m0 & Press to initialize Short description: 2 pure strategies: C (Blue) or D (Cyan,Red) each time step each agent (cell) plays its 8 neighbors payoff: D,D 0,0 D,C b,0 C,C 1,1 for b > 0 C,D 0,b each agent copies neighbor with best total score in that step Note: from agents "egoist" point of view of each pairwise play, best thing to do is to be D, no matter if other is C or D: Net score: I play C D other plays C 0 b best for me to D D -b 0 best for me to D D is spreading...predict what for long run?? .... change to b=1.8, 1.7, 1.6, 1.5 ... For more details, see the help that comes with the program: /users/rlr/SwarmStuff/CSCS-Demos/IPDm0-swarm2.1.1/writeHelp.txt heatBugs3 --------- This is the classic Swarm/RePast demo. See /appl/repast/Demos-3/heatBugs-conceptual-model.txt for a "conceptual" description. Here we run a version modified at CSCS/um, described in /users/rlr/RePast/Demos-3/heatBugs3/Readme.txt /users/rlr/RePast/Demos-3/heatBugs-conceptual-model.txt To run this one: /users/rlr/RePast/Demos-3/heatBugs3/bin/guirun.sh Then press the Initialize button (semi-circle arrow) Describe the parts: bugs - green in 2D space. (filled if size > average; blue if cold) Then ... Note the red, note the bugs move around, note average unhappiness. for a bit Note the growing red, the clustering of bugs. Probe a bug in a group: change its idealTemp to 0. ... Note the agent runs from the pile. Note its running from itself!! Change randomMoveProbability to 0.5. Note much difference!! Try 0.8 ; 0.9 ; 1.0. NOTE: The above method of running the heatBugs3 demo uses a linux script. It can also be run using a program called "ant" (for those of you who know unix, its kind of like "make"). For our programs/projects this term we almost certainly won't use ant, so don't worry about the details of what it is or how it works. MouseTraps ---------- This is a classic example of a DES (descete event simulation) in which the events are scheduled dynamically, as a result of the actions as the model runs. Basically, time is represented by a sequence of events to be executed, one after the other, in some specified order (with ties broken in various ways). Time advances by picking the next event off the schedule and executing it. When an event is excuted, it may schedule additional events in the future. In any case, time continues by executing whatever event is next on the queue. In this simple example, we are modeling a room with mousetraps covering the floor. Each mousetrap has a couple of ping-pong balls on it. A first ball is dropped into the room, i.e., a first trap-firing event is scheduled. That event is executed, i.e., it fires off that one trap, which flings its balls into the air. A random process determines when and where those balls hit the ground, i.e., hit other traps. Those new trap-firing "events" are then added to the schedule. Time advances as these and subsequent (partially ordered) events are executed, until there are no more events to execute. To run it, first start up the generic repast: java -jar /appl/repast/repast3.0/repastj/repastj.jar & Click the LoadModel icon (far left of control bar). From the choices, select MouseTraps (left click) and then click the Load button. Click on the Parameters tab to see possible parameter values. Try different values for Max Distance, Number Balls (per trap), and so on, noting, e.g., the time to peak balls-in-air. Note: You might want to try some of the other "demo's" that come with Repast. You can find the "built-in" ones under the LoadIcon list mentioned above, including Conway's Game of Life, a simple version of SugarScape, and a few others. (Alas, documention tends to be sparse for these...) Leader-centric model of Small Closed Regime ------------------------------------------- Note: You won't be able to run this...its included just to show a more complicated model, and a number of features that can be included via 3rd party Java libraries. Notes to rlr for demo: cd /users/rlr/Scram/Landscapes/LS_MSM_v015 ant run -Dargs="inputFileName=./dat/msm.dat" -DdebugFile=./debug then show landscape: support (utility later) (see LandScape Generator Window) A (very) brief description: Agents located at preferences in 2D policy space (guns vs butter), with salience (size of blob) Agents have power (influence) on each policy dimension. Leader has "inner tier" regime members (lines). Policy is green square Support for the policy is a function of sum over all agents, each agents support = f( differenceFromPref, salience, power ) Leader has a utility function that trades off - support for policy ( == regime stability ) - personal policy prefs - amount of personal power Leader can take actions - reallocate power - change policy Leader generally tries to maximize own utility, but some have personal "heuristics", e.g., don't let any other get too much power, don't take big risks (eg move policy a lot), etc Exogenous events occassionaly change power, etc. Drag an (inner tier) agent around...note the landscapes change! Note the support/utility max may be the same, or maybe not! -- watch policy move up the utility hill (more or less) note agents power change sometimes agents get fired/hired from the inner-tier group. --> shape of landscapes changes. MB1 - probe agent: can change things, observe things MB3 - bring up tool to modify the function that defines how the agent's support falls off as policy differences from perference: eg slide bottom to high value--very sharp fall off slide to right -- more tolerant ================================================================================== Netlogo ------- Netlogo is a very popular, simple to get started, ABM platform. Its roots go back to the Logo language (remember that from grade school???) through *Logo and StarLogo. Its very actively being developed by Northwestern's Complex Systems group. On the CSCS machines, one can run netlogo with this command: netlogo3.0b & There are *many* netlogo demo's from a variety of fields. See them listed under File->Models Library. For example, under SOcial Science you can find Schelling's model by clicking on Segregation -- a brief description will pop up, with a screen shot. Click on the Open button. In the main netlogo window it will load that model. You can get more information about it under "Information" including some simple instructions on how to run it. Click again on the "Interface" tab, and click Setup and then Go to run it. You can see what a netlogo program looks like under the "Procedures" tab. Load a few of the other models, give them a try. Eg, Social Science-> Wealth Distribution is a version of SugarScape === NOTE **** NOTE ===> Please do NOT run or look at these two: - Biology -> Termites - Biology -> Ants as we will be using those for exercies/projects in the class, and these exercises will go better if you do not use ideas from the netlogo programs. Note that its not a question of right or wrong answers, it just a matter of you thinking through the problems "from scratch" so to speak.