mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-26 16:02:23 +03:00
enable the new gridlock cycle breaker by default; it's helping immensely and doesnt seem to have problems
This commit is contained in:
parent
05b67b16fb
commit
e2cbb7a3e4
@ -151,10 +151,7 @@ fn launch_test(test: &ABTest, app: &mut App, ctx: &mut EventCtx) -> ABTestMode {
|
|||||||
.sim_flags
|
.sim_flags
|
||||||
.opts
|
.opts
|
||||||
.use_freeform_policy_everywhere,
|
.use_freeform_policy_everywhere,
|
||||||
disable_block_the_box: current_flags
|
dont_block_the_box: current_flags.sim_flags.opts.dont_block_the_box,
|
||||||
.sim_flags
|
|
||||||
.opts
|
|
||||||
.disable_block_the_box,
|
|
||||||
recalc_lanechanging: current_flags
|
recalc_lanechanging: current_flags
|
||||||
.sim_flags
|
.sim_flags
|
||||||
.opts
|
.opts
|
||||||
|
@ -33,9 +33,9 @@ impl SimFlags {
|
|||||||
.unwrap_or_else(|| "unnamed".to_string()),
|
.unwrap_or_else(|| "unnamed".to_string()),
|
||||||
savestate_every: args.optional_parse("--savestate_every", Duration::parse),
|
savestate_every: args.optional_parse("--savestate_every", Duration::parse),
|
||||||
use_freeform_policy_everywhere: args.enabled("--freeform_policy"),
|
use_freeform_policy_everywhere: args.enabled("--freeform_policy"),
|
||||||
disable_block_the_box: args.enabled("--disable_block_the_box"),
|
dont_block_the_box: !args.enabled("--disable_block_the_box"),
|
||||||
recalc_lanechanging: !args.enabled("--dont_recalc_lc"),
|
recalc_lanechanging: !args.enabled("--disable_recalc_lc"),
|
||||||
break_turn_conflict_cycles: args.enabled("--break_turn_conflict_cycles"),
|
break_turn_conflict_cycles: !args.enabled("--disable_break_turn_conflict_cycles"),
|
||||||
enable_pandemic_model: if args.enabled("--pandemic") {
|
enable_pandemic_model: if args.enabled("--pandemic") {
|
||||||
Some(XorShiftRng::from_seed([rng_seed; 16]))
|
Some(XorShiftRng::from_seed([rng_seed; 16]))
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,7 +18,7 @@ const WAIT_BEFORE_YIELD_AT_TRAFFIC_SIGNAL: Duration = Duration::const_seconds(0.
|
|||||||
pub struct IntersectionSimState {
|
pub struct IntersectionSimState {
|
||||||
state: BTreeMap<IntersectionID, State>,
|
state: BTreeMap<IntersectionID, State>,
|
||||||
use_freeform_policy_everywhere: bool,
|
use_freeform_policy_everywhere: bool,
|
||||||
force_queue_entry: bool,
|
dont_block_the_box: bool,
|
||||||
break_turn_conflict_cycles: bool,
|
break_turn_conflict_cycles: bool,
|
||||||
// (x, y) means x is blocked by y. It's a many-to-many relationship. TODO Better data
|
// (x, y) means x is blocked by y. It's a many-to-many relationship. TODO Better data
|
||||||
// structure.
|
// structure.
|
||||||
@ -44,13 +44,13 @@ impl IntersectionSimState {
|
|||||||
map: &Map,
|
map: &Map,
|
||||||
scheduler: &mut Scheduler,
|
scheduler: &mut Scheduler,
|
||||||
use_freeform_policy_everywhere: bool,
|
use_freeform_policy_everywhere: bool,
|
||||||
disable_block_the_box: bool,
|
dont_block_the_box: bool,
|
||||||
break_turn_conflict_cycles: bool,
|
break_turn_conflict_cycles: bool,
|
||||||
) -> IntersectionSimState {
|
) -> IntersectionSimState {
|
||||||
let mut sim = IntersectionSimState {
|
let mut sim = IntersectionSimState {
|
||||||
state: BTreeMap::new(),
|
state: BTreeMap::new(),
|
||||||
use_freeform_policy_everywhere,
|
use_freeform_policy_everywhere,
|
||||||
force_queue_entry: disable_block_the_box,
|
dont_block_the_box,
|
||||||
break_turn_conflict_cycles,
|
break_turn_conflict_cycles,
|
||||||
blocked_by: BTreeSet::new(),
|
blocked_by: BTreeSet::new(),
|
||||||
events: Vec::new(),
|
events: Vec::new(),
|
||||||
@ -270,7 +270,7 @@ impl IntersectionSimState {
|
|||||||
|
|
||||||
// Don't block the box
|
// Don't block the box
|
||||||
if let Some((queue, car)) = maybe_car_and_target_queue {
|
if let Some((queue, car)) = maybe_car_and_target_queue {
|
||||||
if !queue.try_to_reserve_entry(car, self.force_queue_entry) {
|
if !queue.try_to_reserve_entry(car, !self.dont_block_the_box) {
|
||||||
/*if debug {
|
/*if debug {
|
||||||
println!("{}: {} can't block box", now, agent)
|
println!("{}: {} can't block box", now, agent)
|
||||||
};*/
|
};*/
|
||||||
|
@ -71,7 +71,7 @@ pub struct SimOptions {
|
|||||||
pub run_name: String,
|
pub run_name: String,
|
||||||
pub savestate_every: Option<Duration>,
|
pub savestate_every: Option<Duration>,
|
||||||
pub use_freeform_policy_everywhere: bool,
|
pub use_freeform_policy_everywhere: bool,
|
||||||
pub disable_block_the_box: bool,
|
pub dont_block_the_box: bool,
|
||||||
pub recalc_lanechanging: bool,
|
pub recalc_lanechanging: bool,
|
||||||
pub break_turn_conflict_cycles: bool,
|
pub break_turn_conflict_cycles: bool,
|
||||||
pub enable_pandemic_model: Option<XorShiftRng>,
|
pub enable_pandemic_model: Option<XorShiftRng>,
|
||||||
@ -100,9 +100,9 @@ impl SimOptions {
|
|||||||
run_name: run_name.to_string(),
|
run_name: run_name.to_string(),
|
||||||
savestate_every: None,
|
savestate_every: None,
|
||||||
use_freeform_policy_everywhere: false,
|
use_freeform_policy_everywhere: false,
|
||||||
disable_block_the_box: false,
|
dont_block_the_box: true,
|
||||||
recalc_lanechanging: true,
|
recalc_lanechanging: true,
|
||||||
break_turn_conflict_cycles: false,
|
break_turn_conflict_cycles: true,
|
||||||
enable_pandemic_model: None,
|
enable_pandemic_model: None,
|
||||||
alerts: AlertHandler::Print,
|
alerts: AlertHandler::Print,
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ impl Sim {
|
|||||||
map,
|
map,
|
||||||
&mut scheduler,
|
&mut scheduler,
|
||||||
opts.use_freeform_policy_everywhere,
|
opts.use_freeform_policy_everywhere,
|
||||||
opts.disable_block_the_box,
|
opts.dont_block_the_box,
|
||||||
opts.break_turn_conflict_cycles,
|
opts.break_turn_conflict_cycles,
|
||||||
),
|
),
|
||||||
transit: TransitSimState::new(),
|
transit: TransitSimState::new(),
|
||||||
|
Loading…
Reference in New Issue
Block a user