mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 17:34:58 +03:00
flag for num_agents in UI too
This commit is contained in:
parent
5bba5ce31e
commit
1f16687c3e
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user