SimPars#

class SimPars(**kwargs)[source]#

Bases: Pars

Create the parameters for the simulation. Typically, this function is used internally rather than called by the user; e.g. typical use would be to do sim = ss.Sim() and then inspect sim.pars, rather than calling this function directly.

Parameters:
  • label (str) – The name of the simulation

  • n_agents (int/float) – The number of agents to run (default 10,000)

  • total_pop (int/float) – If provided, scale the agents to this effective population size

  • pop_scale (float) – If provided, use this agent-to-population scale factor (total_pop = n_agents*pop_scale)

  • unit (str) – The time unit for the simulation (default ‘year’; other choices are ‘day’, ‘week’, ‘month’)

  • start (float/str/date) – The starting date for the simulation (default 2000); can be a year or date

  • stop (float/str/date) – If provided, the ending date for the simulation (if not provided, calculate from “dur”)

  • dur (int) – How many timesteps to simulate, if “stop” is not provided (default 50)

  • dt (float) – The timestep, in units of “unit” (default 1.0)

  • rand_seed (int) – The overall random seed for the simulation (used to set module-specific random seeds)

  • birth_rate (float) – If provided, include births with this rate (per 1000 people per year)

  • death_rate (float) – If provided, include deaths with this rate (per 1000 people per year)

  • use_aging (bool) – Specify whether agents age (by default, agents age if and only if births and/or deaths are included)

  • people (People) – If provided, use a pre-existing People object rather than creating one (in which case n_agents will be ignored)

  • networks (str/list/Module) – The network module(s); can be a string, single module (i.e. Network), or list

  • demographics (str/list/Module) – As above

  • diseases (str/list/Module) – As above

  • connectors (str/list/Module) – As above

  • interventions (str/list/Module) – As above

  • analyzers (str/list/Module) – As above

  • verbose (float) – How much detail to print (1 = every timestep, 0.1 = every 10 timesteps, etc.)

Methods

is_default(key)[source]#

Check if the provided value matches the default

validate()[source]#

Call parameter validation methods

validate_sim_pars()[source]#

Validate each of the parameter values

validate_verbose()[source]#

Validate verbosity

validate_agents()[source]#

Check that n_agents is supplied and convert to an integer

validate_total_pop()[source]#

Ensure one but not both of total_pop and pop_scale are defined

validate_time()[source]#

Ensure at least one of dur and stop is defined, but not both

validate_modules()[source]#

Validate modules passed in pars

validate_demographics()[source]#

Validate demographics-related input parameters

validate_networks()[source]#

Validate networks

convert_modules()[source]#

Convert different types of representations for modules into a standardized object representation that can be parsed and used by a Sim object. Used for starsim classes: - networks, - demographics, - diseases, - analyzers, - interventions, and - connectors.