PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Challenges and Pitfalls
PD Dr. Stefan Bosse
sbosse@uni-bremen.de
University of Bremen, Dept. Mathematics and Computer Science, Bremen, Germany
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Agent-based systems are inherently distributed and parallel by a distributed memory model!
Agents are loosely coupled - a precondition for parallelisation
But agent-based simulation is often characterised by a shared memory model and tight coupling of agents!
This work investigates architectures and methods for parallel and distributed large-scale agent-based simulations
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Simulation of large-scale socio-technical systems (like in the Smart City context) is a challenge due to high number of entities and complex dynamic interaction networks
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
The agent behaviour consists of:
Computation (only modifying internal agent state);
Communication (with other agents and the environment);
Actions (modifying the state of other agents or the environment).
The most important parts addressed in this work are communication and interaction of agents.
Computation is always decoupled from other processing units and can be parallelised without any limiting constraints.
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
There are two main agent classes:
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
(Left) Physical agents bound to a body (vehicle, human, building, ..) (Right) Computational agents processed by a virtual machine (Beha) Behaviour (Comp) Computation
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
In this work mobile reactive state-based agents are considered,
The agent behaviour is represented by an Activity-Transition Graph and code consists of:
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
The reactive agents can perform the following actions (inside activities):
Computation (using body variables, only);
Communication (using Tuple spaces and signals);
Agent Control (creating, forking, and killing of agents);
Agent Modification (code morphing, modifying the ATG);
Migration (mobility by process snapshot transfer between JAM platforms).
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
A reactive state-based ATG agent and its memory model: Non-shared registers (body variables), shared platform data base (Tuple space), temporarily shared-by-copy messages (signals)
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Physical agents are bound to a body, which is associated with a visual shape in simulation with a changing spatial position
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Well known simulation model using physical agents: NetLogo
In this work a simulator based on the JAM platform is used (already existing, just the starting point)
Physical agents in this simulation world consist of:
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
In contrast to computational agents that only interact with eachother by using tuple spaces and signals, physical agents in simulation can access and modify other agents by a spatial search and a shared memory model with a NetLogo compatible API!
SEJAM: Simulation Environment for JAM binding phyiscal agents to virtualised JAM nodes with a spatial position in the simulation world (dynamic); one JAM is processed by node.js and one process
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Problem Classes
Communication Classes
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Communication is synchronisation among parallel processes that is temporal sequentialisation of parallel processing!
Simulation of limitation of parallel speed-up in presence of η% communication fraction → friction (fully connected N:N graph network)
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Spatial partitioning of a simulation world with parallel simulation instances with communication
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Pitfall: Remote Procedure Call Communication
Regions and simulation instances communicate via socket-based RPC
Advantage: Suitable for distributed and parallel computation
Spatial search, monitoring, and physical agent modification result in high communication overhead and costs
Speed-up < 1!
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Parallel Partitioning of CA regions with communication stripes → Shared Memory Backing Store
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Cells have clearly limited communciation ranges ⇒ Well suited for parallelisation with low communication overhead ⇒ High speed-up can be expected!
The shared memory backing store is used for boundary cell region communication and to monitor cell states (globally by the simulation control)
All cell regions are controlled and stepped by one global clock.
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Generic agents feature unlimited communication ranges with an arbitrary number of communication partners ⇒ High communication overhead, lowering speed-up of parallelisation...
Generic agents have commonly complex states (dynamic variables) limiting the deployment of shared memory
But physical agents will typically interact only with agents within a bounded spatial range.
Spatial partitioning of the simulation world and parallel processing of independent simulation instances is possible.
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Concept and Architecture
Data structures are implemented in the SSM by object wrappers (object monitors) performing buffer operations (bobjects)
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Parallel Region Partitionining architecture with Structured Shared Memory (SSM) and process signal communication
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Communication
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Example segmentation of a traffic simulation world (art. city with streets, signals, and vehicle agents) that is partitioned into four regions, each associated to a JAM node (DOM: Distributed Shared Object Manager), connected by SSM
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
{ x:1, // globally readable y:2, z:3, // locally accessible export : { x:'int', y:'int' }, // mapped in SSM act : { .. }, trans : { .. },}
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Results of the evaluation of the parallel traffic simulation. (a) Measured speed-up with respect to number of regions/pJAM nodes (b) Scaling of computation time with respect to agents/region with 6 pJAM regions (summarising all nodes and 10000 simulation steps)
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Parallel Simulation of large-scale Multi-agent Systems is a challenge
Agents originally feature isolated distributed memory
- Well suited for parallel processing
But agents in simulation have typically a shared data space overlay
- Showstopper
Communication (especially message based) reduces speed-up significantly
- Depends on use-case
A Structured Shared Memory model and spatial region partitioning were introduced to enable scalable parallel simulation
PD Stefan Bosse - Parallel and Distributed Agent-based Simulation
Parallel and Distributed Agent-based Simulation of large-scale socio-technical Systems with loosely coupled Virtual Machines
Challenges and Pitfalls
PD Dr. Stefan Bosse
sbosse@uni-bremen.de, www.ag-0.de
University of Bremen, Dept. Mathematics and Computer Science, Bremen, Germany