Русский     English

Aivika

Note: Aivika is obsolete now and can be replaced with AivikaSim, which has a significantly better support of the distributed simulation, for example.

Aivika is a platform consisting of program libraries for simulation, nested simulation and parallel distributed simulation. It is mainly focused on discrete event simulation, but it partially supports system dynamics and agent-based modeling too.

Aivika allows the modeler to operate on events, discrete processes, resources, queues, servers, streams of transacts and their processors. It simultaneously allows him/her to both define the events and processes diving into low-level details of behavior of modeling entities and create high-level queue networks in declarative way. All parts of the Aivika platform are well integrated.

The idea is quite simple. We represent modeling activities as abstract computations which can be combined, or built from primitives. It actually has deep relations to functional programming.

The Aivika platform is written in the Haskell programming language. The corresponding libraries are distributed under the BSD3 license. The installation packages are hosted on Hackage DB, while the sources are open and they can be found on GitHub.

Bibliography

There is an article (in Russian) published in theses of The Seven All-Russia Scientific-Practical Conference on Simulation and its Application in Science and Industry "Simulation. The Theory and Practice" ("IMMOD-2015") that was held October 21-23 in Moscow:

Basic Version

There is a basic version of Aivika. This is a general-purpose simulation library suitable for solving the most part of tasks. It is relatively fast and easy-to-use under the condition that the modeler has strong skills in Haskell.

There is the PDF documentation that describes the method, main API and provides with some examples:

There is also a tutorial for beginners:

The installation instructions are located on the Wiki page:

The installation package and sources can be found by the following links:

There are companion libraries that allow running simulation experiments, saving results in the CSV files and plotting charts.

Generalized Version

There is also a generalized version of Aivika, which main idea and which applications are described in the following article:

The installation package and sources are available by the following links:

The generalized version is like a transformer that allows creating general-purpose simulation libraries for partial cases of computations that have the desired features like an ability to run nested simulations, or to run parallel distributed simulations.

It uses relatively high-level concepts of the Haskell programming language such as monad transformers and type families. However, the code is almost the same as in the basic version, but the types and function signatures are slightly different, more general.

Nested Simulation

There is a module for the generalized version, which is customized for running nested simulations within discrete event simulation.

Actually, this package provides with a specialized computation that can be used in the generalized version of Aivika, a constructor of general-purpose simulation libraries.

To forecast the model behavior in the future, here we can make as many branches of the current model state as we need. The operation of creating a new branch is relatively cheap and fast. We can run nested simulations advancing their modeling time. Then basing on the received information, we can change the current state and proceed with the simulation at "present".

Parallel Distributed Simulation

There is another module for the generalized version of Aivika but now customized for running parallel distributed simulations within discrete event simulation. It is destined for running the simulation on a cluster or supercomputer.

As before, this package provides with a specialized computation that can be used in the generalized version of Aivika, the constructor of general-purpose simulation libraries.

Here the nodes of the cluster can communicate to each other sending and receiving asynchronous messages that have timestamps. An optimistic strategy inspired by ideas of the Time Warp method is implemented. After receiving the outdated message, a transparent rollback occurs. The rollbacks can be cascading and they can involve many nodes of the cluster.

It contains an experimental mechanism of the global time synchronization. Also there are protection mechanisms for preventing the overload. There are different parameters that allow customizing the library.

Nested Simulations Within Lattice

There is also a module for running nested discrete event simulations within lattice.

The key feature is that the number of the lattice nodes has a quadratical dependency on the size of the lattice. In other words, traversing the lattice nodes has a quadratical complexity, which makes it a computationally feasible task even for a large size lattice.

Here we can update mutable references within discrete event simulation. This is a forward traversing part of the model, where the future value of each reference strongly depends on the past. The reference can be observed within another part of the model, where we can make estimations. The estimating part can be backward traversing, where the estimation of the past may depend on estimations of the future. The traversing occurs in the lattice nodes.

This package is experimental. This is mainly a proof of concept. It is based on the generalized version of Aivika too.