mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 12:12:00 +03:00
just small cleanups. taking a break from gridlock / map quality for a while.
This commit is contained in:
parent
01bd4aec6f
commit
270c7d0712
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2654,7 +2654,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
[[package]]
|
||||
name = "seattle_traffic_signals"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/dabreegster/seattle_traffic_signals#57023abfe62a50e8c34aab977eb7909dc3f27370"
|
||||
source = "git+https://github.com/dabreegster/seattle_traffic_signals#240df13bd5485325157e073d9b939bdea5581d6e"
|
||||
dependencies = [
|
||||
"include_dir 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -224,15 +224,15 @@ d02d0d103f7b00672a5f1145c5169d8c data/system/fonts/Overpass-Bold.ttf
|
||||
2a13391023ce8787887331530cac35a7 data/system/fonts/BungeeInline-Regular.ttf
|
||||
17a1468e62195d0688a6f3bd12da2e92 data/system/fonts/Overpass-SemiBold.ttf
|
||||
259d4afad7edca07e727ef80f5bbce07 data/system/fonts/Bungee-Regular.ttf
|
||||
81c2d11a033555efb78d8ec07ccecf80 data/system/maps/huge_seattle.bin
|
||||
e40060350ec5dcfc1049f00d3c73691c data/system/maps/huge_seattle.bin
|
||||
32585d4a4d10b56e5d03b7bfd997e270 data/system/maps/ballard.bin
|
||||
32204ce12eecd28829f4951c1b77ae16 data/system/maps/downtown.bin
|
||||
987b161dc0dbf9f791f4c602d285d369 data/system/maps/caphill.bin
|
||||
eca90c51326fedc60cbd4f4e9481ddc0 data/system/maps/lakeslice.bin
|
||||
868672d2b73b55c945730528b058022e data/system/maps/caphill.bin
|
||||
d92351e6246bf8052baffd4b30ab8959 data/system/maps/lakeslice.bin
|
||||
4961886805fc8a5576a37cffc6adc9be data/system/maps/huge_austin.bin
|
||||
94d44bfd4c5e2431c7f8555943e70709 data/system/maps/downtown_atx.bin
|
||||
930d7b8add199635e19a8b701a3d3d8a data/system/maps/montlake.bin
|
||||
a5252a956553ea999b1969a89b2d5cf7 data/system/maps/intl_district.bin
|
||||
919e9d01d680ffa731b771890ba8de26 data/system/maps/intl_district.bin
|
||||
2857ce1b2e3b233323a04d459d533024 data/system/maps/downtown_la.bin
|
||||
a9aaaaea906cc620f1710be5dc316a80 data/system/maps/23rd.bin
|
||||
cc45f42cb24cad1cfdbf5ed7a0cb86d4 data/system/synthetic_maps/signal_double.json
|
||||
|
@ -22,6 +22,7 @@ use sim::{
|
||||
};
|
||||
|
||||
// TODO Unfortunately this has to be tuned when major map / simulation changes happen.
|
||||
// TODO Aaand this broke, because all the cars seemingly park inside now. :P
|
||||
const ESCORT: CarID = CarID(34, VehicleType::Car);
|
||||
const CAR_BIKE_CONTENTION_GOAL: Duration = Duration::const_seconds(60.0);
|
||||
|
||||
@ -979,7 +980,7 @@ impl TutorialState {
|
||||
Stage::new(Task::TimeControls)
|
||||
.warp_to(
|
||||
ID::Intersection(map.find_i_by_osm_id(53096945).unwrap()),
|
||||
None,
|
||||
Some(6.5),
|
||||
)
|
||||
.msg(
|
||||
vec![
|
||||
|
@ -255,13 +255,10 @@ impl IntersectionSimState {
|
||||
if let Some((car, _, queues)) = maybe_cars_and_queues {
|
||||
assert_eq!(agent, AgentID::Car(car.vehicle.id));
|
||||
let queue = queues.get_mut(&Traversable::Lane(turn.dst)).unwrap();
|
||||
// TODO Disable this policy for a particular intersection where a traffic signal is
|
||||
// surrounded by a tiny lane with almost no capacity. Generalization later, make
|
||||
// progress for now.
|
||||
let osm_node_id = map.get_i(turn.parent).orig_id.osm_node_id;
|
||||
if !queue.try_to_reserve_entry(
|
||||
car,
|
||||
!self.dont_block_the_box || osm_node_id == 53211694 || osm_node_id == 53211693,
|
||||
!self.dont_block_the_box
|
||||
|| allow_block_the_box(map.get_i(turn.parent).orig_id.osm_node_id),
|
||||
) {
|
||||
if self.break_turn_conflict_cycles {
|
||||
// TODO Should we run the detector here?
|
||||
@ -559,18 +556,9 @@ impl IntersectionSimState {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Various problems (bad geometry, multi-intersection turn restrictions) cause
|
||||
// vehicles to unrealistically block each other here. Make progress.
|
||||
let osm_node_id = map.get_i(req.turn.parent).orig_id.osm_node_id;
|
||||
let allow_conflict = osm_node_id == 29449863
|
||||
|| osm_node_id == 29464223
|
||||
|| osm_node_id == 3391701882
|
||||
|| osm_node_id == 3391701883
|
||||
|| osm_node_id == 3978753095
|
||||
|| osm_node_id == 1709141982
|
||||
|| osm_node_id == 1709142313
|
||||
|| osm_node_id == 1709142595;
|
||||
if !cycle_detected && !allow_conflict {
|
||||
if !cycle_detected
|
||||
&& !allow_conflicting_turns(map.get_i(req.turn.parent).orig_id.osm_node_id)
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
|
||||
@ -627,3 +615,25 @@ impl IntersectionSimState {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Sometimes a traffic signal is surrounded by tiny lanes with almost no capacity. Workaround
|
||||
// for now.
|
||||
fn allow_block_the_box(osm_node_id: i64) -> bool {
|
||||
// 23rd and Madison
|
||||
osm_node_id == 53211694 || osm_node_id == 53211693
|
||||
}
|
||||
|
||||
// TODO Various problems (bad geometry, multi-intersection turn restrictions) cause
|
||||
// vehicles to unrealistically block each other.
|
||||
#[rustfmt::skip]
|
||||
fn allow_conflicting_turns(osm_node_id: i64) -> bool {
|
||||
vec![
|
||||
// Montlake and 520
|
||||
29449863, 29464223, 3391701882, 3391701883,
|
||||
// Boyer and Lynn
|
||||
3978753095,
|
||||
// Boyer and 26th
|
||||
1709141982, 1709142313, 1709142595,
|
||||
]
|
||||
.contains(&osm_node_id)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user