Simudyne - The right tool for serious simulation models

Simudyne - The right tool for serious simulation models

Sometimes, the stars align just right… Recently, a large global corporation reached out and asked me:

Ben, we have this FlexSim model of our high-speed manufacturing floor. It is great, but too slow for our purposes. Would AnyLogic be faster?

At the time, I was too busy to really dig in but a quick AnyLogic toy model looked promising. But the stars had more in store…

About 2 weeks later, I had an unrelated call with Justin Lyon, the CEO of Simudyne:

Hi Ben, we are looking to expand our ultra-performant Simudyne ABM-tool into new application areas such as manufacturing. Would you like to explore this a bit?

My brain cells started working. This would not be just “win-win”. This would be a win-win-win:

  1. I can finally explore a cool tool I always wanted to get my hands dirty with
  2. We could have a third tool comparison for the high-speed manufacturing case
  3. Simudyne would gain a new case study in a new application area

Overview

In this post, I want to share my experience along this journey. (I will publish another post where I go deeper into the manufacturing model I built).

Disclaimer

Simudyne paid for 5 days of my time. While this may, obviously, taint my experience, I will try to be as neutral as I can. The goal of the Simudyne investment is to educate others about when to use the tool, not to praise it as the be-all-end-all solution.

We will explore

  • What Simudyne is and how it “ticks” (there is a pun here, wait for it)
  • when to use it
  • when not to use it
  • advantages and disadvantages
  • how to best learn it

Let’s dig in…

What is Simudyne

Simudyne is a tool for ultra-large agent-based simulation models (ABMs). It is being used for typical use-cases in finance, economics and environmental sciences. Typical Simudyne models have hundreds of thousands of agents, often even millions. The underlying architecture is streamlined for efficiency, applying parallelized message passing and many other distributed techniques to speed up models.

No alt text provided for this image

The philosophy

While learning the tool, I quickly realized that this is different to many other agent-based simulation tools. Simudyne strongly formalizes agent-based models following a specific “philosophy”. The key reason is, again, speed: They treat agent networks as a graph, to be solved using graph theory (specifically the Pregel framework).

Their help explains it best:

Rather than treating everything in the world in a massive list to iterate through and update a world state, we approach the problem from a bottom-up representation of the world where each agent can communicate via message passing between agents to create a world state that will inform their decisions.

So it is strongly de-centralized. And you as a modeler must follow along. In other tools like AnyLogic, you define the “philosophy” yourself: You can build a strongly de-centralized ABM. But you do not have to, and most people are not even aware of the possibility. The price to flexibility is computational speed.

The framework

So what exactly do you need to follow, then? Simply put, Simudyne requires you to structure models well and then design interactions around a specific sequence of actions:

Model structure

This is the standard part that is not too different from other ABM tools. Models consist of:

  • agents of different types (Java classes)
  • networks between agents
  • messages being sent between agents along network connections
  • an environment that agents live in

Obviously, you can refine and adjust these at any time.

Sequence

Here, I had to change my thinking quite a bit, compared to my normal AnyLogic world thinking… Simudyne ticks along time steps and follows a special sequence of actions, to ensure fast parallel computation:

  1. Agents send messages to other agents
  2. Agents receive messages from others
  3. Agents act on those messages
  4. If everyone is done, time advances by a “tick”
  5. repeat

The message passing/receiving happens in parallel, so modelers must be careful here. Also, it is your responsibility to send the right messages at the right time to the right receivers.


In other tools, I design message passing less formally. If an agent needs to send a message, I make it do so, without worrying about fundamental structural constraints. Again: the added flexibility comes at the cost of performance. A typical Simudyne ABM can run a lot faster than a comparable AnyLogic or NetLogo model.

When to use it

Maybe the description above did not make it clear yet, so let me spell it out: Simudyne is not the right tool for any purpose. Instead, it is the right tool for specific use cases, but for those it performs amazing. In a nutshell, you should use Simudyne if you are building a “serious” model, i.e. something of real importance. Something that has a huge impact and which is beyond a simple decision or a quick consulting gig. Essentially, when you are not “toying around” anymore. For example:

Large-scale systems

Use Simudyne when you need to model systems with more than 100k agents. Typical ABM packages quickly reach their practical limits due to inefficiencies, no in-built parallelism and non-optimized models. Typical use cases are economics, financial markets or social science models (population growth, climate change…)

Ultra-realistic digital twins

Another use case that will become more important in the future are simulation models of complex supply chains or manufacturing systems. Take a large warehouse of Amazon, Nike or Tesco: you easily have dozens of kilometers of conveyor belts, 1000s of items being processed each minute by 100s of machines.

Traditional simulation tools also easily reach their capability limits here: model speeds can be slower than real-time, rendering them useless even for simple analysis.

However, currently building such systems with Simudyne requires a lot of skill and experience. Simudyne will need to address and improve some of their API to help build such systems faster.

Conceptual models with truly big data

Another use case that would bring traditional simulation packages to their knees is this: A company has a true big-data lake and wants to get their quants to do fast “what-if” analysis. Streamlining huge datasets into an ABM-tool and testing some hypothesis is, normally, doomed to fail if your data would create millions of agents and interactions. Simudyne is designed for these exercises.

When NOT to use it

Simply put, do not even start with Simudyne if you need:

Conceptual models of simple systems

Such models are much easier build with traditional simulation tools like AnyLogic, NetLogo, FlexSim, Simio, you name it. Plus: you get custom visualizations for free.

One-off strategic or tactical decision support tools

A client needs to get an answer on a problem, but it is a one-off job. The client must be convinced of the outcome with good visualizations and the model may not be used again (or only intermittently). Here, the ROI is still in favour of traditional tools due to their speed, visualizations, and ease of use.

