Skip to content

Commit 94c5597

Browse files
committed
Indicate error attempting to export a train skipping tracks
1 parent 741e09d commit 94c5597

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/simulation/TrainTrajectory.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,14 @@ cda_rail::sim::TrainTrajectory::convert_to_vss_format(
332332
if (instance_r.get().allow_reversing)
333333
throw std::runtime_error(
334334
"Converting solutions that allow reversing to VSS compatible solution "
335-
"is not yet supported, since position can't be easily represented in "
336-
"distance from starting point.");
335+
"is not yet supported, since position can't be easily represented as "
336+
"covered distance.");
337+
338+
if (instance_r.get().get_max_train_speed() >
339+
instance_r.get().get_shortest_track())
340+
throw std::runtime_error(
341+
"Max train speed is higher than smallest track size. "
342+
"Trains can skip tracks which is not representable as a 'Route'.");
337343

338344
const Network& network_unidirec = instance_r.get().network;
339345

0 commit comments

Comments
 (0)