eelib.core.devices.charging_station.charging_station_simulator
Mosaik interface for the eELib charging station model. Simulator for communication between orchestrator (mosaik) and charging station entities.
Within this interface mosaik functionalities are used. Copyright (c) LGPL
Module Contents
Classes
Simulator class for eELib charging station model. |
Attributes
- ADAPTION_TOLERANCE
- META
- class Sim
Bases:
mosaik_api_v3.Simulator
Simulator class for eELib charging station model.
- Parameters:
mosaik_api_v3 (module) – defines communication between mosaik and simulator
- Raises:
ValueError – Unknown output attribute, when not described in META of simulator.
- init(sid, scenario_config, time_resolution=1.0)
Initializes parameters for an object of the Charging-Station:Sim class.
- Parameters:
sid (str) – Id of the created instance of the simulator (e.g. CSSim-0)
scenario_config (dict) – scenario configuration data, like resolution or step size
time_resolution (float) – Time resolution of current scenario.
- Returns:
description of the simulator
- Return type:
meta
- create(num, model_type, init_vals)
Creates entities of the eELib charging station model. Core function of mosaik.
- Parameters:
num (int) – Number of cs models to be created
model_type (str) – type of created instance (e.g. “charging_station”)
init_vals (list) – list with initial values for each charging_station entity
- 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 charging_station 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 – value_dict has unknown format
- Returns:
next time step (when orchestrator calls again)
- Return type:
int
- get_data(outputs)
Gets the data for the next connected model. Core function of mosaik.
- Parameters:
outputs (dict) – dictionary with data outputs from each entity
- Raises:
ValueError – error if attribute not in model metadata
- Returns:
dictionary with simulation outputs
- Return type:
dict