Skip to content

Add bypass routing and car train terminal to Praha XML#347

Open
Copilot wants to merge 6 commits intodevelopfrom
copilot/improve-switch-layout-praha
Open

Add bypass routing and car train terminal to Praha XML#347
Copilot wants to merge 6 commits intodevelopfrom
copilot/improve-switch-layout-praha

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

Praha Hlavní Nádraží configuration forced all north trains through platform zone and lacked car train terminal infrastructure.

Changes

North Bypass Route (Y=20)

Direct north-south routing avoiding platform congestion:

  • N-Bypass InOut at (2,20)
  • Signal (4,20), switch (6,20)
  • 3 track blocks: 150m approach + 30m signal + 100m connection

Car Train Terminal (Y=22)

Peripheral siding for car-carrying trains (autovlaky):

  • S-CarTrain InOut at (60,22)
  • Terminal diverge at switch (52,20) - changed to Type=SIMPLE_RIGHT_TRUE to allow diverging
  • 2 track blocks: 20m diverge + 80m terminal siding

XML Structure

<!-- New InOuts -->
<InOut X="2" Y="20" SpatialType="HORIZONTAL" orientation="false" name="N-Bypass"/>
<InOut X="60" Y="22" SpatialType="HORIZONTAL" orientation="true" name="S-CarTrain"/>

<!-- New/Modified switches -->
<RailSwitch X="6" Y="20" SpatialType="HORIZONTAL" Type="SIMPLE_LEFT_TRUE"/>
<RailSwitch X="52" Y="20" SpatialType="HORIZONTAL" Type="SIMPLE_RIGHT_TRUE"/>

Impact

Element Before After
InOut 10 12
Switches 40 41
Signals 54 55
Track Blocks 106 111

Grid (70x25) and platform zone (Y=4-18) unchanged. All existing elements preserved.

Switch Orientation Fix

The switch at (52,20) was corrected to Type=SIMPLE_RIGHT_TRUE (diverging switch) to properly handle both the straight-through route to S-Bypass and the diverge route to the car train terminal. This follows the standard pattern where a single switch handles diverging paths using different segments (F for straight, D for diverge).


Documentation: docs/PRAHA_SWITCH_IMPROVEMENTS.md

Original prompt

This section details on the original issue you should resolve

<issue_title>Praha Hlavní Nádraží XML: Minor switch layout improvements</issue_title>
<issue_description>## Description

The Praha Hlavní Nádraží XML configuration is functional and loads correctly in the editor, but requires minor switch layout tweaks for improved realism.

Current Status

  • ✅ Grid: 70x25
  • ✅ 36 switches, 51 signals, 10 InOuts, 98 track blocks
  • ✅ Parses successfully
  • ✅ User approved as final version
  • ✅ Visible in editor GUI

Improvements Needed

  • Minor adjustments to switch positioning in throat areas
  • Potential optimization of switch density for more realistic operations

Priority

Low - XML is functional and suitable for testing purposes

Related

  • Complex station configuration tests in XMLContextFactoryTest
  • src/test/resources/cz/vutbr/fit/interlockSim/xml/fixtures/praha-hlavni-nadrazi.xml</issue_description>

<agent_instructions>reanalyze and implement please</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@bedaHovorka switches near inouts allow trains going to another inout not into the center of station @bedaHovorka in czech : "Na hlavaku chybí terminál autovlaku"

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Improve minor switch layout in Praha Hlavní Nádraží XML Add bypass routing and car train terminal to Praha XML Feb 6, 2026
Copilot AI requested a review from bedaHovorka February 6, 2026 02:46
@bedaHovorka bedaHovorka marked this pull request as ready for review February 6, 2026 02:48
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 6, 2026

@bedaHovorka bedaHovorka changed the base branch from develop to feature/backlog_2026_02 February 6, 2026 03:09
Copy link
Copy Markdown
Owner

@bedaHovorka bedaHovorka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed swiches orientation (segments?)

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 6, 2026

changed swiches orientation (segments?)

Fixed in commit 790a7b0. Changed switch at (52,20) from SIMPLE_RIGHT_FALSE to SIMPLE_RIGHT_TRUE to allow diverging to the car train terminal. Removed the duplicate switch at (52,22) - the diverge is now correctly handled by the switch at (52,20) using segment D.

