Agent-Based Modelling and Simulations Agent-Based Modelling Agostino Poggi Complex Systems ♦ Is a highly structured system, which shows structure with variations ♦ Its evolution is very sensitive to initial conditions or to small perturbations Number of independent interacting components is large There are multiple pathways by which the system can evolve ♦ Is difficult to understand and verify by design or function or both ♦ There are multiple interactions between many different components ♦ Constantly evolves over time Prof. Agostino Poggi Agent-Based Modelling University of Parma - 2 Numeric Simulation Limits ♦ Equational models have a large number of parameters ♦ Different theories must be used in biology, sociology, economy, ... ♦ Difficulty of the micro/macro transition and difficulty to represent different levels ♦ No representation of the behaviors, but only their overall result (e.g., number of individuals, amount of food, …) ♦ Doesn’t account for the emergence of spatial and time structures (e.g. fish schools or flocks of birds, columns of ants, ...) Prof. Agostino Poggi Agent-Based Modelling University of Parma - 3 Agent-Based Modelling ♦ Is an approach to modeling systems based on autonomous and interacting agents ♦ Is a bottom-up process ♦ Defines emergent phenomena from microbehaviors ♦ Supports both optimization models and investigation of a dynamic process ♦ Succeeds where centralized planning and optimization models fail Prof. Agostino Poggi Agent-Based Modelling University of Parma - 4 Modeling Objectives (1/2) ♦ To understand some systems In detail (quantitatively) Qualitatively (the relationships between variables of interest) To sharpen our intuitions ♦ To forecast or backcast some systems Behaviors of participants in the system System states (micro, meso or macro-level) ♦ To support intervention in some systems To advise participants on their strategies To advise owners (e.g., policy-makers) on their management Prof. Agostino Poggi Agent-Based Modelling University of Parma - 5 Modeling Objectives (2/2) ♦ To create some reality (i.e., models) Black-Scholes options-pricing theory Game theory for nuclear weapons doctrines … ♦ To enable co-ordination between stakeholders (i.e., models as co-ordination artefacts) Forecasting models in hedge funds Corporate strategy modeling Large-scale public policy modeling (national macroeconomic models, models of climate change, communicable disease models) … Prof. Agostino Poggi Agent-Based Modelling University of Parma - 6 Agent Types Prof. Agostino Poggi Agent-Based Modelling University of Parma - 7 Agent Schools ♦ Artificial intelligence Agents as autonomous entities solving problems ♦ Multi-agent systems Distributed control of systems ♦ Agent-based modeling (and simulation) Simulating (real world) phenomena Prof. Agostino Poggi Agent-Based Modelling University of Parma - 8 Agent Features ♦ Encapsulated Clearly identifiable, with well-defined boundaries and interfaces ♦ Situated in a particular environment Receives input through sensors and acts through effectors ♦ Capable of flexible action Responds to changes and acts in anticipation ♦ Autonomous Has control both over its internal state and over own behavior, reacts to environmental change and proactively changes its behavior ♦ Designed to meet objectives Attempts to fulfill a purpose, solve a problem, or achieve goals Prof. Agostino Poggi Agent-Based Modelling University of Parma - 9 Agent Model (1/2) ♦ An agent is a persistent thing which has some state and which interacts with other agents, mutually modifying each other’s states ♦ The components of an agent-based model are A collection of agents and their states Rules governing the interactions of the agents Environment within which they live ♦ Interaction among agents is the central point of the simulation Prof. Agostino Poggi Agent-Based Modelling University of Parma - 10 Agent Model (2/2) Prof. Agostino Poggi Agent-Based Modelling University of Parma - 11 Environment Prof. Agostino Poggi Agent-Based Modelling University of Parma - 12 Agent Interaction Prof. Agostino Poggi Agent-Based Modelling University of Parma - 13 Behavior Ingredients ♦ Rule based Nested if-then-else structures ♦ Multi criteria decision making Options and weights ♦ Inference engines Expert systems, facts (states) and decision heuristics ♦ Machine learning Neural networks, deep learning, Bayesian statistics and pattern recognition ♦ Evolutionary computing Find a optimal solution in large solution space (genetic algorithms) Prof. Agostino Poggi Agent-Based Modelling University of Parma - 14 Simulation ♦ Agent models are used as substitutes for another system ♦ Simulations mostly use virtual time ♦ Agents live a in a simulated environment Social space Virtual 2D/3D space ♦ Time and environment are controllable by the modeler Prof. Agostino Poggi Agent-Based Modelling University of Parma - 15 Time ♦ Simulations take place in discrete time ♦ Time progresses in ticks ♦ Between two ticks, everything is assumed to happen in the same time, attempting to simulate the parallelism in real world ♦ As computers are serial processing machines, the order of iterations among agents is very important Prof. Agostino Poggi Agent-Based Modelling University of Parma - 16 Behavior Vs Goal Oriented Models ♦ Behavior-oriented modeling Agents are described by modeling their behaviors ♦ Goal-oriented modeling Agents are capable of planning and the modeler described their goal ♦ Choice of modeling strategy strongly depends on application context Prof. Agostino Poggi Agent-Based Modelling University of Parma - 17 Behavior Oriented Models ♦ Modeler describes agent status and dynamics ♦ Examples of formalisms are activity graphs, crisp/fuzzy rules, constraints, ... ♦ Reactions to perceptions/status changes are defined by the modeler ♦ Can easily accommodate reinforcement learning and evolutionary concepts ♦ Agents’ goal(s) are treated implicitly ♦ Very intuitive mapping with simple biological systems (e.g., insects) Prof. Agostino Poggi Agent-Based Modelling University of Parma - 18 Goal Oriented Models ♦ Modeler identifies goals of the agents ♦ Agents select a goal and execute actions as a consequence ♦ Reactions are not predefined, but goal dependent ♦ Explicit treatment of goals in the agent behavior, but Execution of goal dependent actions can be error-prone Leads to significantly more complex model (see BeliefDesire-Intention agent models) Prof. Agostino Poggi Agent-Based Modelling University of Parma - 19 Development & Use Prof. Agostino Poggi Agent-Based Modelling University of Parma - 20 Advantages ♦ Allows appropriate modeling capabilities in a number of important disciplines Social science, biology, software development, … ♦ Allows to simulate systems that are particularly difficult to treat with traditional approaches Emergent phenomena, models with variable structure ♦ Can afford more detail in models More realism and micro-validity ♦ Provides an intuitive way of modeling Facilitates communication with other fields and enables more researchers to use simulation Prof. Agostino Poggi Agent-Based Modelling University of Parma - 21 Applicability (1/2) ♦ When there are decisions and behaviors that can be well-defined ♦ When it is important that agents adapt and change their behaviors ♦ When it is important that agents have a dynamic relationship with other agents, and agent relationships form, change and decay ♦ When it is important that agents form organizations and when adaptation and learning are important at the organization level Prof. Agostino Poggi Agent-Based Modelling University of Parma - 22 Applicability (2/2) ♦ When it is important that agents have a spatial component to their behaviors and interactions ♦ When the past is no predictor of the future because the processes of growth and changes are dynamic ♦ When scale-up to arbitrary levels is important ♦ When process structural change needs to be an endogenous result of the model, rather than an input to the model Prof. Agostino Poggi Agent-Based Modelling University of Parma - 23 Agent Simulation Vs Macro Simulation (1/3) Prof. Agostino Poggi Agent-Based Modelling University of Parma - 24 Agent Simulation Vs Macro Simulation (2/3) Can deal with multi-agent Differential equations are systems directly because real a well understood, agent are represented by established mathematical simulated agent framework Facilitates structural validation Elegant treatment of variable structures Easy to document Allows to model adaptation and evolution Easy to model heterogeneous space and population Low number of parameters, global input Provides different levels of output behavior observation Prof. Agostino Poggi Agent-Based Modelling University of Parma - 25 Agent Simulation Vs Macro Simulation (3/3) Development of complex Assumes homogeneous models can be very costly space and population Difficult to determine minimal model Established formalism is No representation of the missing, difficult to individual and its locality, i.e., document no conditional behavior, no Calibration problem, i.e., is adaptive behavior, no flexible difficult to find the best interaction parameter setting for a model (given a structurally valid model) Sensitivity problem, i.e., Can only observe the system even small changes may as a whole, not its parts have a large effect Prof. Agostino Poggi Agent-Based Modelling University of Parma - 26 Applications Business and Organization Society and Culture Manufacturing operations Ancient civilizations Supply chains Civil disobedience Consumer markets Social determinant of terrorism Insurance industry Organizational networks Economics Military Artificial financial markets Command and control Trade networks Force on force Infrastructure Biology Electric power markets Population dynamics Transportation Ecological networks Hydrogen infrastructure Animal group behavior Crowds Cell behavior and sub-cell processes Pedestrian movement Evacuation modelling Prof. Agostino Poggi Entertainment Movies and games Agent-Based Modelling University of Parma - 27 Software (1/2) AgentSheets AndroMeta AnyLogic Ascape Breve Cormas DEVS EcoLab FLAME JAS Prof. Agostino Poggi LSD MAML MATSim MASON MASS MetaABM MIMOSE MobiDyc Modelling4all NetLogo Agent-Based Modelling RePast Repast Simphony SimPack SimPy SOARS StarLogo SugarScape Swarm VisualBots Xholon University of Parma - 28 Software (2/2) Prof. Agostino Poggi Agent-Based Modelling University of Parma - 29