Skip to content

Feat/priority locomotive dispatcher#408

Merged
jhw-db merged 4 commits into
mainfrom
feat/priority-locomotive-dispatcher
Jun 10, 2026
Merged

Feat/priority locomotive dispatcher#408
jhw-db merged 4 commits into
mainfrom
feat/priority-locomotive-dispatcher

Conversation

@jhw-db

@jhw-db jhw-db commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Test improvement
  • Other (please describe):

How Has This Been Tested?

Pytest and shipped test scenario

Checklist

  • Follows conventional commit message format
  • Code is formatted and linted (uv run ruff format . && uv run ruff check .)
  • All tests pass (uv run pytest)
  • Documentation updated (if needed)

Additional Notes

jhw-db added 3 commits June 9, 2026 19:57
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.
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://OpenRailAssociation.github.io/dac-migration-dss-popupsim/pr-preview/pr-408/

Built to branch gh-pages at 2026-06-10 09:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions github-actions Bot temporarily deployed to pr-preview June 10, 2026 09:22 Inactive
@github-actions github-actions Bot temporarily deployed to pr-preview June 10, 2026 09:30 Inactive
@jhw-db jhw-db merged commit d3d0e42 into main Jun 10, 2026
10 checks passed
@jhw-db jhw-db deleted the feat/priority-locomotive-dispatcher branch June 10, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant