Upstage
A Python framework for creating robust, behavior-driven Discrete Event Simulations
Install / Use
/learn @gtri/UpstageREADME
UPSTAGE
UPSTAGE is a Universal Platform for Simulating
Tasks and Actors with Graphs and Events built atop
SimPy 4.
✨ Try it in your browser ✨
➡️ https://gtri.github.io/upstage/demo
What is UPSTAGE for?
UPSTAGE is a Python framework for creating robust, behavior-driven Discrete Event Simulations (DES). The primary goal of UPSTAGE is to enable the quick creation of simulations at any desired level of abstraction with built-in data recording, simulation integrity and runtime checks, and assistance for the usual pitfalls in custom discrete-event simulation: interrupts and cancellations. It is designed is to simplify the development process for simulation models of complex systems of systems.
UPSTAGE leverages the extensible SimPy library and adds two concepts to accelerate the generation of complex discrete-event simulations.
Actor- i.e., an entity that hasStateTask- i.e., actions actors can perform and that can be organized into aTaskNetwork.
Actors can have multiple networks running on them, their states can be shared, and there are features for interactions between task networks running on the same actor. Those tasks modify the states on their actor, with features for real-time states that update on request without requiring time-stepping or modifying the existing events.

Additional features include:
- Context-aware
EnvironmentContext, accessed viaUpstageBase, enabling thread-safe simulation globals for the Stage and Named Entities (see below). - Active States (e.g.,
LinearChangingState) represent continuous-time attributes of actors that can be queried at discrete points in time, or trigger events when they reach a certain level. - Spatial-aware data types (e.g.,
CartesianLocation) and states like the waypoint-followingGeodeticLocationChangingState. - Geodetic and cartesian positions, distances, and motion - with ranged sensing.
NamedEntityin a thread-safe global context, enabling easier "director" logic creation with less argument passing in your code- The
Stage: a global context variable for simulation properties and attributes. This enables under-the-hood coordination of motion, geography, and other features. - Rehearsal: Write planning and simulation code in one place only, and "rehearse" an actor through a task network using planning factors to discover task feasibility before the actor attempts to complete the task.
- All States are recordable, and some record dataclass and dictionary values
- A
Routineclass for building reusable event behaviors to simplifyTaskcoding. - Point-To-Point and Routing Table communications handlers.
- Numerous runtime checks and error handling for typical DES pitfalls: based on more than a decade of custom DES-building experience.
- And more!
See the documentation for tutorials and details.
Requirements
UPSTAGE only requires Python 3.11+ and Simpy 4+.
Installation
In an environment (Python 3.11+) of your choice:
pip install upstage-des
Documentation
See the documentation for tutorials and additional details.
How do I contribute or set up a develpment environment?
See CONTRIBUTING for instructions on setting up an environment and contributing.
For information on how to style your code, see the Style Guide.
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
