Sweep#
- class Sweep(base_sim=None, sweep_pars=None, sweep_vars=None, n_draws=4, initialize=False, label=None, **kwargs)[source]#
Bases:
MultiSim
Class for running parameter sweeps.
- Parameters:
base_sim (Sim) – the sim used for shared properties
label (str) – the name of the multisim
kwargs (dict) – stored in run_args and passed to run()
- Returns:
a Sweep object
- Return type:
sweep
- Examples:
sim = hpv.Sim() # Create the sim sweep = hpv.Sweep(sim, sweep_pars={‘beta’:[0.4, 0.8]}, n_runs=5) # Create the sweep sweep.run() # Run the sims in parallel sweep.plot() # Plot results
Methods
- run(shrink=True, reduce=True, sum_totals=True, from_year=None, to_year=None, **kwargs)[source]#
Run the sims :type shrink: :param shrink: whether or not to shrink after running :type shrink: bool :type kwargs: :param kwargs: passed to multi_run(); use run_args to pass arguments to sim.run() :type kwargs: dict
- Returns:
None (modifies MultiSim object in place)
- Examples::
sweep.run()