Launch HASH

Get Started

Documentation for developers using Petrinaut


What is Petrinaut?

Petrinaut is a suite of open-source Petri net simulation, visualization, and editing tools, developed by HASH and open-sourced at petrinaut.org.

The name Petrinaut refers to the entire collection of Petri net tools. This includes the Petri net simulation engine and visualizer, as well as the surrounding editing tools (bundled into an all-in-one modeling environment, available to download or use online at demo.petrinaut.org).

What are Petri nets?

Petri nets provide a mathematical (and graphical) modeling framework for describing, analyzing and simulating systems with concurrent, parallel, or distributed processes. This allows us to visualize complex, dynamic systems (such as traditionally difficult-to-model real-world supply chains, agentic workflows, and even things like chemical reactions) in a relatively simple way.

Petri nets are directed, bipartite graphs (meaning they consist of two types of nodes: places and transitions). They consist of four main elements:

  1. Places (represented as circles/ovals): Represent states, conditions, or resources (e.g., "printer is idle", "raw materials available").
  2. Transitions (which appear as rectangles/squares): Represent actions or events which change state (e.g., "cancel printing", "begin production").
  3. Arcs (edges between nodes, shown as directed arrows): Connect places to transitions or transitions to places, dictating the flow of the system.
  4. Tokens (rendered as dots or markers on the graph): Reside inside places and represent the current availability of a resource or process state (e.g. how many jobs are in a queue; whether production is in progress).

A transition exists in either an "enabled" or "disabled" state, and can only be enabled (allowed to occur) when all of its input places contain the required number of tokens. When a transition "fires," it consumes (removes) the tokens from its input places and creates new tokens in its output places, effectively changing the state of the system.

In contrast to classical finite state machines, Petri nets support concurrency, allowing multiple events to occur simultaneously.

About these docs

These developer-facing docs cover:

  • Setting up Petrinaut — running it locally, online, embedded, or as part of HASH.
  • Using Petrinaut — the Petri net extensions Petrinaut supports, creating and verifying nets, and running single or Monte Carlo simulations.

Where to start

For an overview of the project, visit petrinaut.org — or head to Setting up Petrinaut to dive right in.

Join our community of HASH developers