fix the contingency table filtering, make it easy to see scatter plot

diagonal, and get headless buildign again
This commit is contained in:
Dustin Carlino 2020-04-15 12:34:03 -07:00
parent 0418a48a23
commit 6b356bbc01
3 changed files with 11 additions and 10 deletions

View File

@ -61,6 +61,11 @@ impl ScatterPlot {
geom::Line::new(Pt2D::new(x, 0.0), Pt2D::new(x, height)).make_polygons(thickness),
);
}
// Draw the diagonal, since we're comparing things on the same scale
batch.push(
Color::grey(0.5),
geom::Line::new(Pt2D::new(0.0, height), Pt2D::new(width, 0.0)).make_polygons(thickness),
);
let circle = Circle::new(Pt2D::new(0.0, 0.0), Distance::meters(4.0)).to_polygon();
for (b, a) in points {

View File

@ -224,12 +224,7 @@ fn contingency_table(ctx: &mut EventCtx, app: &App, filter_changes_pct: Option<f
let mut losses_per_bucket: Vec<(Duration, usize)> = std::iter::repeat((Duration::ZERO, 0))
.take(num_buckets)
.collect();
for (b, a) in app
.primary
.sim
.get_analytics()
.both_finished_trips(app.primary.sim.time(), app.prebaked())
{
for (b, a) in points {
let before_mins = b.num_minutes_rounded_up();
let raw_idx = endpts.iter().rev().position(|x| before_mins >= *x).unwrap();
let mut idx = endpts.len() - 1 - raw_idx;

View File

@ -1,6 +1,6 @@
use abstutil::{CmdArgs, Timer};
use geom::Time;
use sim::{GetDrawAgents, Scenario, SimFlags};
use sim::{GetDrawAgents, ScenarioGenerator, SimFlags};
fn main() {
let mut args = CmdArgs::new();
@ -20,10 +20,11 @@ fn main() {
|| sim_flags.load.starts_with(&abstutil::path_all_maps())
{
let s = if let Some(n) = num_agents {
Scenario::scaled_run(&map, n)
ScenarioGenerator::scaled_run(n)
} else {
Scenario::small_run(&map)
};
ScenarioGenerator::small_run(&map)
}
.generate(&map, &mut rng, &mut timer);
s.instantiate(&mut sim, &map, &mut rng, &mut timer);
}
timer.done();