Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add compatibility for G1 train gauge with FR3.3 track gauge #9824

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Set<RJSLoadingGaugeType> getCompatibleGaugeTypes() {
case GB1 -> Sets.union(Set.of(GB1), GB.getCompatibleGaugeTypes());
case GC -> Sets.union(Set.of(GC), GB1.getCompatibleGaugeTypes());
case G2 -> Sets.union(Set.of(G2, FR3_3_GB_G2), G1.getCompatibleGaugeTypes());
case FR3_3 -> Set.of(FR3_3, FR3_3_GB_G2);
case FR3_3 -> Sets.union(Set.of(FR3_3, FR3_3_GB_G2), G1.getCompatibleGaugeTypes());
case GLOTT -> Set.of(GLOTT);
default -> null;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,4 +725,16 @@ class PathPropertiesTests {
}
return LineString.make(latitudes.toDoubleArray(), longitudes.toDoubleArray())
}

@Test
fun testG1RollingStockLoadingGaugeCompatibility() {
// G1 train is compatible with any track gauge except GLOTT (not sure so default to not
// compatible) and FR3.3/GB/G2 that is not a track gauge
for (trackGauge in
RJSLoadingGaugeType.entries.minus(
listOf(RJSLoadingGaugeType.GLOTT, RJSLoadingGaugeType.FR3_3_GB_G2)
)) {
assert(trackGauge.compatibleGaugeTypes.contains(RJSLoadingGaugeType.G1))
}
}
}
Loading