mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 15:33:44 +03:00
fix the contingency table filtering, make it easy to see scatter plot
diagonal, and get headless buildign again
This commit is contained in:
parent
0418a48a23
commit
6b356bbc01
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user