eelib.core.devices.tes.tes_simulator
Mosaik interface for the eELib thermal energy storage (TES) model. Simulator for communication between orchestrator (mosaik) and TES entities.
Within this interface mosaik functionalities are used. Copyright (c) LGPL
Module Contents
Classes
Simulator class for eELib TES model. |
Attributes
- ADAPTION_TOLERANCE = '1e-05'
- META
- class Sim
Bases:
mosaik_api_v3.SimulatorSimulator class for eELib TES model.
- output_cache
- data
- entities
- init(sid: str, scenario_config: dict, time_resolution: int = 1) dict
Initializes parameters for an object of the TES:Sim class.
- Parameters:
sid (str) – Id of the created instance of the TES simulator (e.g. TESSim-0)
scenario_config (dict) – scenario configuration data, like resolution or step size.
time_resolution (int) – Time resolution of current mosaik scenario.
- Returns:
meta description of the simulator
- Return type:
dict
- create(num: int, model_type: str, init_vals: dict) dict
Creates instances of the eELib TES model.
- Parameters:
num (int) – Number of TES models to be created
model_type (str) – Description of the created TES instance
init_vals (dict) – Dict (length=num) with initial values for each TES model
- Raises:
ValueError – If entity ID is already existing
- Returns:
return created entities
- Return type:
dict
- get_entity_by_id(entity_id: str) eelib.core.devices.tes.tes_model.TES
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:
- step(time: int, inputs: dict, max_advance: int) int
Performs simulation step calling the eELib TES model. Core function of mosaik.
- Parameters:
time (int) – current simulation time (given by mosaik)
inputs (dict, optional) – allocation of return values to specific models
max_advance (int, optional) – simulation time until the simulator can safely advance it’s internal time without causing any causality errors.
- Raises:
ValueError – Error if more than one set value is tried to be given to entity
TypeError – if value_dict containing set values has an unknown format
- Returns:
next timestep (when orchestrator calls again)
- Return type:
int
- get_data(outputs: dict) dict
Gets the data for the next concatenated model. Core function of mosaik.
- Parameters:
outputs (dict) – Dictionary with data outputs from each TES model
- Raises:
ValueError – Error if attribute not in model metadata
- Returns:
Dictionary with simulation outputs
- Return type:
dict