Scaling AnyLogic Models for Mass Runs and Sub-Second Responses

More runs, more users, and more model. More and more is demanded of simulation models as clients analyze greater numbers of scenarios, expand user access, and model in greater detail. How to scale and meet these demands?

PwC emerging technology senior manager Sindy Ma is an expert on scaling simulations. Her presentation at the AnyLogic Conference 2021 showed three real-world case studies of projects that met the challenge of scaling simulations for more scenarios, more users, and more model.

This blog post summarizes the conference presentation Scaling AnyLogic Models for Mass Runs and Sub-Second Responses, gives an overview of three enterprise-scale simulations, and introduces the session and Q&A recording.

More runs – Office Modeling

After the pandemic, a company wanted to understand the impact of behavioral changes caused by home working policies. Specifically, the company wanted to assess the viability of reducing office space and to validate space design choices.

A model from before the pandemic provided a template for the post-pandemic use case and allowed the comparison of pre and post pandemic behavior profiles. The challenge for the model designers would be the number of simulations runs required by the client.

Despite a low user count of three to five domain specialists, the specification was for tens of thousands of simulation runs per day with an expectation for those numbers to increase. There was also the need to quickly run short batches for testing.

The simulation model designers first built and tested locally, making sure to avoid design decisions that would cost computing time. The model was then migrated to AnyLogic Private Cloud, which made it easier to iterate and serve to end users. The team also found this increased the user friendliness of the simulations.

High-level model schematic for office worker behaviour analysis showing input data connected to the model and a connection to a separate sever for output data and visualizations in Tableau.
High-level model schematic for office worker behaviour analysis. (Click to enlarge)

The solution allows for quick batch testing and for hundreds of thousands of runs overnight, fulfilling the requirements of the client.

More users – Financial Wellness

The modeling of life events to understand their impacts on financial decision making was the aim of a PwC client. The solution should integrate into a financial suite that is offered to hundreds of thousands of end users. It needed to be online 24/7 and have the capacity to run thousands of simultaneous simulations with sub-second result latency.

The simulation model designers created a stochastic and agent-based model to show the random events. The model was then hosted in the cloud and exposed via API with input and output managed using message streaming.

High-level model schematic for the financial wellness app that shows that the data store is connected to a model and a web app front end.
High-level model schematic for the financial wellness app. (Click to enlarge)

The solution provided sub-second latency thanks to extensive development of pipelines to manage data input and output. Also, thanks to the Java extensibility of AnyLogic, parts of the model were implemented as separate Java modules.

More model– Bodylogical

Health analysts wanted to unlock the potential of repositories of peer-reviewed biological and health data. Using the data, the analysts sought to estimate the future of biomarkers and to explore the impact of interactions of physiological systems on the emergence of chronic disease.

The solution was to create a digital twin of the human body. The digital twin would combine the modeling of individual biomarkers with physiological simulation. The simulation model for the digital twin needed to account for the characteristics of individual people and therefore needed to be highly parameterized.

High-level model schematic for the Bodylogical app that shows that the input data flows to a model and then to a web app front end.
High-level model schematic for the Bodylogical app. (Click to enlarge)

During development, the system was adapted for serving as a web app and an iOS mobile app. This meant the model needed to be online 24/7 and to scale the dynamic real-time use cases for large numbers of end users.

The result met the needs of the client and provides tailored results in less than five seconds for thousands of concurrent users.

Lessons for how to approach simulation model scaling

From the three case studies, Sindy Ma summarizes that, when needing to scale simulation models, the best results come from thinking about scaling from the beginning.

In PwC’s experience, simulations are often now part of larger projects that are made up of many different software elements. As a result, thanks to the need for integration and data handling, Java and Python skills are useful, along with the need for good code documentation.

AnyLogic Cloud helps integrate simulation models with larger systems by providing a platform for scaling simulation model runs, model management, and various connection opportunities with different APIs.

In the presentation, it was also noted that AnyLogic Cloud simplifies the provision of end solutions by separating modeling from other skillsets, such as for user interface development.

This insightful and enlightening presentation was given by PwC’s Sindy Ma at the AnyLogic Conference 2021 and was followed by a Q&A session. Here are the session slides and recording:



Related posts