SimASM

Abstract State Machine Simulator for Discrete Event Simulation

Get Started Try Online

Features

Declarative Syntax

Define simulation models using a clean, readable domain-specific language based on Abstract State Machines.

Experiment Framework

Run replicated experiments with automatic statistics collection, warm-up periods, and output generation.

Verification

Check behavioral equivalence between models using formal verification.

Jupyter Integration

Use SimASM directly in Jupyter notebooks with cell magic support for interactive development.

Example: M/M/1 Queue

import Random as rnd
import Stdlib as lib

domain Object
domain Customer <: Object

var queue: List<Customer>
var server_busy: Bool
var interarrival: rnd.exponential(1.0) as "arrivals"
var service: rnd.exponential(0.8) as "service"

main rule step =
    // Process arrivals and departures
    if not server_busy and lib.length(queue) > 0 then
        server_busy := true
    endif
endrule

init:
    queue := []
    server_busy := false
endinit

Quick Installation

pip install simasm

Then in Python:

import simasm

# Register and run a model
simasm.register_model("my_model", source_code)
result = simasm.run_experiment(experiment_spec)