From 28d0469d10a68fc8ff08483b4b6772b730da3372 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Mon, 20 Jul 2020 16:16:01 -0700 Subject: [PATCH] filter out random border no-op trips. they crash poor berlin --- sim/src/make/generator.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sim/src/make/generator.rs b/sim/src/make/generator.rs index fbb3769980..7d31d7d150 100644 --- a/sim/src/make/generator.rs +++ b/sim/src/make/generator.rs @@ -471,6 +471,11 @@ impl ScenarioGenerator { let random_outgoing_border = outgoing_connections.choose(rng).unwrap(); let b_random_incoming_border = incoming_connections.choose(rng).unwrap(); let b_random_outgoing_border = outgoing_connections.choose(rng).unwrap(); + if random_incoming_border.id == random_outgoing_border.id + || b_random_incoming_border.id == b_random_outgoing_border.id + { + continue; + } // TODO calculate let distance_on_map = Distance::meters(2000.0); // TODO randomize