eelib.core.grid.pandapower.pandapower_simulator
Mosaik interface for the eELib pandapower grid model. Simulator for communication between orchestrator (mosaik) and pandapower grid entities.
Within this interface mosaik functionalities are used. Copyright (c) LGPL
Module Contents
Classes
Simulator class for eELib pandapower grid model. |
Attributes
- ADAPTION_TOLERANCE
- META
- class Sim
Bases:
mosaik_api_v3.Simulator
Simulator class for eELib pandapower grid model.
- Parameters:
mosaik_api_v3 (module) – defines communication between mosaik and simulator
- init(sid, scenario_config, time_resolution=1.0, trigger=False)
Initializes parameters for an object of the Pandapower:Sim class.
- Parameters:
sid (str) – Id of the entity of the pandapower grid simulator (e.g. PandapowerSim-0)
scenario_config (dict) – scenario configuration data, like resolution or step size.
time_resolution (float) – Time resolution of current mosaik scenario.
trigger (boolean) – Whether power flow is triggered by events
- Returns:
meta description of the simulator
- Return type:
meta
- create(num, model_type, gridfile, sim_start=None)
Creates instances of the eELib pandapower model.
- Parameters:
num (int) – Number of pandapower models to be created
model_type (str) – Description of the created eELib-pandapower instance
gridfile (str) – directory of the file with the grid data
sim_start (str) – date of the simulation start
- Returns:
return created entities
- Return type:
dict
- setup_done()
Adjust entity IDs and activate components at the end of the grid setup.
- Yields:
related_components – grid components that are in relation to one another (e.g. bus and connected line)
- 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 pandapower grid 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.
- Returns:
next time step (when orchestrator calls again)
- Return type:
int
- get_data(outputs)
Gets the data for the next concatenated model. Core function of mosaik.
- Parameters:
outputs (dict) – Dictionary with data outputs from each storage model
- Raises:
ValueError – Error if attribute not in model metadata
KeyError – Error if component entity could not be found in pandapower grid
- Returns:
Dictionary with simulation outputs
- Return type:
dict