Skip to main content

Simpy based simulation engine with a visualization layer.

Project description

DEStiny

DEStiny is a discrete event simulation engine built on top of SimPy. It adds a layer of abstraction for recording simulation events (movement, stays) to be visualized in a frontend application.

It is designed for:

  • Any discrete event simulation where spatial visualization is key

With examples in place for

  • AGV (Automated Guided Vehicle) simulations

Installation

pip install destiny-sim

Quick Start

Here is a minimal example of a simulation recording:

import json
from destiny_sim.core.environment import RecordingEnvironment
from destiny_sim.core.simulation_entity import SimulationEntity
from destiny_sim.core.rendering import RenderingInfo, SimulationEntityType

# 1. Define your entities
class Robot(SimulationEntity):
    def get_rendering_info(self):
        return RenderingInfo(entity_type=SimulationEntityType.ROBOT)

# 2. Create the environment
env = RecordingEnvironment()
robot = Robot()

# 3. Define simulation logic
def robot_process(env, robot):
    # Record initial position
    env.record_stay(robot, x=0, y=0, start_time=env.now)
    yield env.timeout(1)
    
    # Move to (10, 10) over 5 seconds
    env.record_motion(
        entity=robot,
        start_time=env.now,
        end_time=env.now + 5,
        start_x=0, start_y=0,
        end_x=10, end_y=10
    )
    yield env.timeout(5)

env.process(robot_process(env, robot))

# 4. Run and Export
env.run(until=10)
recording = env.get_recording()

with open("recording.json", "w") as f:
    json.dump(recording.to_dict(), f, indent=2)

print("Simulation complete! saved to recording.json")

Features

  • RecordingEnvironment: Drop-in replacement for simpy.Environment that tracks entity states.
  • Spatial Graph: Includes GridSiteGraph for navigation and pathfinding.
  • AGV Logic: Built-in support for AGVs, Tasks, and Fleet Management.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

destiny_sim-0.1.0.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

destiny_sim-0.1.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file destiny_sim-0.1.0.tar.gz.

File metadata

  • Download URL: destiny_sim-0.1.0.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for destiny_sim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 346fa92f4522c50d96a8104858f9d2a9981a6453ad03b3841c2b6c7545d61dc3
MD5 f40605c22888225fb27522ec4e091d05
BLAKE2b-256 06c5aab4482154ff3511bc89bb00f7cf65be07a778c6983e0c2b55b4c992d169

See more details on using hashes here.

File details

Details for the file destiny_sim-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for destiny_sim-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7faa500a268fa6a4992ea9bcd74af21b23d5002d782e0cbb4080542a34f8403
MD5 6deebd58eacda036a59a9e0ea0e55245
BLAKE2b-256 65cbdfaefaadff492886a2968df70126c65d61a526d85e21e0db009e411d9eda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page