Low technical abilities

Simudyne requires a good technical grounding. If you can drag’n’drop building blocks in other simulation tools but not much more, you will have a problem. Solid OOP skills are a minimum requirement here, but you should be comfortable with SDKs, distributed computing and cloud deployments as well.

Simudyne advantages

This tool has amazing capabilities if you use it right and throw it at the right problems.

Tech stack

Simudyne is an SDK that builds upon on the most modern tech stack you can dream off. You can use any IDE (but go for IntelliJ of course ;) ) and work with the Maven build tool. It works on Windows, Mac and Linux. You can deploy it … well anywhere really. Working with Simudyne is like working for Google or Apple: you just use the latest and greatest standard IT tools.

No alt text provided for this image

Speed

Simudyne is designed for execution speed. As described above, it even forces you to follow a specific framework to make it work as fast as possible. So you may need extra effort in designing your model towards that framework but it is worth it: you gain ridiculous performance for complex, large systems.

Support

First, the Simudyne help is actually quite well done. Also, you have good step-by-step tutorials. But many tools have that these days. What makes Simudyne special is the fast and direct support you get from the developers. These folks are really helpful, especially in helping you translate a real system into the best “Simudyne way”.

Disadvantages

Just like anything, there are disadvantages as well, no need to shy away here. It depends on your skills and use-case if these are deal-breakers or irrelevant:

IDE

I have stated that the modern Simudyne tech stack is a huge plus. However, if you are used to the standard simulation-tool visual IDEs, using IntelliJ or Eclipse can be intimidating. But even as a seasoned coder myself, I struggled with a purely code-based IDE. Simply finding functions took me a little longer than my visual brain needs in AnyLogic.

Model visualization

Simudyne provides a default model visualization and UI. This looks cool initially (See image at the top of this article) but is very limited for customization.

However, this is actually done on purpose. You should use this to your advantage: Simudyne is intended to be used with custom visualization tools downstream, giving you all the flexibility you need.

Accessibility

As said before, Simudyne sits on a very modern tech stack. While this is great for seasoned coders, beginning simulation modelers might struggle a lot. If you previously dragged some blocks into AnyLogic or FlexSim, this is a whole new game. There is a ton of things to learn before you should even begin doing serious Simudyne work (see my tips below). Simudyne is a serious tool for serious uses :)

How to best learn Simudyne

Let’s assume you know very little about simulation, agent-based models and programming. Here is how you should approach learning Simudyne (you can simply cut off the points you already feel comfortable and join later):

  1. Understand simulation and ABMs: Play with NetLogo (free), build example models in AnyLogic (free PLE version suffices), understand the basic concepts of agents, environments, networks and message passing
  2. Skill up on programming and OOP: You need to be able to read and write code quite well. Either do some coding courses or, even better: advance your skills in AnyLogic. It allows you to combine simple drag-n-drop model building with advanced Java coding. So you skill up on the best of both worlds. However: still do a course on OOP separately. This is absolutely crucial and only haphazardly taught in AnyLogic materials.
  3. Learn the tech stack: Install IntelliJ, Maven, etc. and learn to use them with some small coding projects before even starting with the Simudyne SDK. Also, ensure you have a good (Git!) versioning tool ready before proceeding. In comparison to the previous steps, this can be done fairly quickly, just to master the tools before digging into Simudyne itself.
  4. Start with Simudyne tutorials: You are now at a point where it makes sense to start with Simudyne itself. They provide some fun tutorials and exercises beyond the step-by-step tutorials. Do them all until you understand the unique Simudyne framework philosophy by heart.
  5. Start your own project, but simple: as with any good simulation model, do NOT build the final model from scratch. Instead, first build the simple-most possible version of your final problem and get it to work well.
  6. Iterate and learn: Now you can add features that take your base model closer towards your final model vision. With this approach, you make sure things still work, you learn more Simudyne skills along the way and start making re-usable building blocks, etc.

Wrapup

Hope this helps some of you in understanding Simudyne and when to use it. In one sentence: Use Simudyne if you need to solve a big, serious problem and implement it into ongoing processes.

Farzona Eraj

ML Engineer zypl.ai

1 年

Thank you for this article, very interesting. Can you recommend this tool for a credit scoring model?

回复

HASH is a free and open-source simulation engine, also designed to scale, which utilizes the 'actor model' as well. A bit more on this message-passing approach here for folks who are interested: https://hash.ai/glossary/actor-model (HASH itself is JavaScript, Python and Rust as opposed to Java)

Sri Jagannathan

Technology Entrepreneur // Author // Mentor // Poet

3 年

Benjamin Schumann, PhD - Very well written and analyzed !

Rajkumar Bondugula, Ph.D.

AI Luminary Scientist and Distinguished Fellow

3 年

Thanks for the review Ben! This is a fascinating development in the simulation world! However, here is my question - while current non-big simulation software have trouble with 100,000s of agents, why does one need to model with 100,000 of agents (not 100,000 types of agents)? Increasing the scale increases the overall computational requirements exponentially (due interactions between agents and environments etc.). What is the benefit of increasing the scale (not complexity) in simulation modeling? Is the expectation we get more emergent phenomenon not observed otherwise? Very curious of what use cases need such massive scale...

Justin Lyon

CEO, Simudyne helps institutions solve complex problems and make better decisions. Barclays Techstars '17

3 年

Cem Dilmegani Thought I'd draw your attention to this interesting post on the use of Simudyne's SDK in manufacturing.

要查看或添加评论,请登录

Benjamin Schumann, PhD的更多文章

社区洞察

其他会员也浏览了