annular.satellite_model.simple_demo =================================== .. py:module:: annular.satellite_model.simple_demo Attributes ---------- .. autoapisummary:: annular.satellite_model.simple_demo.logger Classes ------- .. autoapisummary:: annular.satellite_model.simple_demo.SimpleMultiHourBiddingStrategy annular.satellite_model.simple_demo.Bid annular.satellite_model.simple_demo.AutoIncrement Module Contents --------------- .. py:data:: logger .. py:class:: SimpleMultiHourBiddingStrategy(demands_path: str, forecasts_path: str, floor_price: int = 0, bid_margin: float = 0.05, horizon_size: int = 48, **kwargs) Bases: :py:obj:`annular.satellite_model.satellite_model.SatelliteModel` Simple multi-hour bidding strategy to bid for the lowest expected price at the cheapest expected hour. Demand is specified at its deadline. Any specified flexibility means it can be satisfied in any of the `n` earlier timesteps. :param demands_path: Path to csv file with demand values per timestamp, with different flexibility as separate columns named 'flex+N'. :type demands_path: str :param forecasts_path: Path to csv file with electricity price forecast information. If multiple forecasts columns are given, each is used in parallel to determine the bid curves. If only a single forecast is given, it will be adjusted using the `bid_curve_resolution` parameter to generate multiple forecasts in place. :type forecasts_path: str :param floor_price: Minimum price to bid at, defaults to 0. :type floor_price: int :param bid_margin: [0, ...) Amount of margin as a fraction to bid over the lowest found price within the look-ahead window. Example: 0.05 is interpreted as bidding 5% on top of the lowest found price. :type bid_margin: float :param horizon_size: full length of the horizon to use for an optimization iteration, i.e., bidding window + look ahead period, in number of snapshots. :type horizon_size: int :param kwargs: Any other keyword arguments are passed to the initialization of the base class. .. py:attribute:: _last_bids :type: list[Bid] :value: [] .. py:attribute:: cur_timestamp_idx :value: 0 .. py:attribute:: floor_price :value: 0 .. py:attribute:: bid_margin :value: 0.05 .. py:attribute:: horizon_size :value: 48 .. py:attribute:: demands :value: None .. py:attribute:: forecasts :value: None .. py:method:: determine_bids() -> pandas.DataFrame Determine when in the next bidding window we bid, and at what price. A bid is roughly determined as follows for each listed demand quantity: - Find the time of the cheapest expected price in the bidding window, i.e., the period for which bids have to be submitted. - If the flexibility extends _beyond_ the current bidding window, find the cheapest expected price within the available flexibility, and place a bid at that price + margin. - If there is no flexibility beyond the current bidding window, bid at the ceiling price instead. :returns: A collection of bids covering the next bid window. .. py:method:: meet_demand(market_price: numpy.ndarray | None, demand_met: numpy.ndarray | None) -> None Update the internal state to record the amount of demand that was met. Ensures all demand met is removed from the 'demand yet to be satisfied', and advances the internal 'clock' by one rolling horizon step. :param market_price: Price of electricity as provided per timestep. :param demand_met: Amount of demand that was met at the market price per timestep. :raises AssertionError: if any of the provided demand is under- or over-used. :raises ValueError: if any mandatory demand has not been satisfied by the given demand. .. py:method:: _get_horizon(length: int = None) -> pandas.Index Select the relevant horizon index values at the current timestamp index. :param length: length of the desired horizon in number of timestamps. Uses `self.horizon_size` when `None` is given. :returns: Pandas Index object of the selected horizon values. .. py:method:: _make_bid(time_idx: int, flexibility: int, prices_forecast: pandas.DataFrame) -> tuple[pandas.Timestamp, float] Give bid time and price for demand at given time and flexibility. :param time_idx: integer index of the demand that could be fulfilled within this bidding window :param flexibility: how many timesteps early this demand could be satisfied :param prices_forecast: forecast of electricity prices for the whole horizon in which the demand might be satisfied. :returns: Expected best timestamp for the bid (always within current bidding window) and the price for the bid. :rtype: tuple .. py:class:: Bid Bases: :py:obj:`tuple` .. py:attribute:: exclusive_group_id .. py:attribute:: profile_block_id .. py:attribute:: timestamp .. py:attribute:: quantity .. py:attribute:: price .. py:attribute:: demand_name .. py:attribute:: time_idx .. py:class:: AutoIncrement An auto-incrementing index counter starting at 0. .. py:attribute:: value :value: -1 .. py:method:: __call__() When called, increment the value by 1 and return.