Download - ABS COURSE SLIDES
-
8/8/2019 ABS COURSE SLIDES
1/89
Agent-based SimulationSocial Science Simulation and Beyond
Franziska Klgl
Universitt WrzburgLehrstuhl fr Knstliche Intelligenz
und Angewandte Informatik
Emma Norling
Centre for Policy Modelling
Manchester Metropolitan University
-
8/8/2019 ABS COURSE SLIDES
2/89
Outline
Introduction
Application domains
Example (pedestrian movements)
Example (cooperation between selfish individuals) Example (food webs)
Conceptual Issues
Technical Issues
Tools
Wrap up
-
8/8/2019 ABS COURSE SLIDES
3/89
Agent-based Simulation
-
8/8/2019 ABS COURSE SLIDES
4/89
Problem
Real System
? ??? ! ! ! !
Model
Modelling
Answers
-
8/8/2019 ABS COURSE SLIDES
5/89
Why Simulation?
the part of the real world that we want to examine is notaccessible, e.g. as the original system is not existing anymore or not yet
Experimenting with the real system is prohibited due to un-desired disturbances
Time scale of behaviour or system size is too small or toolarge for observation
Especially for scientific applications: the system and allinfluences from the environment are completelycontrollable
Modelling as a tool for understanding formalization of a
hypothesis that otherwise would have remained veryvague focus on relevant aspects for theory building
-
8/8/2019 ABS COURSE SLIDES
6/89
General Notions
Simulation = Experimenting with a model
Model = any image which can be considered as a systemand is used by a subject to obtain information aboutanother system
System = a set of objects with a structure any regularform of interactions may be taken as a structure
-
8/8/2019 ABS COURSE SLIDES
7/89
Relations between original and model
Original (Real)System
Model-System
New Data fromObservation
PredictionExplanation
AbstractionFocus
New Data fromSimulation Experiments
... Real World ...
... Real Time ...
... Simulated World ...
... Virtual Time ...
-
8/8/2019 ABS COURSE SLIDES
8/89
Abstract View onto a Model System
StateInput Variables Output Variables
Time Advance Function
Parameter
-
8/8/2019 ABS COURSE SLIDES
9/89
Different Forms of General Simulation
Depending on system properties and simulation goals:
Time advance
Granularity of simulation elements
Goal of the model
Dynamics Stochasticity
-
8/8/2019 ABS COURSE SLIDES
10/89
Time Advance Function
Continuous Simulation
Differential Equation Models
Time step can be reduced to arbitrary small intervals
Event-based Simulation
Event list is administrated by simulator:
The time of the head is set and the event executedproduces other events that are inserted into event list
Time is set to the next event
Activity-based simulation and process-orientedsimulation as special forms of event-based simulation
Established Formalism: DEVS
Time-stepped, round-based
Orthogonal concept to multi-agent simulation!
-
8/8/2019 ABS COURSE SLIDES
11/89
Granularity of simulation elements
Dimension for determining the level of detail that is possible in themodel.
Two basic forms
Macrosimulation
Complete system perspective
Microsimulation
Smaller Entities with distinct state and behaviour
(Im NOT talking about social science microsimulationbefore 90ies)
Intermediate Forms: Multi-Level Models
Distinction sometimes difficult, e.g. econometric models andsimulation
Agent-Based Simulation is a special form of Microsimulation
-
8/8/2019 ABS COURSE SLIDES
12/89
Goal of the modelling effort
Decisions about the model depend on its potential usage Level of necessary validity and empirical grounding
Two extreme forms
Prediction Models mostly Case StudiesModel should produce (quantitatively correct)
predictions depending on its input values Explanation/Understanding Abstract Models
Qualitatively significant results are sufficient forunderstanding the reaction of the system to inputvalues
in principal orthogonal dimensions for agent-basedsimulation
-
8/8/2019 ABS COURSE SLIDES
13/89
Where Standard Simulation Fails
Appropriate Modelling of (intelligent) Human Behaviour as necessary for socio-technical Systems, also with explicit
treatment of sociality
Systems, that draw their dynamics from flexible local
interaction
Systems, where individuality and/or locality is important
Multi-Level Systems
Emergent Phenomena and self-organizing systems
Biology
Traffic Systems
-
8/8/2019 ABS COURSE SLIDES
14/89
Agent-based Simulation is the Solution
= Multi-Agent System in a simulated environmentand in virtual time
Model concept based on Multi-Agent Systems
Active entities = Agents
Environment for an agent consists of other agents and explicitenvironmental entities: e.g. resources, world Frame foragent system, in particular important for adaptive agents
Interactions among the agents are central point
Agent-based Simulation: Agents+Interaction+Environment
Conceptual level Implementation level?
-
8/8/2019 ABS COURSE SLIDES
15/89
Alternative Views
Simulation System itself is consisting of agents
Simulator, Optimizer, etc. form a Multi-Agent System
Some researchers request stronger notion of agents
required for multi-agent (based) simulation
Some researcher see origin of multi-agent simulation inArtificial Life
Here: Agent-based simulation = Multi-agent simulation =Modelling a real Multi-Agent System/Agent as a Multi-
Agent System/Agent in the Model Using the concept of
multi-agent systems in conceptualization, specificationand implementation of the model
-
8/8/2019 ABS COURSE SLIDES
16/89
Agent-based Simulationversus Traditional Approaches
For argumentation, why agent-based simulation should beused knowledge about the weak points of otherparadigms is necessary.
Macro Simulation
Process-oriented Models Queuing Networks
Petri-Nets
Object-oriented Simulation
Cellular Automata
No need to contrast Agent-based Simulation with Event-based Simulation
-
8/8/2019 ABS COURSE SLIDES
17/89
Why Multi-Agent Simulation?
New paradigm that allows more appropriate modelling Social science Biology Modelling of socio-technical systems Modelling test environments for agent-based software
Allows to treat systems that were not or hardly treatable by
simulation before Emergent phenomena Variable structure models
Allows to bring more details into models more realism, micro-validity
Provides a more intuitive way of modelling
Facilitates communication Enables more researcher to use simulation
-
8/8/2019 ABS COURSE SLIDES
18/89
Characteristics
Agents = autonomous entities that are able to react toenvironmental change, but also to proactively changetheir behavior
Typically >>1 agent
At least two levels of observation
Locality of perception/action Heterogeneity(most time spatially explicit, but not necessary)
Variable structure models
Flexible interactions between the agents
Non-linear feedback loops
Adaptive agents / systems
-
8/8/2019 ABS COURSE SLIDES
19/89
Remarks on Autonomy in Simulation?
Autonomy seems to be a problematic notion
Two levels of autonomy of the simulated agents
Autonomy within the model in relation to other
modelled entities Autonomy in relation to the modeller
-
8/8/2019 ABS COURSE SLIDES
20/89
Agent-based Systems Agent-based Simulation?
Agent-based Models are used as substitutes for anothersystem, the original multi-agent system
Agent-based Simulations mostly use virtual time
Simulated Multi-Agent Systems live a in a simulatedenvironment
Social space
2d/3d virtual geometric space
Thus, time and environment are controlled by the modeller
-
8/8/2019 ABS COURSE SLIDES
21/89
Main Steps in a Simulation Study
Concept Model
Phase
Specification
Phase
Implementation
Phase
Experimentation
Phase
Mistakes or Misconceptions Repeat different steps
In some domains iterative modelling is advisable
Play around with model prototypes
Starting with the most simple model adding pattern
of behavior
-
8/8/2019 ABS COURSE SLIDES
22/89
Details
1. Formulate the goal of the simulation study / research question
2. Design of the model
Coarse level concept model
Detailed, formal level specified model
3. Justification of assumptions
4. Selection of output values and measurements
5. Selection of simulation software
6. Implementation of the model
7. Verification
8. Experiment Design
9. Validation, Sensitivity Analysis10.Interpretation and Presentation of results
-
8/8/2019 ABS COURSE SLIDES
23/89
Validation and Verification
Concept Model Specified ModelImplemented
Model
Simulation
Output Data
Original (Real) System
ValidationValidation Validation Validation
Verification VerificationVerification
-
8/8/2019 ABS COURSE SLIDES
24/89
Do-nots for Simulation in General
1. Failure to have a well-defined set of objectives at thebeginning of the simulation study
2. Inappropriate level of model detailminimal model
3. Treat simulation simply as programming exercise
4. Failure to collect appropriate data from the original system5. Inappropriate simulation software
6. Failure to account correctly for sources of randomness
7. Inappropriate output data analysis
-
8/8/2019 ABS COURSE SLIDES
25/89
Agent-based Simulation - Summing Up
-
8/8/2019 ABS COURSE SLIDES
26/89
Advantages
Agent-based Simulation is a powerful paradigm:
Dealing with real Multi-Agent Systems directly:
real Agent = simulated Agent
Elegant treatment of variable structures
Allows modelling of adaptation and evolution
Modelling of heterogeneous space and population
Different levels of observation, but also of modelling
High-level, intelligent, social behaviour treatable
-
8/8/2019 ABS COURSE SLIDES
27/89
A Glance on Issues
High requirements on modelers and time
Which type of model to select?
What level of abstraction / detail reasonable?
Dependence on initial situation?
Emergence and non-linearity Stochastic processes
Size of simulation and scalability
Sensitivity, but huge parameter space
Implementation details
Problems in validation?
-
8/8/2019 ABS COURSE SLIDES
28/89
Categories and Application Domains
-
8/8/2019 ABS COURSE SLIDES
29/89
Identification of Dimension for Categories:Case Studies - Abstractions
Marseilles Fish Market Abstract Auction Properties
Case Studies aim at reproducing one particular andsystem instance
Empirical data plays central role
Predictions may be possible
Abstractions: generalized models that reproduce on aprinciple level
Stand for a category of system, not one particularinstance
Aim at understanding
Intermediate forms (Typification in the terminology of
Boero&Squazzoni)
-
8/8/2019 ABS COURSE SLIDES
30/89
Additional Dimensions
Gilbert 2004:
artificial versus realistic - what original system should bereproduced?
positive versus normative
spatial versus network - refers to the topology of the environment
complex versus simple agents - from SOAR to simple reflexHare & Dreadman, 2004 (Environmental Management)
Coupling of social and environmental model: spatially explicit orspatially non-explicit
Social interaction: none, local social adaptation, global socialadaptation and group based tasks
Intrinsic adaptation: None, fine tuning, multiple strategies
-
8/8/2019 ABS COURSE SLIDES
31/89
Application Areas
Biological/Ecological Systems:active, heterogeneous entities (e.g animals) exert influences ontheir local environment reacting on local stimuli
Traffic Simulation:Microscopic Models are more and more enhanced by intelligentabilities of the (single) simulated drivers
Social Science Simulation:Artificial Societies for testing scientific hypothesis
Military Simulations (TacAirSoar System)
Industrial Simulation with relevant non-technical parts, likehumans, etc, but also Cargo Routing Optimization (South WestAirline)
Simulation for Entertainment (MASSIVE and Lord or the Ring Two
Towers) Testbeds for Multi Agent Systems and other complex control
systems
-
8/8/2019 ABS COURSE SLIDES
32/89
Three Illustrative Examples
-
8/8/2019 ABS COURSE SLIDES
33/89
Pedestrian Simulation
Wide area of related approaches based on CellularAutomata, Particle Models, etc.
Compared to Standard Traffic Simulation more degreesof freedom
Less inertia in Movement and Change of direction
Not bound to lanes Available data and prediction models based on a
concrete, often real-world layout
Validation based
on counts
plausibility
feature-based comparing
-
8/8/2019 ABS COURSE SLIDES
34/89
Agent-based Pedestrian Simulation
Activity Level Location Selection Module
Planing Level Path Generation Module
Actual Movement Level Collision Avoidance
-
8/8/2019 ABS COURSE SLIDES
35/89
One particular example:Pedestrians in Railway Stations
Restricted Activity Module:Pedestrians with two goals: Entering trains / leaving station
(changing trains)
Planning Module:
Predefined paths from station entrance to trains
stopping areas
Some heuristics/rules for high-level replanning
Collision Avoidance
Cellular Automaton
Social Force Model
Simple Rule-based System
-
8/8/2019 ABS COURSE SLIDES
36/89
Coffee Break
-
8/8/2019 ABS COURSE SLIDES
37/89
Example: Cooperation in Selfish Agents
There are certain areas in which individuals maybe inherently selfish, but tasks requirecooperation in order to be solved
Societies in general
Specific areas such as file sharing networks
-
8/8/2019 ABS COURSE SLIDES
38/89
-
8/8/2019 ABS COURSE SLIDES
39/89
Model Outline
There are N resource types, each requiring aspecific skill for harvesting
Agents require all resources to survive
Agents have only one skill, so must rely upon
other agents for the balance of resources An agent will respond to a request for resources
if the requesting agent is perceived as similarenough
-
8/8/2019 ABS COURSE SLIDES
40/89
Each agent has
One fixed skill
A tag in the range [0.0, 1.0]
A tolerance in the range [0.0, 1.0]
Stores for each resource type
A maximum number of steps that it will live
-
8/8/2019 ABS COURSE SLIDES
41/89
At each time step
A random amount of each resource type isdistributed between the agents with thecorresponding skill
Each agent is randomly paired with p other
agents Each partner whose tag is within tolerance of
the agents own tag, receives a proportion ofany excess resources
All stores are taxed
-
8/8/2019 ABS COURSE SLIDES
42/89
Births, Deaths and Arrivals
A small number of random individuals areinserted into the population at each time step
An agent will die if any store reaches 0
An agent will die if it reaches its maximum age
An agent will reproduce if all stores are higherthan some thresholdX
Offsprings skill is copied directly, but tag andtolerance are subject to mutation
-
8/8/2019 ABS COURSE SLIDES
43/89
Donation mechanism
-
8/8/2019 ABS COURSE SLIDES
44/89
-
8/8/2019 ABS COURSE SLIDES
45/89
Processing jobs
4
1
3
12
1
= altruist
= selfish
Job(1)
Job(3)
Job(1)
-0.25
+1
+1
0
Job(2)+1
Job(2)
0
Job(
4)
-
8/8/2019 ABS COURSE SLIDES
46/89
SLAC
Agent A1 processes job (if possible)
If cannot process, tries to find a neighbour who will
Mutation step:
A1 randomly selects another agent, A2
If wealth A2 > wealth A1, A1 copies A2:
Drops existing links Links to A2
Copies links of A2
Copies altruism of A2
With small chance, mutates link (random rewire)
With smaller chance, mutates behaviour
-
8/8/2019 ABS COURSE SLIDES
47/89
-
8/8/2019 ABS COURSE SLIDES
48/89
Typical Results
-
8/8/2019 ABS COURSE SLIDES
49/89
SLACER
As with SLAC, but instead of dropping all existinglinks, probabilistically drops links (typical p = 0.95;p = 1.0 SLAC)
Leads to a small world network
-
8/8/2019 ABS COURSE SLIDES
50/89
Typical Results (SLACER)
-
8/8/2019 ABS COURSE SLIDES
51/89
Trying to be smart
What if, instead of probabilistically dropping links,drop links that have not been helpful?
Nave approach:
Keep track of who did / did not assist with
requests, drop those who did not assist. Surprising outcome
-
8/8/2019 ABS COURSE SLIDES
52/89
Typical Results
-
8/8/2019 ABS COURSE SLIDES
53/89
Example: Food Webs
What is a food web?
A map of what eats what within anecosystem
Basal species are at the bottom of the
food web, getting nutrients directly fromthe environment
Intermediate species feed on otherspecies, but are in turn preyed upon
Topspecies have no predators
-
8/8/2019 ABS COURSE SLIDES
54/89
A Stylised Food Web
10 11
98765
4321
-
8/8/2019 ABS COURSE SLIDES
55/89
Two Natural Food Webs
The Scotian Shelf
-
8/8/2019 ABS COURSE SLIDES
56/89
Modelling Food Webs
Food webs are dynamic - the previous figuresshowed snapshots only
As one species declines, its predator(s) may
switch to more abundant prey
Species mutation or migration can introducenew species into the web
Few models look at this dynamic nature of foodwebs
-
8/8/2019 ABS COURSE SLIDES
57/89
The Physicists Model
An abstract model of food web evolution - aim isto replicate typical food web characteristics
Each species has 10 characteristics from a
possible set of 500
Species A has a score against species B basedon the relative scores of the characteristics
-
8/8/2019 ABS COURSE SLIDES
58/89
The Physicists Model, cont.
Species A can eat species B if the score ispositive
The number of any given species at time t+1 is
equal to:
The number at time t plus any gains fromfeeding and reproducing, minus any lossesdue to predation
-
8/8/2019 ABS COURSE SLIDES
59/89
An Agent-Based Alternative
The key shortcoming of this model is that otherthan their defining characteristics, all species areintrinsically the same
An agent-based alternative offers opportunity
for heterogeneity, both between species andwithin species
-
8/8/2019 ABS COURSE SLIDES
60/89
-
8/8/2019 ABS COURSE SLIDES
61/89
Structure of the ABM
Non-spatial (initially)
Uses same species characteristics as EBM
Uses same parameter settings as EBM
At each time step, each agent chooses a single
victim (or the world) to feed upon. If victim canbe eaten, agent feeds.
Agents reproduce when they gain sufficientresources.
-
8/8/2019 ABS COURSE SLIDES
62/89
Results of the ABM
Initial results showed promise.
-
8/8/2019 ABS COURSE SLIDES
63/89
but
Unlike the EBM, a multi-level food web neverreally evolved.
At most two levels formed, but most commonly
large numbers of basal species evolved, partly
preying off each other.
-
8/8/2019 ABS COURSE SLIDES
64/89
What was wrong?
First thought: something to do with ignoringspace.
But adding a spatial representation did not
improve matters
Anyway, EBM ignored space. Current focus:
There are some discrepancies in the EBM
There are also some unpublished rules
-
8/8/2019 ABS COURSE SLIDES
65/89
Conceptual Issues
Micro-macro link
Complexity
Level of detail
Size and scalability
-
8/8/2019 ABS COURSE SLIDES
66/89
Micro-Macro Link
In most (but not all) ABS, it is the macro (i.e.system) level behaviour that is measured, butbehaviours are coded at the micro (i.e.
individual) level
Need confidence that there is a reliablerelationship between the two results at themacro level should be explicable
-
8/8/2019 ABS COURSE SLIDES
67/89
Complexity
Complexity is a great buzz-word of themoment
Much funding targeted at tackling complexity
No clear definition of what it is
Commonly linked to emergent behaviour
-
8/8/2019 ABS COURSE SLIDES
68/89
Level of Detail
Agent-based simulations allow the study ofindividual differences, but the degree ofdifference being considered will depend largely
on the application
If you simply use homogeneous agents, ananalytic alternative might be possible
-
8/8/2019 ABS COURSE SLIDES
69/89
Size and Scalability
Closely linked to previous points, and also atechnical issue
What size is required to demonstrate your
point(s)?
To what extent can your simulation beextended/modified for other (related) purposes?
-
8/8/2019 ABS COURSE SLIDES
70/89
Technical Issues
Assumptions
Sensitivity
Validation and verification
Size and scalability
Agent or environment?
-
8/8/2019 ABS COURSE SLIDES
71/89
Assumptions
Every detail added to model means newassumptions
Be explicit about any assumptions, no matter
how trivial they may seem
Assumptions may have unexpectedconsequences (particularly interference)
-
8/8/2019 ABS COURSE SLIDES
72/89
Sensitivity
Chaotic model behaviour means:Small changes in input variables / parameter values resultin large changes in simulation output
Sensitivity Analysis is systematic testing for effects ofchanges in parameter values large and small variationsin values experimental design techniques
Relevance for calibration: sensitive models are difficult tocalibrate
Additional advantage: Identifying parameters withoutinfluence model simplification
Worst case:model is highly sensitive to an unjustified parameter
-
8/8/2019 ABS COURSE SLIDES
73/89
Validation and Verification
Validation and verification are useddifferently by different practioners!
Basically, models must be matched against thephenomenon being modelled, and checked for
errors at each stage of use
-
8/8/2019 ABS COURSE SLIDES
74/89
Validation and Verification (cont)
Ideal: There is enough empirical data available Could be realistic for case studies as data from one
particular system may be collected
Abstractions?
Aggregate comparison of input/output behavior(counting passing pedestrians, overall gains, measure for
food web structure) possible Micro-Validation can hardly be done on concrete level,
especially with stochastic processes.
Plausibility Checks, Turing Tests and other forms of intensivecommunication with domain experts
Participatory simulation / stakeholder involvement
-
8/8/2019 ABS COURSE SLIDES
75/89
Size and Scalability
As mentioned previously, also a technical issue
Likely to be a limit on the number of agents youcan simulation in a given time frame
What size is necessary to demonstrate desired
phenomena? How does this affect other issues?
-
8/8/2019 ABS COURSE SLIDES
76/89
Agent or Environment?
-
8/8/2019 ABS COURSE SLIDES
77/89
Tools
There are literally hundreds of tools available foragent-based simulation, providing assistancewith different aspects of the design,
development and analysis process
Your choice will depend on your particularneeds
-
8/8/2019 ABS COURSE SLIDES
78/89
E l f T l
-
8/8/2019 ABS COURSE SLIDES
79/89
Examples of Tools
Three tools are presented here as examples(SeSAm, Repast and JACK)
All are Java-based; all provide different levels of
support
This is not intended to be a representativesample of available tools; it would be impossibleto provide this!
S SA
-
8/8/2019 ABS COURSE SLIDES
80/89
SeSAm
http://www.simsesam.de/
Developed and maintained at the University ofWrzburgs Department for Artificial Intelligence
and Applied Computer Science
Free, downloadable from above site, versions forvarious OS
-
8/8/2019 ABS COURSE SLIDES
81/89
-
8/8/2019 ABS COURSE SLIDES
82/89
Repast
-
8/8/2019 ABS COURSE SLIDES
83/89
Repast
http://repast.sourceforge.net/
Originally from the University of Chicago, nowmaintained by a not-for-profit volunteer
organisation
Widely used for social simulation
Freely available, with full source, from above site
Repast
-
8/8/2019 ABS COURSE SLIDES
84/89
Repast
Provides classes to support simulation andanalysis
No development tools provided, but a library of
examples
Large and active user community
Easy to develop simulations within their scope;experienced Java programmers can do muchmore
-
8/8/2019 ABS COURSE SLIDES
85/89
JACK
-
8/8/2019 ABS COURSE SLIDES
86/89
JACK
http://www.agent-software.com/shared/products/index.html
Commercial and academic licences available;
60 day evaluation available from above site
Full commercial support and ongoingdevelopment and extensions
-
8/8/2019 ABS COURSE SLIDES
87/89
-
8/8/2019 ABS COURSE SLIDES
88/89
Wrap Up
-
8/8/2019 ABS COURSE SLIDES
89/89
Wrap Up
Agent-based simulation is a key area for agents
A number of open issues
Are you going to use ABS as a tool, or is ABS itselfthe focus of your research?
Contacts:
Emma Norling, [email protected]
Franziska Klgl,