From 1f16687c3e48e6c4e444b0a4a99643d6bf8a7c69 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Sat, 9 Mar 2019 12:20:00 -0800 Subject: [PATCH] flag for num_agents in UI too --- editor/src/plugins/sim/controls.rs | 13 +++++++------ editor/src/state.rs | 4 ++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/editor/src/plugins/sim/controls.rs b/editor/src/plugins/sim/controls.rs index f1fb0ebec3..543e51de81 100644 --- a/editor/src/plugins/sim/controls.rs +++ b/editor/src/plugins/sim/controls.rs @@ -148,12 +148,13 @@ impl AmbientPluginWithPrimaryPlugins for SimControls { // Interactively spawning stuff would ruin an A/B test, don't allow it if ctx.primary.sim.is_empty() && ctx.input.action_chosen("seed the sim with agents") { - Scenario::small_run(&ctx.primary.map).instantiate( - &mut ctx.primary.sim, - &ctx.primary.map, - &mut ctx.primary.current_flags.sim_flags.make_rng(), - &mut Timer::new("seed sim"), - ); + Scenario::scaled_run(&ctx.primary.map, ctx.primary.current_flags.num_agents) + .instantiate( + &mut ctx.primary.sim, + &ctx.primary.map, + &mut ctx.primary.current_flags.sim_flags.make_rng(), + &mut Timer::new("seed sim"), + ); *ctx.recalculate_current_selection = true; } diff --git a/editor/src/state.rs b/editor/src/state.rs index a8e02809d3..2f0a9e9308 100644 --- a/editor/src/state.rs +++ b/editor/src/state.rs @@ -40,6 +40,10 @@ pub struct Flags { /// Enable cpuprofiler? #[structopt(long = "enable_profiler")] pub enable_profiler: bool, + + /// Number of agents to generate when small_spawn called + #[structopt(long = "num_agents", default_value = "100")] + pub num_agents: usize, } pub trait UIState {