Skip to main content

Simpy based simulation engine with a visualization layer.

Project description

DXM

DXM 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 dxm

Quick Start

Here is a minimal example of a simulation recording:

import json
from dxm.core.environment import RecordingEnvironment
from dxm.core.simulation_entity import SimulationEntity
from dxm.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

dxm-0.1.0.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

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

dxm-0.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dxm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c807240682d1acafc758f2e7f3be7769f511a85c5ef92ebde844cd42c5da8d4
MD5 8aa52279367e8348ac88cfc17e3f823d
BLAKE2b-256 a9cb9b72ad55d504f35cff91fefffce5fe4e744770a0c0a0abc90194f06a8ff7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dxm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for dxm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5575438a9c2134974f2649febe8f55c445f1317205ac06852056b274ccca7116
MD5 50d59603ddbe5b0c309c8a54596613d4
BLAKE2b-256 ae3f0aaca7d30653b9953fc395b9ecbd3d9e47e1ab1c1d07d16cac3ff343a788

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