simulation & multi-agent systems an introduction
TRANSCRIPT
Simulation & Multi-Agent SystemsAn Introduction
Multiagent Systems LSSistemi Multiagente LS
Andrea Omicini & Sara Montagna{andrea.omicini, sara.montagna}@unibo.it
Ingegneria DueAlma Mater Studiorum—Universita di Bologna a Cesena
Academic Year 2007/2008
SimulationMeaningMotivationApplication
Type of SimulationContinue vs. Discrete SimulationDeterministic vs. StochasticMicro, Macro and Multi-level Simulation
A MethodologyDomain, Design, Computational Model
Traditional Model and SimulationGraphs and NetworksDifferential Equations: ODE, PDE, Master EquationsCritical Analysis
Computational ModelAgent Based Model and Multi-agent based SimulationMulti-agent based simulation Platforms
Scientific Method
Traditional science workflow
I [Parisi, 2001]I Traditional scientific method
I identification of the phenomena of interestI direct observation of the phenomenaI formulation of theories / working hypothesisI reasoning on theories and phenomena through an empirical
observationI quantitative analysis: measuring of phenomena in laboratory
under controlled conditionsI validation / invalidation of theories
Definition of Simulation
I A new way for describing scientific theories
[Parisi, 2001]
I Simulation is the process with which we can study thedynamic evolution of a model system, usually throughcomputational tools
[Banks, 1999]
I Simulation is the imitation of the operation of a real-worldprocess or system over time
Simulation Requires a Model
M. Minsky – Models, Minds, Machines
A model (M) for a system (S), and an experiment (E) is anythingto which E can be applied in order to answer questions about S.
I A model is a representation / abstraction of an actual system
I A model is a formalisation of aspects of a real process thataims to precisely and usefully describe that real process
I A model involves aggregation, simplification and omission
I The model implements theories which have to be verifiedduring the simulation
Typical questions in model construction
I How complex should be the model?
I Which assumptions should be done?
From Model to Simulation. . .
Computer simulation
I The models are designed to be run as processes within acomputer
I The computational model simulates the processes as they arethought to exist in the real system
I Subsequent simulations imitate the operations of the modelledprocess
I generation of an artificial evolution of the system
I The observation of the evolution carries out deductions on theactual dynamics of the real system represented
I Simulation results make it possible to evaluate theoriesconstructing the model
. . . and Back
Model validation [Klugl and Norling, 2006]
I If the predicted and observed behaviour do not match, andthe experimental data is considered reliable, the model mustbe revised
Simulation Creates a Virtual Laboratory
I A virtual laboratory makes it possible to perform experimentsI virtual phenomena observed under controlled conditionsI possibility to easily modify the components of an experiment
(variables, parameters, simulations’ part)I tools to make predictions on theoriesI tools to make inferences on simulation results
Why Do We Need Simulations?
I [Parisi, 2001],[Klugl and Norling, 2006]I The simulated system cannot actually be observed
I for either ethical or practical reasons
I The time scale of the real system is too small or too large forobservation
I The original system is not existing anymore or not yetI The system is complex
I simple pattern of repeated individual action can lead toextremely complex overall behaviour
I impossible to predict a-priori the evolution of the system
What Simulations Are Used For?
I Making prediction (look into the future) to be tested byexperiments
I Exploring questions that are not amenable to experimentalinquiry
I Obtaining a better understanding of some features of thesystem
I Describing and analysing the behaviour of a system, asking“what if” questions about real system
I rapidly analysing the effects of manipulating experimentalconditions without having to perform complex experiments
I Potentially assisting in discovery and formalisation
I Verifying hypothesis and theories underlying the model thattry to explain the systems behaviour
A Science for Simulation
Popper (1972)
Popper proposes as a logical necessity that scientific theories canonly be refuted
I no amount of supporting experimental evidence constitutesproof of a theory
I yet a single repeatable piece of counter-evidence can requirethat the theory is developed or replaced
Scientific hypothesis should consist only of refutable statements
Simulation can be used as a tool to validate, or better, potentiallyrefute formal models
Applications of Simulation
Main applicative domains
I Interdisciplinary domainI Complex Dynamical Systems
I systems too complex to be understood from observations andexperiments alone
I Predicting changes
I Observing systems evolution
A Brief Introduction to Complex Systems
Systems as
I Brain
I Social Systems
I Ecosystems
I Economic Systems
I Coordinating Systems (swarm, flocking)
I . . .
. . . are recognised as complex systems
A Brief Introduction to Complex Systems
A multi-disciplinary research field
I Maths
I Physics
I Informatics
I Biology
I Economy
I Philosophy
I . . .
Features of Complex Systems in a Nutshell
In general, complex systems are observed to feature
I Presence of different elements that interact
I Nonlinear dynamics
I Presence of positive and negative feed-backs
I Ability of evolution and adaptation
I Robustness
I Self-organisation
Complex Systems ask for Holistic Approach: Simulation
I ReductionismI belief that the behavior of a whole or system is completely
determined by the behavior of its partsI if the laws governing the behavior of the parts are known, one
should be able to deduce the laws governing the behavior ofthe whole.
I Holism – Systems theoryI anti-reductionist stance: the whole is more than the sum of
the partsI the whole has “emergent properties” which cannot be reduced
to properties of the parts
Continue Simulation
I [Uhrmacher et al., 2005]
I The variables of the system change continuously during time
I Series of infinite intervals and states
Main example of continue simulation
I Time-changes described by a set of differential equations
Critical Analysis of Continuos Simulation
Benefits
I Perfectly suited for the reproduction of measuredtime-dependent trajectories
I Easily fitting of the parameters
Drawbacks
I the underlying assumption is that the system behavescontinuously with an infinite number of close state transitionsin each time interval
Discrete Simulation
I [Uhrmacher et al., 2005]
I Time evolves through discrete time steps
I The number of states is finiteI Synchronous or Asynchronous simulation update
I synchronous — the state of all the components of the systemis updated at the same time
I asynchronous — the state of the system components isupdated asynchronously following predefined rules whichdepends on the components themselves
Main example of discrete simulation
I Discrete time stepped approaches: time advances inequidistant steps time-driven simulation. Clock advances byone tick in every step and all the events scheduled at thattime are simulated
I Discrete event approaches: discrete event simulation
Discrete Events Simulation – Event Driven Simulation
Algorithm of a discrete event simulation
I clock: this variable holds the time up to which the physicalsystem has been simulated
I event list: this is normally a data structure that maintains aset of messages, with their associated time of transmissions,that are scheduled for the future
I at each step the message with the smallest associated futuretime is removed from the event list the event list and thecorresponding message is simulated
I the list of the events is updated:I adding new messages for future eventsI canceling previously scheduled messages
I the clock is advanced to the time of the event just simulated.
Critical Analysis of Discrete Models
Benefits
I No continuity of behaviour needs to be assumed
Drawbacks
I Sequential SimulationI in each cycle of simulation only one item is removed from the
event list, its effects simulated and the event list, possibly,updated.
I the algorithm cannot be readily adapted for concurrentexecution on a number of processors, since the list cannot beeffectively partitioned for such execution.
Deterministic vs. Stochastic
Deterministic
I The simulation evolves following deterministic laws
Stochastic
I The variables are probability distribution, or the laws toupdate the variables are stochastic laws
I Stochastic processes represent one means to express theuncertainty of our knowledge
I It is possible to compute just a probability distribution of thefuture histories, rather then a single outcome
Granularity of Simulation Elements: Macro-simulation
I [Uhrmacher et al., 2005]
I The macro model describes the system as one entity
I The model attempts to simulate changes in the averagedcharacteristics of the whole population
I Variables and their interdependencies, which can be expressedas rules, equations, constraints... are attributed to this entity
I Modelling, simulating and observation happens on one level:the global level
I The characteristic of a population are averaged together
Main example of macro-simulation
I Differential equations
Granularity of Simulation Elements: Micro-simulation
I The micro model describes the system as a set of entitiesI Smaller entities with distinct state and behaviourI The system is thought as comprising huge numbers of entities
I The micro level models the behaviour of the individualsI The macro level
I exists only as it aggregates results of the activities at microlevel
I is used for reflecting emergent phenomena
Main example of micro-simulation
I Cellular automata
Granularity of Simulation Elements: Multi-level Simulation
I It is an intermediate form
I The multi-level model describes a system at least at twodifferent levels
I Interactions are taking place within and between the differentlevels
I The system is described at different time scales
Main example of multi-level simulation
I Multi-agent systems
Advantages of Multi-level simulation
I It facilitates taking spatial and temporal structured processesinto consideration
I It allows the description of upward and downward causation
Down-ward and Up-Word Causation
The whole is to some degree constrained by the parts (upwardcausation), but at the same time the parts are to some degreeconstrained by the whole (downward causation).1
1F. Heylighen. http://pespmc1.vub.ac.be/DOWNCAUS.html
How To Choose Between Different Approaches
Which kind of simulation?
I Modelling and simulating approaches are chosen on demandand thus address the diverse neeeds of modelling andsimulation of the systems
I Multi-level simulation is considered the most suitableapproach for studying complex systems
Simulation Workflow
Main steps in a simulation study
I [Klugl and Norling, 2006]I Starting with a real system analysis
I understanding its characteristics
I Building a model from the real systemI retaining aspects relevant to simulationI discarding aspects irrelevant to simulation
I Constructing a simulation of the model that can be executedon a computer
I Analysing simulation outputs
How to Build a Model: Methodology
Model design
I Concept model phase – Domain modelI Analysis of the real system characteristic
I Specification phase – Design modelI translation of the information from the needs’ into a formal
modelI aim: build a model independent of any tool and any software
platform
I Implementation phase – Computational modelI translation of the model resulting from the design on a
particular software platform
How to Perform a Simulation: Methodology
Experimentation phase – Simulation design
I Specifying the simulation goals
I Identifying of the informations needed to the simulation
I Identifying useful experiments.
I Planning a list of experiments
I Performing the experiments
Validation and Verification
I Analyse simulation resultsI Detailed behaviours of computer-executable models are first
compared with experimental observationI Comparing the predictions with the observed experimental
data gives an indication of the adequacy of the model
Graphs
Graphs as models of system network’s structure
I Static representation of pairwise relations between objects of thesystem
I nodes or vertices: entities of thesystem
I edges that connect pairs ofvertices: interaction betweenentities
Features
I Static model
I Micro-model
Graph Theory
Topology of a graph
I Analysis of structural properties of a network
Topological features of an N-nodes network
I The degree of a node i is the number of its connections (orneighbors), ki
I The average degree of a network is
〈k〈 =1
N
∑i
ki
I The degree distribution function P(k) which measures theproportion of nodes in the network having degree k
Graph Types
Random graph
I The vertices typically have 〈k〉 edges and the vertices havingsignificantly more or less edges than 〈k〉 are extremely rare
Scale-free graph
I These types of graphs are inhomogeneous, in that most of thevertices have few edges, whereas some vertices, called (hubs),have many edges
Hierarchical graphs
I These types of graphs describes modular networks, i.e. theyare formed by the repetition of nodes’ cluster.
Boolean Networks
I Introduced by Stuart Kaufmann asa model of gene regulationnetworks
I Directed graph with N nodes
I Nodes ↔ Boolean Function
I Node state: value of the booleanfunction (binary state)
Features
I Discrete synchronous model
I Deterministic model
I Micro-model
Boolean Network Dynamic
An example
t t + 1x1 x2 x3 x1 x2 x3
0 0 0 0 0 00 0 1 0 1 00 1 0 0 0 10 1 1 1 1 11 0 0 0 1 11 0 1 0 1 11 1 0 0 1 11 1 1 1 1 1
Differential Equations
I System described by a set of state variablesI Different types of differential equations:
I ODE: how do they vary in timeI PDE: how do they vary in time and spaceI SDE: which is the probability that the variable has a certain
value
I Time-dependent variables are assigned to different measuringor not-measurable quantities of the system
I The continuous state changes are modelled by a sum of ratesdescribing the increase and decrease of quantities amounts.
Features
I Continuos modelI Deterministic or Stochastic ModelI Macro model
An example of ODE
I The state variable is referenced as Xi which is a macroscopiccollective variable
I The collection of values of all these state variables{X1,X2, ...,Xn} denote a complete set of variables to definethe instantaneous state of the system X
I The time evolution of Xi (t) will take the form, through amathematical expression (ODE):
dXi
dt= Fi (X1,X2, ...,Xn; γ1, γ2, ..., γm)
I where:I Fi may be a complex function of the state variables: the
structure of the function Fi will depend in a very specific wayon the system considered
I γ1, γ2, ..., γm, are the parameters of the problem (controlparameters)
Simulation of Differential Equations Models
Analytical solution of differential equations
I Exact solution of a class of differential equationsI It is possible under very special circumstances
I i.e. when the function Fi is linear
I Example of analytic solution:I the solution of a set of ODEs in terms of exponential
functions, exp(λi t), and harmonic functions, sin(ωi t + φi )
Simulation of Differential Equations Models
Numerical solution of differential equations
I Also called numerical integration
I The exact solution of the equations is approximated bycalculating approximate values {X1,X2, ...,Xn} for X
I Time step is reduced to arbitrary small discrete intervals:values at consecutive time-points t0, t1, ..., tm
I It uses different numerical algorithms:I Euler’s method for ODEsI Taylor series method for ODEsI Runge-Kutta methodI Runge-Kutta-Fehlberg methodI Adams-Bashforth-Moulton methodI Finite Difference method for PDEsI . . .
Simulation of Differential Equations Models
Qualitative solution of differential equations
I It answer qualitative questions such as:I what will the system do for t →∞I under which condition the system is stable
I Definition of system attractorsI equilibrium pointsI limit cyclesI strange attractors
I Bifurcation analysisI how the system’s dynamic (solution) changes under the change
of its parameters
Modelling a Complex System
To remind you. . .
I Important features of a complex systemsI systems that draw their dynamics from flexible local
interactionsI systems where individuality and/or locality is importantI systems with a strong hierarchical organisationI emergent Phenomena and Self-organizing systemsI down-ward and up-ward systems dynamics
I Remind them if you wish to model a complex system
I They are important for analysing and choosing modellingapproaches and tools
Analysis of Differential Equations I
Advantages of ODE and PDE
I They are a really well understood and established framework
I They are relatively simple
I They have a strong formal aspect
I Where do differential equations fail?
Are they able to capture complex systems features?
Analysis of Differential Equations II
Tod-down approaches – Macro model
I The model is built upon the imposition of global laws
I The model loses the representation of the actors of the system
I Focusing only on the population, the model loses therepresentation of the individual and of its locality
I The model doesn’t allow the study of global dynamics asemergent phenomena from local interaction
I The model ignores the local processes performed by low-levelcomponents
I A particular entity is no longer accessible
Analysis of Networks
Are they able to capture complex systems features?
Bottom up approaches – Micro model
I The model is built upon the identification of systems entitiesand of the interactions between them
I The model does not allow the representation of autonomousbehaviour of the components
I The behaviour of the entire system dynamically emerges fromthe interactions between its parts
What is ABM
MAS provide designers and developers with...
I Agents...a way of structuring a model around autonomous andcommunicative etities
I Society...a way of representing a group of entities whose behaviouremerges from the interaction among elements
I Environment...a way of modelling the environment
MAS give methods to. . .
I Model individual structures and behaviours of different entities
I Model local interactions between entities
I Model the environment structures and dynamics
An Agent in ABM
Properties of agents in ABM
I Autonomous
I Heterogeneous
I Articulated internal structure
I Possibly adaptive, intelligent, mobile, . . .
An Agent in ABM
Defining the agents of an ABM
I Sensors & effectorsI Internal autonomous behaviour
I reactive behaviour: it defines how an agent reacts to externalstimuli
I proactive behaviour: it defines how an agent behaves in orderto reach its goals/tasks
I State
Environment in ABM
Defining the environment of an ABM
I Topology definition
I Complex internal dynamics
The agents can interact with the environment
What is ABM
Execute an ABM
I Running an ABMI Study its evolution
I observing individual and environment evolutionI observing global system properties as emergent properties from
agent-environment and inter-agent interactionI making in-silico experiment
Advantages of ABM
I When flexible conditional or even adaptive individualbehaviour has to be formulated
I When interactions with flexible individual participants have tobe represented
I When inhomogeneous space is relevantI When the simulation consists in mutable interacting
participantsI agents can be erasedI new agents can enter in the scenario
Problems of ABM
I There exists neither an unified formal framework for ABM nora widely accepted methodology for developing MABS
I Poor of formal definition of the modelling elements and rules
I Lack of conceptual language
I Increased amounts of parametersI Software development remains a significant barrier to the use
of ABMI there is a serious inconsistence and incongruence between
agents of the conceptual model and agents of thecomputational model
ABM and MABS Methodology in a Figure
Simulation Platform Issues
Standard issues [Railsback et al., 2006]
I Model structureI Discrete event simulation
I Scheduling: to control which specific actions are executed andwhen (in simulated time)
I Marsenne Twister: random number generation
I Distributed simulation
Swarm2
Swarm
I ObjectivesI to ensure a widespread use across scientific domainsI to implement a modelI to provide a virtual laboratory for observing and conducting
experiments
I Swarm is implemented in Objective-C
2http://www.swarm.org/
Repast3
Repast
I ObjectivesI to implement Swarm in JavaI to support the specific domain of social science (it includes
specific tools to that domain)I to make it easier for inexperienced users to build models
3http://repast.sourceforge.net/
MASON
MASON
I ObjectivesI models with many agents executed over many iterationsI to maximize execution speedI to assure complete reproducibility across hardwareI to detach or attach graphical interfacesI to be not domain specific
I Basic capabilities for graphing and random numberdistributions
NetLogo
I ObjectivesI to be ease of use
I Educational toolI NetLogo is recommended for models
I with short-term, local, interactions of agentsI base on grid environmentI not extremely complex
I Useful for prototyping models (quickly) and exploring designdecisions
I Provided by an own programming languageI high level structures and primitivesI all code in the same file
What do Existing Simulation Frameworks Miss?
I Incoherence between the design model and the computationalmodel
I computational agents 6= conceptual agentsI No first class abstraction for modelling the environment
ABM e MABS for Biological Systems
Modelling and simulating hematopoietic stem cells
I Cell is modelled as an agentI agent’s sensors are the cell’s membrane proteinsI agent’s state is defined as the gene expression levelI agent’s reactive behaviour models the signalling transduction
pathwaysI agent’s proactive behaviour models the gene regulation
networks
I Cell’s micro-environement is modelled as agents environmentI Cell’s interaction
I direct interaction is modelled as agent-agent communicationI indirect interaction is modelled through the liberation in the
environment of molecules
I [Montagna et al., 2007]
Bibliography I
Banks, J. (1999).Introduction to simulation.In Farrington, P., Nembhard, H. B., Sturrock, D. T., andEvans, G. W., editors, Proceedings of the 1999 WinterSimulation Conference, pages 7–13.
Klugl, F. and Norling, E. (2006).Agent-based simulation: Social science simulation and beyond.
Technical report, The Eighth European Agent SystemsSummer School (EASSS 2006), Annecy.
Bibliography II
Montagna, S., Omicini, A., Ricci, A., and d’Inverno, M.(2007).Modelling hematopoietic stem cell behaviour: An approachbased on multi-agent systems.In Allgower, F. and Reuss, M., editors, 2nd Conference“Foundations of Systems Biology in Engineering” (FOSBE2007), pages 243–248, Stuttgart, Germany. Fraunhofer IBRVerlag.
Parisi, D. (2001).Simulazioni - La realta rifatta al computer.Societa editrice il Mulino.
Railsback, S. F., Lytinen, S. L., and Jackson, S. K. (2006).Agent-based simulation platforms: Review and developmentrecommendations.Simulation, 82(9):609–623.
Bibliography III
Uhrmacher, A. M., Degenring, D., and Zeigler, B. (2005).Discrete Event Multi-level Models for Systems Biology.In Priami, C., editor, Principles of Organization in Organisms:Proceedings of the Workshop on Principles of Organization inOrganisms, volume 3380 of Lecture Notes in ComputerScience, pages 66–89. Springer.
Simulation & Multi-Agent SystemsAn Introduction
Multiagent Systems LSSistemi Multiagente LS
Andrea Omicini & Sara Montagna{andrea.omicini, sara.montagna}@unibo.it
Ingegneria DueAlma Mater Studiorum—Universita di Bologna a Cesena
Academic Year 2007/2008