Discrete event simulation library for Python.
Project description
Visuals autogenerated from examples/visual/chash_example.py
Happy Simulator
A simulation library built for the modern world.
Documentation · Examples · Blog Post
[!WARNING] Alpha — Still in active development. Some features may not work as expected. Interfaces may change drastically.
Happy Simulator is a code-first simulation library for education, research, design, or entertainment.
Some articles using the library:
- Simulation-Enhanced Reasoning - enhancing AI with simulation.
- Adverse Advertising Amplification - consumer behaviour simulation.
Features
- Intuitive modeling — convert real-world components into simulated equivalents.
- Rich component library — queues, load balancers, rate limiters, industrial components, behavioural models and more
- Visual debugger — browser-based UI generated from simulation model.
- AI Compatible - use your generative AI of choice to convert scenarios to simulations.
Quick Start
pip install happysim
from happysimulator import Simulation, Source, Sink, Server, Instant
from happysimulator.distributions import ExponentialLatency
sink = Sink()
server = Server("Server", service_time=ExponentialLatency(0.1), downstream=sink)
source = Source.poisson(rate=8, target=server)
sim = Simulation(sources=[source], entities=[server, sink], end_time=Instant.from_seconds(60))
summary = sim.run()
Visual Debugger
pip install happysim[visual]
# define sim
from happysimulator.visual import serve
serve(sim) # opens browser at http://127.0.0.1:8765
Step through events, inspect entity state, and create interactive dashboards from the browser.
Installation
pip install happysim # core library
pip install happysim[visual] # + browser debugger (FastAPI + uvicorn)
pip install happysim[dev] # + testing & docs tools
Or install from source:
git clone https://github.com/adamfilli/happy-simulator.git
cd happy-simulator
pip install -e ".[dev]"
Documentation
Full guides, API reference, and example walkthroughs at adamfilli.github.io/happy-simulator.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file happysim-0.2.4.tar.gz.
File metadata
- Download URL: happysim-0.2.4.tar.gz
- Upload date:
- Size: 392.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aa80ddac3753a2ed1ee530b29a9c9fb970e89d1deb3fa53460967984bc06449
|
|
| MD5 |
244cb454d2e16dddea68529f5c4d7db2
|
|
| BLAKE2b-256 |
2da7f2bfa3892f62d40545811fbf53e69b47ac62f3c5ef352f3c3b3b7eee26f8
|
Provenance
The following attestation bundles were made for happysim-0.2.4.tar.gz:
Publisher:
publish-pypi.yml on adamfilli/happy-simulator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
happysim-0.2.4.tar.gz -
Subject digest:
9aa80ddac3753a2ed1ee530b29a9c9fb970e89d1deb3fa53460967984bc06449 - Sigstore transparency entry: 1154502501
- Sigstore integration time:
-
Permalink:
adamfilli/happy-simulator@ecb787546fbeede172a0a1de109c1961a431ab9a -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/adamfilli
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ecb787546fbeede172a0a1de109c1961a431ab9a -
Trigger Event:
release
-
Statement type:
File details
Details for the file happysim-0.2.4-py3-none-any.whl.
File metadata
- Download URL: happysim-0.2.4-py3-none-any.whl
- Upload date:
- Size: 546.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06754a862a7d0973e820aeeb571b0c911b0e7e0678353e46485dcaf8bda847c4
|
|
| MD5 |
06579420343e6bb092180ce7ac9ae3c9
|
|
| BLAKE2b-256 |
c756452de26a280f2bb3ba86253c119757e05d9018f7ced7951a3492d7f1b5de
|
Provenance
The following attestation bundles were made for happysim-0.2.4-py3-none-any.whl:
Publisher:
publish-pypi.yml on adamfilli/happy-simulator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
happysim-0.2.4-py3-none-any.whl -
Subject digest:
06754a862a7d0973e820aeeb571b0c911b0e7e0678353e46485dcaf8bda847c4 - Sigstore transparency entry: 1154502505
- Sigstore integration time:
-
Permalink:
adamfilli/happy-simulator@ecb787546fbeede172a0a1de109c1961a431ab9a -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/adamfilli
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ecb787546fbeede172a0a1de109c1961a431ab9a -
Trigger Event:
release
-
Statement type: