utopia-logo

A comprehensive modeling framework for complex and adaptive systems.

Utopia provides the tools to conveniently implement computer models, perform simulation runs, and evaluate the resulting data. Completely free and open source.
Get started arrow-right Docs arrow-right Code arrow-right
Utopia uses utopya for simulation control and management and dantro for data handling and visualization:
utopya-logo
dantro-logo

Designed by researchers, for researchers.

Utopia arose from the observation that many aspects of implementing and studying a computer model of complex systems would profit from a flexible and powerful framework — Utopia is that framework. With its wide range of features, it aims to make your everyday workflow more convenient, efficient, and reproducible. Key strengths are:
icon

Combines modern C++ with Python and YAML

Utopia’s modern C++ backend balances high performance and ease-of-use. For flexible data evaluation, Utopia relies on Python and its excellent ecosystem of scientific software. All that is controlled by the powerful YAML language.
icon

Many example models

Includes a plethora of complex system models, inviting you to explore and investigate them. These are implemented in fast C++ and showcase how Utopia helps to represent model dynamics in cellular automata, agent-, or graph-based models.
icon

Parallelization

Use parallelization in individual model implementations or simply through concurrent simulation execution during parameter sweeps. Simulation tasks can also be distributed across the nodes of a cluster.
icon

It’s free and open-source

Utopia is free software and licensed under the GNU Lesser General Public License v3+.
icon

It’s tested

Incorporates and encourages software engineering best practices like version control, automated testing, and collaborative development.
icon

Out-of-the-box plots and animations

Utopia contains a multitude of plot functions: from animated graphs and agent plots to cellular automata, heatmaps, stacked line plots and errorbands, all fully customisable from the config, and all adapted to high-dimensional data. In many cases, you only need to select the data you want to plot and where to plot it. And if you want to implement your own plot, it will integrate seamlessly with the framework.
icon

Reproducibility

In a scientific context, transparency and reproducibility of model simulations is key. Utopia achieves this by keeping track of all involved configuration parameters and relevant version control metadata.
icon

Made for high dimensions

Utopia facilitates large scale parameter sweeps as well as studying the resulting high-dimensional data.
icon

Modularity

In Utopia, you can use the tools that best fit your workflow: The framework is designed to allow for easy integration of custom solutions, be it on the level of the model implementation or the evaluation of simulation data. To simplify this, Utopia itself is highly modularized, uses open data formats like HDF5, and integrates state-of-the-art scientific software like xarray and matplotlib.

All the modelling tools you need, easily configurable.

Utopia is specifically designed for cellular automaton models, agent-based models, and network models. It provides all the tools you need to implement new models, configure and perform simulation runs, and evaluate the resulting data. Everything is completely customizable, but comes with useful defaults.
icon

Create a model

Utopia’s C++ Model base class is the scaffolding for your model: it loads the model configuration, sets up a random number generator and loggers, can send progress information to the frontend, handle signals … and more. By integrating a CellManager or an AgentManager, you can quickly get started on CA models and ABMs — or implement your own dynamics.

Utopia’s pre-implemented models can be used as implementation examples and starting points, simply by creating a new model from an existing one using the utopia models copy command.

Hint: If you want to use another language than C++, that’s also possible.

icon

Tell it what to do

Alongside your model implementation, a model configuration file holds the default parameters for your model. This avoids hard-coding values and makes your simulations more reproducible.

To configure a model, you merely need to specify the parameters you want to have updated. Also, defining parameter sweeps (for any parameter) is very easy:

ContDisease:
  # Sweep over the infection probability
  p_infect: !sweep
    default: 0.01
    values: [0.01, 0.02, 0.04]

Configurability is a key design principle of Utopia: using YAML files, you can control almost every aspect of the framework’s setup, the model’s simulation, and its evaluation routine — without needing to write a single line of code. However, with sensible default values provided, you do not need to control everything.

icon

Run your model – once or many times

Running a model is as simple as calling:

utopia run ContDisease

This will assemble all relevant configuration files and start the model simulation. In Utopia, an individual instantiation of a model is called a universe; the set of all universes is the so-called multiverse.

If parameter sweeps are configured, many universe simulations are carried out in parallel – or even distributed over the nodes of a cluster! All of this can be controlled from a powerful command line interface and via configuration files.

icon

Data management: taken care of

Utopia takes care to have all simulation data written to a specific output directory. After the run has finished, the simulation data is automatically loaded into a tree-like structure, which houses data from different sources (HDF5, CSV, YAML, …) and can reflect their hierarchical organization.

The uniform interface of this data tree (implemented in dantro) allows easy automation of data transformations and evaluation of model simulations.

icon

Data analysis, right from the config

Utopia’s data processing pipeline deliberately separates the steps of transforming and visualizing the data, thus allowing for more generality and easier automation of plots.

It integrates dantro’s data transformation framework that allows to select and analyze data in preparation for visualizing it. Analysis steps can be defined directly in the config file, alongside the specification of a plot.

icon

Visualization – automated, simple, flexible

The plotting framework makes evaluation of your simulation run very easy. With data transformation taken care of, creating a new plot is as simple as specifying what you want to plot in which way – all from the plot configuration, without needing to touch any code.

By allowing to base a plot configuration on existing templates, repetitions are reduced. For instance, to generate an animated plot for a cellular automaton (CA) time series, you simply add the following entry to the plot configuration:

  ca/age:                    # name of the plot
    based_on:
      - .creator.universe    # one plot per universe
      - .plot.ca             # specialized CA plot
      - .animation.ffmpeg    # turn on animation

    select:                  # the data to plot …
      age: age

    to_plot:                 # … and how to plot it
      age:
        title: Age
        cmap: YlGn
        limits: [0, max]

Plots can be configured to be generated automatically after each simulation; or if a predefined condition is met.

If you want to evalute a simulation run again at a later point, it’s as easy as running the evaluation routine separately:

utopia eval ForestFire