bedaHovorka

This comment was marked as outdated.

This comment was marked as outdated.

Copy link
Copy Markdown
Owner

@bedaHovorka bedaHovorka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failing job ran 1849 tests, with 8 failures causing the Gradle :test task to fail. The workflow itself is correctly configured to run with Kotlin 2.0 and Java 21, and the tests are executed via ./gradlew test --no-daemon --warning-mode=all --stacktrace.

Solution steps:

  1. Identify Failing Tests
    Review the test failure details in the report at build/reports/tests/test/index.html. Since the file could not be retrieved here, check the artifact or the job logs for failure stack traces.

  2. Common Issues and Fixes

  • If failures involve "Invalid Attribute Values" or "Missing Required Attributes" in XML-related tests, ensure that all required XML attributes are present and valid in your test data.
  • For equality or construction test failures (e.g., testEquality, testConstruction), verify the implementation of equals(), constructors, and field initializations for possible changes that might break test expectations.
  • For enum or type checking tests, ensure all enum/attribute values used in tests and sample data are defined and valid.
  1. Example Fix for a Missing XML Attribute Failure:
    If a test fails due to a missing attribute, update your XML test data:
<!-- Before -->
<TrackBlock id="tb01" />

<!-- After -->
<TrackBlock id="tb01" length="1000" />
  1. Rerun Tests
    After applying fixes, push your commit. The workflow will automatically rerun and should pass if the above issues are corrected.

If you need the exact stack trace or test names, open the build/reports/tests/test/index.html artifact in your branch or PR run.

Summary:

  • Review the failing test details in the test report artifact.
  • Fix missing/invalid attributes, enum values, or constructor logic as revealed by failed tests.
  • Re-run the workflow after fixes.

bedaHovorka

This comment was marked as outdated.

bedaHovorka

This comment was marked as outdated.

This comment was marked as outdated.

bedaHovorka

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI requested a review from bedaHovorka February 6, 2026 12:59
@bedaHovorka bedaHovorka changed the base branch from fix/jacoco-coverage-computation to develop March 27, 2026 17:02
@bedaHovorka
Copy link
Copy Markdown
Owner

@copilot please rebase onto current develop

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

@copilot please rebase onto current develop

