eelib.core.market.retail_electricity_provider.rep_simulator

Mosaik interface for the eELib retail electricity provider model. Simulator for communication between orchestrator (mosaik) and REP entities.

Within this interface mosaik functionalities are used. Copyright (c) LGPL

Author: elenia@TUBS
Copyright 2024 elenia
This file is part of eELib, which is free software under the terms of the GNU GPL Version 3.

Module Contents

Classes

Sim

Simulator class for eELib retail electricity provider model.

Attributes

ADAPTION_TOLERANCE

META

ADAPTION_TOLERANCE
META
class Sim

Bases: mosaik_api_v3.Simulator

Simulator class for eELib retail electricity provider 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 REP:Sim class.

Parameters:
  • sid (str) – Id of the created instance of the load simulator (e.g. REPSim-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, init_vals)

Creates instances of the eELib retail electricity provider model.

Parameters:
  • num (int) – Number of REP models to be created

  • model_type (str) – Description of the created instance (here “RetailElectricityProvider”)

  • init_vals (list) – List (length=num) with initial values for each REP model

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 retail electricity provider model.

Parameters:
  • time (int) – Current simulation time according to step size. Given by MOSAIK.

  • inputs (dict) – Is a dictionary, that maps entity IDs to data dictionaries which map attribute names to lists of values. Given by MOSAIK.

  • max_advance (int, optional) – Is the simulation time until the simulator can safely advance it’s internal time without causing any causality errors.

Raises:

TypeError – value_dict has unknown format

Returns:

New time stamp (time increased by step size)

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 REP model

Raises:

ValueError – Error if attribute not in model metadata

Returns:

Dictionary with simulation outputs

Return type:

dict

add_market_entity(market_entity_eid: str, market_dict: dict)

Adds market entities (e.g. market csv reader) to the specific REP entity.

Parameters:
  • market_entity_eid (str) – entity id of REP entity

  • market_dict (dict) – Dictionary of market models to be added to the REP entity