annular.satellite_model.simple_demo

Attributes

logger

Classes

SimpleMultiHourBiddingStrategy

Simple multi-hour bidding strategy to bid for the lowest expected price at the cheapest expected hour.

Bid

AutoIncrement

An auto-incrementing index counter starting at 0.

Module Contents

annular.satellite_model.simple_demo.logger[source]
class annular.satellite_model.simple_demo.SimpleMultiHourBiddingStrategy(demands_path: str, forecasts_path: str, floor_price: int = 0, bid_margin: float = 0.05, horizon_size: int = 48, **kwargs)[source]

Bases: 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.

Parameters:
  • demands_path (str) – Path to csv file with demand values per timestamp, with different flexibility as separate columns named ‘flex+N’.

  • forecasts_path (str) – 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.

  • floor_price (int) – Minimum price to bid at, defaults to 0.

  • bid_margin (float) – [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.

  • horizon_size (int) – full length of the horizon to use for an optimization iteration, i.e., bidding window + look ahead period, in number of snapshots.

  • kwargs – Any other keyword arguments are passed to the initialization of the base class.

_last_bids: list[Bid] = [][source]
cur_timestamp_idx = 0[source]
floor_price = 0[source]
bid_margin = 0.05[source]
horizon_size = 48[source]
demands = None[source]
forecasts = None[source]
determine_bids() pandas.DataFrame[source]

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.

meet_demand(market_price: numpy.ndarray | None, demand_met: numpy.ndarray | None) None[source]

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.

Parameters:
  • market_price – Price of electricity as provided per timestep.

  • 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.

  • ValueError – if any mandatory demand has not been satisfied by the given demand.

_get_horizon(length: int = None) pandas.Index[source]

Select the relevant horizon index values at the current timestamp index.

Parameters:

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.

_make_bid(time_idx: int, flexibility: int, prices_forecast: pandas.DataFrame) tuple[pandas.Timestamp, float][source]

Give bid time and price for demand at given time and flexibility.

Parameters:
  • time_idx – integer index of the demand that could be fulfilled within this bidding window

  • flexibility – how many timesteps early this demand could be satisfied

  • 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.

Return type:

tuple

class annular.satellite_model.simple_demo.Bid[source]

Bases: tuple

exclusive_group_id[source]
profile_block_id[source]
timestamp[source]
quantity[source]
price[source]
demand_name[source]
time_idx[source]
class annular.satellite_model.simple_demo.AutoIncrement[source]

An auto-incrementing index counter starting at 0.

value = -1[source]
__call__()[source]

When called, increment the value by 1 and return.