Rebased onto current develop (095c193) in commits 4c71f35 through ab0a614. The Praha XML changes are now on top of the latest develop, which includes the multiplatform Resources API migration (#461). The Praha fixture moved from desktop-ui to core-test during the rebase, and all changes are preserved.

Copilot AI requested a review from bedaHovorka April 16, 2026 08:09
bedaHovorka added a commit that referenced this pull request Apr 17, 2026
…alidation (#347)

- Exact element counts (12 InOuts, 41 switches, 56 signals, 111 blocks)
- N-Bypass and S-CarTrain InOut presence and orientation
- Bypass route navigability (N-Bypass → S-Bypass)
- Car train terminal reachability via bypass corridor
- Switch orientation domain correctness at (6,20) and (52,20)
- Fix XML: add RailSemaphore at (52,22) as required node cell for track block endpoint
- Fix XML: resolve duplicate segment-A conflict at (16,20) via segment B for diagonal approach

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bedaHovorka bedaHovorka force-pushed the copilot/improve-switch-layout-praha branch from 30457e4 to fd02349 Compare April 17, 2026 16:01
Copy link
Copy Markdown
Owner

@bedaHovorka bedaHovorka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only one praha-hlavni-nadrazi.xml in codebase - no duplicates please

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

only one praha-hlavni-nadrazi.xml in codebase - no duplicates please

Fixed in commit d38e3eb. Removed duplicate from desktop-ui/src/test/resources/. Only one copy now exists in core-test/src/commonMain/resources/ (the correct location after the multiplatform Resources API migration). All 52 XMLContextFactoryTest tests pass.

Copilot AI requested a review from bedaHovorka April 17, 2026 16:33
bedaHovorka added a commit that referenced this pull request Apr 18, 2026
…alidation (#347)

- Exact element counts (12 InOuts, 41 switches, 56 signals, 111 blocks)
- N-Bypass and S-CarTrain InOut presence and orientation
- Bypass route navigability (N-Bypass → S-Bypass)
- Car train terminal reachability via bypass corridor
- Switch orientation domain correctness at (6,20) and (52,20)
- Fix XML: add RailSemaphore at (52,22) as required node cell for track block endpoint
- Fix XML: resolve duplicate segment-A conflict at (16,20) via segment B for diagonal approach

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bedaHovorka bedaHovorka force-pushed the copilot/improve-switch-layout-praha branch from d38e3eb to 259cefe Compare April 18, 2026 02:57
bedaHovorka added a commit that referenced this pull request Apr 19, 2026
…alidation (#347)

- Exact element counts (12 InOuts, 41 switches, 56 signals, 111 blocks)
- N-Bypass and S-CarTrain InOut presence and orientation
- Bypass route navigability (N-Bypass → S-Bypass)
- Car train terminal reachability via bypass corridor
- Switch orientation domain correctness at (6,20) and (52,20)
- Fix XML: add RailSemaphore at (52,22) as required node cell for track block endpoint
- Fix XML: resolve duplicate segment-A conflict at (16,20) via segment B for diagonal approach

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bedaHovorka bedaHovorka force-pushed the copilot/improve-switch-layout-praha branch from 259cefe to 93756c4 Compare April 19, 2026 14:07
bedaHovorka added a commit that referenced this pull request Apr 19, 2026
…alidation (#347)

- Exact element counts (12 InOuts, 41 switches, 56 signals, 111 blocks)
- N-Bypass and S-CarTrain InOut presence and orientation
- Bypass route navigability (N-Bypass → S-Bypass)
- Car train terminal reachability via bypass corridor
- Switch orientation domain correctness at (6,20) and (52,20)
- Fix XML: add RailSemaphore at (52,22) as required node cell for track block endpoint
- Fix XML: resolve duplicate segment-A conflict at (16,20) via segment B for diagonal approach

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bedaHovorka bedaHovorka force-pushed the copilot/improve-switch-layout-praha branch from 93756c4 to 322dcf6 Compare April 19, 2026 17:17
bedaHovorka added a commit that referenced this pull request Apr 19, 2026
…alidation (#347)

- Exact element counts (12 InOuts, 41 switches, 56 signals, 111 blocks)
- N-Bypass and S-CarTrain InOut presence and orientation
- Bypass route navigability (N-Bypass → S-Bypass)
- Car train terminal reachability via bypass corridor
- Switch orientation domain correctness at (6,20) and (52,20)
- Fix XML: add RailSemaphore at (52,22) as required node cell for track block endpoint
- Fix XML: resolve duplicate segment-A conflict at (16,20) via segment B for diagonal approach

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bedaHovorka bedaHovorka force-pushed the copilot/improve-switch-layout-praha branch from 322dcf6 to 65aefb4 Compare April 19, 2026 17:41
Copilot AI and others added 6 commits April 19, 2026 20:07
Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
…e duplicate at (52,22)

Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
…erge switch

Added inline XML comment at (52,20) switch to explain why it uses
SIMPLE_RIGHT_TRUE while other south layer-3 merge switches use
SIMPLE_RIGHT_FALSE: this switch needs segment D accessible for the
Y=22 car-train terminal siding track (added in this PR).

Addresses review feedback "changed switches orientation (segments?)".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…alidation (#347)

- Exact element counts (12 InOuts, 41 switches, 56 signals, 111 blocks)
- N-Bypass and S-CarTrain InOut presence and orientation
- Bypass route navigability (N-Bypass → S-Bypass)
- Car train terminal reachability via bypass corridor
- Switch orientation domain correctness at (6,20) and (52,20)
- Fix XML: add RailSemaphore at (52,22) as required node cell for track block endpoint
- Fix XML: resolve duplicate segment-A conflict at (16,20) via segment B for diagonal approach

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bedaHovorka bedaHovorka force-pushed the copilot/improve-switch-layout-praha branch from 65aefb4 to 2af9e91 Compare April 19, 2026 18:07
@sonarqubecloud
Copy link
Copy Markdown

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.

Praha Hlavní Nádraží XML: Minor switch layout improvements

2 participants