eelib.data.csv_reader.csv_bulk_reader_simulator
Mosaik interface for the eELib csv-bulk-reader model. Simulator for communication between orchestrator (mosaik) and csv-bulk-reader entities.
Within this interface mosaik functionalities are used. Copyright (c) LGPL
Module Contents
Classes
Simulator class for eELib csv-bulk-reader model. |
Attributes
- META
- class Sim
Bases:
mosaik_api_v3.SimulatorSimulator class for eELib csv-bulk-reader model.
- entities
- init(sid: str, scenario_config: dict, time_resolution: float = 1.0) mosaik_api_v3.Meta
Initializes parameters for an object of the CSV-Reader:Sim class.
- Parameters:
sid (str) – ID of the created entity of the simulator (e.g. LoadSim-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:
mosaik_api_v3.Meta
- create(num: int, model_type: str, init_vals: list) dict
Creates entities of the eELib csv-bulk-reader model. Core function of mosaik.
- Parameters:
num (int) – number of load models to be created
model_type (str) – type of created instance (e.g. “household”)
init_vals (list) – list with initial values for each csv-reader entity
- Raises:
ValueError – If entity ID is already existing
- Returns:
created entities
- Return type:
dict
- get_entity_by_id(entity_id: str) object
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: int, inputs: dict, max_advance: int) int
Performs simulation step calling the eELib csv-reader model. Core function of mosaik.
- Parameters:
time (int) – current simulation time (given by mosaik)
inputs (dict, optional) – allocation of return values to specific models (NOT NEEDED FOR CSV-READER MODEL)
max_advance (int, optional) – simulation time until the simulator can safely advance it’s internal time without causing any causality errors.
- Returns:
next timestep (when orchestrator calls again)
- Return type:
int
- get_data(outputs: dict) dict
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