midas.core.weather package¶
Submodules¶
midas.core.weather.meta module¶
This module contains the mosaik meta for the weather simulator.
midas.core.weather.simulator module¶
This module contains the Weather simulator.
-
class
midas.core.weather.simulator.
WeatherSimulator
¶ Bases:
mosaik_api.Simulator
The Weather simulator.
-
create
(num, model, **model_params)¶ Initialize the simulation model instance (entity).
- Parameters
num (int) – The number of models to create.
model (str) – The name of the models to create. Must be present inside the simulator’s meta.
- Returns
A list with information on the created entity.
- Return type
list
-
get_data
(outputs)¶ Return the requested output (if feasible).
- Parameters
outputs (dict) – A dict containing requested outputs of each entity.
- Returns
A dict containing the values of the requested outputs.
- Return type
dict
-
init
(sid, **sim_params)¶ Called exactly ones after the simulator has been started.
- Parameters
sid (str) – Simulator ID for this simulator.
start_date (str) – Start date as UTC ISO 8601 timestring such as ‘2019-01-01 00:00:00+0100’.
step_size (int, optional) – Step size for this simulator. Defaults to 900.
data_path (str, optional) – Path to the data folder. Defaults to the data folder in the midas root folder.
filename (str, optional) – Name of the weather database. Defaults to weather_bre2009-2019.hdf5, the file that is created by the midas.tools.weather_data.build_weather_data function.
interpolate (bool, optional) – If set to True, interpolation is enabled. Can be overwritten by model specific configuration.
seed (int, optional) – A seed for the random number generator.
randomize (bool, optional) – If set to True, randomization of data will be enabled. Otherwise, the data from the database is return unchanged. Can be overwritten by model specific configuration.
- Returns
The meta dict (set by mosaik_api.Simulator).
- Return type
dict
-
step
(time, inputs)¶ Perform a simulation step.
- Parameters
time (int) – The current simulation step (by convention in seconds since simulation start.
inputs (dict) – A dict containing inputs for entities of this simulator.
- Returns
The next step this simulator wants to be stepped.
- Return type
int
-