enable the new gridlock cycle breaker by default; it's helping immensely and doesnt seem to have problems

This commit is contained in:
Dustin Carlino 2020-04-27 11:18:36 -07:00
parent 05b67b16fb
commit e2cbb7a3e4
4 changed files with 12 additions and 15 deletions

View File

@ -151,10 +151,7 @@ fn launch_test(test: &ABTest, app: &mut App, ctx: &mut EventCtx) -> ABTestMode {
.sim_flags
.opts
.use_freeform_policy_everywhere,
disable_block_the_box: current_flags
.sim_flags
.opts
.disable_block_the_box,
dont_block_the_box: current_flags.sim_flags.opts.dont_block_the_box,
recalc_lanechanging: current_flags
.sim_flags
.opts

View File

@ -33,9 +33,9 @@ impl SimFlags {
.unwrap_or_else(|| "unnamed".to_string()),
savestate_every: args.optional_parse("--savestate_every", Duration::parse),
use_freeform_policy_everywhere: args.enabled("--freeform_policy"),
disable_block_the_box: args.enabled("--disable_block_the_box"),
recalc_lanechanging: !args.enabled("--dont_recalc_lc"),
break_turn_conflict_cycles: args.enabled("--break_turn_conflict_cycles"),
dont_block_the_box: !args.enabled("--disable_block_the_box"),
recalc_lanechanging: !args.enabled("--disable_recalc_lc"),
break_turn_conflict_cycles: !args.enabled("--disable_break_turn_conflict_cycles"),
enable_pandemic_model: if args.enabled("--pandemic") {
Some(XorShiftRng::from_seed([rng_seed; 16]))
} else {

View File

@ -18,7 +18,7 @@ const WAIT_BEFORE_YIELD_AT_TRAFFIC_SIGNAL: Duration = Duration::const_seconds(0.
pub struct IntersectionSimState {
state: BTreeMap<IntersectionID, State>,
use_freeform_policy_everywhere: bool,
force_queue_entry: bool,
dont_block_the_box: bool,
break_turn_conflict_cycles: bool,
// (x, y) means x is blocked by y. It's a many-to-many relationship. TODO Better data
// structure.
@ -44,13 +44,13 @@ impl IntersectionSimState {
map: &Map,
scheduler: &mut Scheduler,
use_freeform_policy_everywhere: bool,
disable_block_the_box: bool,
dont_block_the_box: bool,
break_turn_conflict_cycles: bool,
) -> IntersectionSimState {
let mut sim = IntersectionSimState {
state: BTreeMap::new(),
use_freeform_policy_everywhere,
force_queue_entry: disable_block_the_box,
dont_block_the_box,
break_turn_conflict_cycles,
blocked_by: BTreeSet::new(),
events: Vec::new(),
@ -270,7 +270,7 @@ impl IntersectionSimState {
// Don't block the box
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 {
println!("{}: {} can't block box", now, agent)
};*/

View File

@ -71,7 +71,7 @@ pub struct SimOptions {
pub run_name: String,
pub savestate_every: Option<Duration>,
pub use_freeform_policy_everywhere: bool,
pub disable_block_the_box: bool,
pub dont_block_the_box: bool,
pub recalc_lanechanging: bool,
pub break_turn_conflict_cycles: bool,
pub enable_pandemic_model: Option<XorShiftRng>,
@ -100,9 +100,9 @@ impl SimOptions {
run_name: run_name.to_string(),
savestate_every: None,
use_freeform_policy_everywhere: false,
disable_block_the_box: false,
dont_block_the_box: true,
recalc_lanechanging: true,
break_turn_conflict_cycles: false,
break_turn_conflict_cycles: true,
enable_pandemic_model: None,
alerts: AlertHandler::Print,
}
@ -124,7 +124,7 @@ impl Sim {
map,
&mut scheduler,
opts.use_freeform_policy_everywhere,
opts.disable_block_the_box,
opts.dont_block_the_box,
opts.break_turn_conflict_cycles,
),
transit: TransitSimState::new(),