eelib.core.forecast.forecast_simulator
Mosaik interface for the eELib energy management system (EMS) forecast. Simulator for communication between orchestrator (mosaik) and forecast.
Within this interface mosaik functionalities are used. Copyright (c) LGPL
Module Contents
Classes
Simulator class for eELib forecast model. |
Attributes
- META
- ADAPTION_TOLERANCE
- class Sim
Bases:
mosaik_api_v3.Simulator
Simulator class for eELib forecast model.
- Parameters:
mosaik_api_v3 (module) – defines communication between mosaik and simulator
- init(sid, scenario_config, time_resolution=1.0)
Initializer for Prognosis:Sim class.
- Parameters:
sid (str) – ID of the created entity of the simulator (e.g. PrognosisSim-0)
scenario_config (dict) – scenario configuration data, like resolution or step size
time_resolution (float) – fitting of the step size to the simulation scenario step size.
- Returns:
description of the simulator
- Return type:
meta
- create(num, model_type='forecast', init_vals=None)
Creates entities of the eELib forecast model. Core function of mosaik.
- Parameters:
num (int) – number of models to be created
model_type (str) – type of created entity, defaults to “forecast”
init_vals (list) – list with initial values for each EMS entity, defaults to None
- Returns:
created entities
- Return type:
dict
- get_entity_by_id(entity_id: str)
Searches for a requested entity id and gives back the entity model.
- Parameters:
entity_id (str) – id of the entity to be searched for
- Returns:
entity model if found, None otherwise
- Return type:
object
- step(time, inputs, max_advance)
Performs simulation step calling the eELib forecast model. Core function of mosaik.
- Parameters:
time (int) – current simulation time (given by mosaik)
inputs (dict) – allocation of set values to specific models
max_advance (int) – simulation time until the simulator can safely advance it’s internal time without causing any causality errors.
- Raises:
TypeError – if input has unknown format
- Returns:
next time step (when orchestrator calls again)
- Return type:
int
- get_data(outputs: dict)
Gets the data for the next concatenated model. Core function of mosaik.
- Parameters:
outputs (dict) – dictionary with data outputs from each prognosed model
- Raises:
ValueError – error if attribute not in model metadata
- Returns:
dictionary with simulation outputs
- Return type:
dict
- add_forecasted_entity(prognosed_entity_id: str, entity_dict: dict)
Adds entities (e.g. pv systems) to the specific forecast unit.
- Parameters:
prognosed_entity_id (str) – Dictionary of forecast entity
entity_dict (dict) – Dictionary of created models to be added to the forecast entity