pandemia.sim_factory¶
Builds a Simulator object. The SimulationFactory object builds a Simulator object gradually, by adding the various model layers and components.
Module Contents¶
Classes¶
Class that allows for gradual composition of a number of components, eventually outputting |
Attributes¶
- pandemia.sim_factory.log¶
- class pandemia.sim_factory.SimulationFactory(config: pandemia.config.Config)¶
Class that allows for gradual composition of a number of components, eventually outputting a Simulator object that can be used to run simulations with the given config.
- set_clock(clock: pandemia.clock.Clock) None¶
Sets clock
- set_vector_world(vector_world: pandemia.world.VectorWorld) None¶
Sets world model
- set_seasonal_effects_model(seasonal_effects_model: pandemia.components.seasonal_effects_model.SeasonalEffectsModel) None¶
Sets seasonal effects model
- set_health_model(health_model: pandemia.components.health_model.HealthModel) None¶
Sets health model
- set_movement_model(movement_model: pandemia.components.movement_model.MovementModel) None¶
Sets movement model
- set_hospitalization_and_death_model(hospitalization_and_death_model: pandemia.components.hospitalization_and_death_model.HospitalizationAndDeathModel) None¶
Sets hospitalization and death model
- set_testing_and_contact_tracing_model(testing_and_contact_tracing_model: pandemia.components.testing_and_contact_tracing_model.TestingAndContactTracingModel) None¶
Sets testing and contact tracing model
- set_vaccination_model(vaccination_model: pandemia.components.vaccination_model.VaccinationModel) None¶
Sets vaccination model
- set_travel_model(travel_model: pandemia.components.travel_model.TravelModel) None¶
Sets regional mixing model
- set_policy_maker_model(policy_maker_model: pandemia.components.policy_maker_model.PolicyMakerModel) None¶
Sets seasonal effects model
- build_clock_and_world()¶
Builds the model on which the simulator acts. The model consists of a clock, to represent time, and a world, representing regions. Each region consists of agents and locations, with agents able to perform activities in selected locations. There is also a scale factor, which can be used to rescale the numbers of agents and locations in each region
- build_components()¶
The model also features a number of components, representing agent mobility, health and number of other features. There is also a scale factor, which can be used to rescale the numbers of tests and vaccine doses given as input, the numbers of agents travelling between the regions, and the final output.
- build_reporters(telemetry_bus)¶
Instantiates reporters, which record output data on the simulation for analysis
- new_sim(telemetry_bus)¶
Return a new simulator based on the given config.
Telemetry data will be sent to the telemetry_bus provided (of type MessageBus)
- to_file(output_filename: str) None¶
Write an object to disk at the filename given.
- Parameters:
output_filename (str) – The filename to write to. Files get overwritten by default.
- Returns:
None
- static from_file(input_filename: str) SimulationFactory¶
Read an object from disk from the filename given.
- Parameters:
input_filename (str) – The filename to read from.
- Returns:
The python object read from disk
- Return type:
obj(Object)