Feat/priority locomotive dispatcher#408
Merged
Merged
Conversation
Introduce a central LocomotiveDispatcher that assigns locomotives to tasks based on configurable, dynamic priorities. Priorities react to current track fill levels, replacing the implicit FIFO allocation. Key additions: - TaskPriorityConfig domain model with base priority, rules, and hold_until - LocomotiveDispatcher service with priority queue and eligibility gating - task_priorities configuration in scenario.json - hold_until condition to suppress wasteful small-batch trips - All four coordinators wired to use dispatcher when configured - Fallback to direct FIFO allocation when task_priorities is not set Also adds track_type_fill_factors to scenario.json for per-type max fill levels (separate from per-track fillfactor overrides in tracks.json). Includes example scenario (ten_trains_two_days_priority_dispatch) and updated tutorial documentation.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow priority definition of locos. Before it is buried down in the code. Now
the user can set it more easily. Its now part of the scenario.json allowing
to define also fill levels of the source and target track .
Related Issues/Tickets
None
Type of Change
How Has This Been Tested?
Pytest and shipped test scenario
Checklist
uv run ruff format . && uv run ruff check .)uv run pytest)Additional Notes