Skip to content

Add discrete event simulation - #438

Open
reuben-thomas wants to merge 97 commits into
open-rmf:mainfrom
reuben-thomas:reuben/rmf_site_sim
Open

reuben-thomas wants to merge 97 commits into
open-rmf:mainfrom
reuben-thomas:reuben/rmf_site_sim

Conversation

@reuben-thomas

@reuben-thomas reuben-thomas commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Addition of Discrete Event Simulation (DES) Library

This PR introduces rmf_site_sim as a new crate for performing DES in Bevy, with a core API that should be intuitive to Bevy users.

Core Concepts and API

DiscreteEvent is very similar to a Bevy Command, and represents an instantaneous change in the state of the world.SimulationState is a wrapper around a Bevy World, representing the state vector at any given moment.
Prediction Systems are ordinary Bevy systems that are used to model behaviour. Rather than mutate the world directly, these systems propose CandidateDiscreteEvents.
CandidateDiscreteEvents are events that have been predicted by prediction systems that might occur. A DiscreteEvent within is only applied on the World if it is guaranteed to occur.

Computing a Simulation

The relationship between Prediction Systems CandidateDiscreteEvents, and DiscreteEvents in the computation of a simulation may be summarized in the following:

compute

A simulation is computed asynchronously in a Bevy [AsyncComputeTaskPool], first by extracting all relevant entities, components, and resources from the main world, and sending SimulationStep updates per timestep to the Simulation in the main thread as they are computed.

Supporting Functionality

Synchronization

A simulation only ever handles a subset of components, entities, and resources, which is registered and managed by a Synchronizer, which is used to extract only required data for compute, as well as switching between simulations during playback.

Playback

The SimulationPlaybackPlugin plays a computed simulation
back on the main world with speed control, seeking, and replay behaviour.

Interaction

  • keyboard A plugin for controlling playback with keyboard commands.
  • egui (egui) Playback controls, an event table, and an overview panel implemented in egui.
  • rmf_site_egui (rmf_site_egui) The above, as tiles in the RMF Site Editor's panels.

GenAI Use

  • I used a GenAI tool in this PR.
  • I did not use GenAI

Some portions of this pull request were generated using:

@mxgrey mxgrey added this to PMC Board Aug 7, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in PMC Board Aug 7, 2026
@mxgrey
mxgrey self-requested a review August 11, 2026 01:32
@mxgrey mxgrey moved this from Inbox to In Review in PMC Board Aug 11, 2026
xiyuoh and others added 26 commits August 11, 2026 12:14
Signed-off-by: Xiyu Oh <xiyu@openrobotics.org>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
* Add diagnostic for duplicated location names

Location names are used to dispatch robots to specific places via RMF
tasks. When two locations share a name the dispatch becomes ambiguous,
which can cause incorrect routing.

Mirror the existing duplicated door / lift name checks: a new
`check_for_duplicated_location_names` system runs on `ValidateWorkspace`
and emits an `Issue` for every name that appears on more than one
location entity, with the affected entities attached so the diagnostics
panel can highlight them.

Fixes open-rmf#346

Signed-off-by: Lots-ninety-nine <261080291+Lots-ninety-nine@users.noreply.github.com>

* Retrigger CI

Signed-off-by: Lots-ninety-nine <261080291+Lots-ninety-nine@users.noreply.github.com>

* Test CI

Signed-off-by: Xiyu Oh <xiyu@openrobotics.org>

* Remove branch

Signed-off-by: Xiyu Oh <xiyu@openrobotics.org>

---------

Signed-off-by: Lots-ninety-nine <261080291+Lots-ninety-nine@users.noreply.github.com>
Signed-off-by: Xiyu Oh <xiyu@openrobotics.org>
Co-authored-by: Lots-ninety-nine <261080291+Lots-ninety-nine@users.noreply.github.com>
Co-authored-by: Xiyu <xiyu@openrobotics.org>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
Signed-off-by: Reuben Thomas <reubenthomas123@gmail.com>
@mxgrey
mxgrey marked this pull request as ready for review September 20, 2026 15:41
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

4 participants