Abstract
Agent-based social simulation (ABSS) is a powerful tool for creating digital twins of societies, yet it often suffers from computational inefficiency. We introduce Clockwork, a hybrid framework that integrates behavior-level autonomous agent scheduling with a Discrete Event Simulator (DES). This approach enables high-fidelity modeling of individual agent histories and social interactions while maintaining population-level statistical distributions. We demonstrate Clockwork's efficacy through a real-world worksite case study focused on COVID-19 mitigation policies.
Introduction
Social simulations typically force a choice between the rich, autonomous behavior of Agent-Based Social Simulations (ABSS) and the computational speed of Discrete Event Simulations (DES). ABSS models "active" agents with complex motives but is often slowed by continuous-time "ticking." Conversely, DES is fast by skipping empty time but treats agents as "passive" entities. Clockwork bridges this gap, providing a scalable "digital twin" framework that preserves agent autonomy.
Methodology: The Hybrid ABSS-DES Architecture
Clockwork splits the simulation into two specialized engines to optimize both intelligence and logistics:
- ABSS Engine: Manages agent "intelligence" through motives (e.g., hunger, social needs) and a Reactive Planner. Agents use Basic Reactive Plans (BRP) defined by
<priority, precondition, action>triplets, allowing for dynamic responses to environmental triggers. - DES Engine: Built on the Python
SimPyframework, this engine handles the simulation clock and resource management (e.g., elevator queues). By using event-based ticking, the system only processes time when state-changing events occur, drastically reducing CPU load. - Environment Modeling: The physical space is represented as a location graph of nodes (offices, cafes) and edges (corridors), enabling precise movement tracking without the overhead of 3D physics.
Case Study: COVID-19 Mitigation at a Real-World Worksite
To evaluate the framework, we modeled a digital twin of a real-world worksite using a floor plan mapped into over 400 nodes.
The simulation utilized CDC data to define probabilistic distributions for infection and immunity. We simulated a synthetic population of 125 agents over an 868-day period to test various policies, such as masking mandates and office layout changes.
Results and Discussion
Clockwork demonstrated a significant performance leap, completing the case study in 1 minute and 12 seconds—a task that took traditional planning-based simulations over an hour.
Key insights included:
- Layout Impact: In an open-office plan, 100% masking still resulted in a 75% infection rate during the Omicron peak. However, shifting groups into private rooms increased the uninfected population to 50%.
- Explainable Emergence: Each agent maintains a "journal" of decisions, allowing researchers to trace macro-level outcomes (like the heat map shown above) back to specific individual interactions. This granularity allows for rapid "what-if" testing of corporate policies.
Conclusion
Clockwork successfully scales social simulations without sacrificing agent autonomy. By treating "empty time" as a single event rather than multiple ticks, the framework unlocks massive performance gains. Future work will expand the framework to broader contexts, including hurricane evacuations and the spread of disinformation, while further integrating with other social simulation engines.
Summary updated