Bidding strategies#

Submodules#

assume.strategies.extended module#

class assume.strategies.extended.OTCStrategy(*args, scale_firm_power_capacity=1.0, **kwargs)#

Bases: BaseStrategy

Strategy for OTC (over the counter trading) markets

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market

Returns a list of bids that the unit operator will submit to the market :param unit: unit to dispatch :type unit: SupportsMinMax :param market_config: market configuration :type market_config: MarketConfig :param product_tuples: list of products to dispatch :type product_tuples: list[Product] :param kwargs: additional arguments :type kwargs: dict :return: orderbook :rtype: Orderbook

assume.strategies.flexable module#

assume.strategies.flexable.calculate_EOM_price_if_off(unit: SupportsMinMax, start, marginal_cost_inflex, bid_quantity_inflex, op_time, avg_op_time=1)#

The powerplant is currently off and calculates a startup markup as an extra to the marginal cost Calculating the average uninterrupted operating period

Parameters:
  • unit (SupportsMinMax) – A unit that the unit operator manages

  • marginal_cost_inflex (float) – The marginal cost of the unit

  • bid_quantity_inflex (float) – The bid quantity of the unit

Returns:

The bid price of the unit

Return type:

float

assume.strategies.flexable.calculate_EOM_price_if_on(unit: SupportsMinMax, start, marginal_cost_flex, bid_quantity_inflex, foresight, avg_down_time=1)#

Check the description provided by Thomas in last version, the average downtime is available here The powerplant is currently on

Parameters:
  • unit (SupportsMinMax) – A unit that the unit operator manages

  • start (datetime) – The start time of the product

  • marginal_cost_inflex (float) – The marginal cost of the unit

  • bid_quantity_inflex (float) – The bid quantity of the unit

Returns:

The bid price of the unit

Return type:

float

assume.strategies.flexable.calculate_reward_EOM(unit, marketconfig: MarketConfig, orderbook: list[assume.common.market_objects.Order])#

Calculate reward (costs and profit) :param unit: Unit to calculate reward for :type unit: SupportsMinMax :param marketconfig: Market configuration :type marketconfig: MarketConfig :param orderbook: Orderbook :type orderbook: Orderbook

class assume.strategies.flexable.flexableEOM(*args, **kwargs)#

Bases: BaseStrategy

A strategy that bids on the EOM-market.

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market Returns a list of bids consisting of the start time, end time, only hours, price and volume.

Parameters:
  • unit (SupportsMinMax) – A unit that the unit operator manages

  • market_config (MarketConfig) – A market configuration

  • product_tuples (list[Product]) – A list of tuples containing the start and end time of each product

  • kwargs (dict) – Additional arguments

Returns:

A list of bids

Return type:

Orderbook

calculate_reward(unit, marketconfig: MarketConfig, orderbook: list[assume.common.market_objects.Order])#

Calculates the reward for the given unit

Parameters:
  • unit (BaseUnit) – the unit

  • marketconfig (MarketConfig) – The market configuration.

  • orderbook (Orderbook) – The orderbook.

class assume.strategies.flexable.flexableEOMBlock(*args, **kwargs)#

Bases: BaseStrategy

A strategy that bids on the EOM-market.

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market Returns a list of bids consisting of the start time, end time, only hours, price and volume.

Parameters:
  • unit (SupportsMinMax) – A unit that the unit operator manages

  • market_config (MarketConfig) – A market configuration

  • product_tuples (list[Product]) – A list of tuples containing the start and end time of each product

  • kwargs (dict) – Additional arguments

Returns:

A list of bids

Return type:

Orderbook

calculate_reward(unit, marketconfig: MarketConfig, orderbook: list[assume.common.market_objects.Order])#

Calculates the reward for the given unit

Parameters:
  • unit (BaseUnit) – the unit

  • marketconfig (MarketConfig) – The market configuration.

  • orderbook (Orderbook) – The orderbook.

class assume.strategies.flexable.flexableNegCRM(*args, **kwargs)#

Bases: BaseStrategy

A strategy that bids the energy_price or the capacity_price of the unit on the negative CRM(reserve market).

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market Returns a list of bids consisting of the start time, end time, only hours, price and volume.

Parameters:
  • unit (SupportsMinMax) – A unit that the unit operator manages

  • market_config (MarketConfig) – A market configuration

  • product_tuples (list[Product]) – A list of tuples containing the start and end time of each product

  • kwargs (dict) – Additional arguments

Returns:

A list of bids

Return type:

Orderbook

class assume.strategies.flexable.flexablePosCRM(*args, **kwargs)#

Bases: BaseStrategy

A strategy that bids the energy_price or the capacity_price of the unit on the CRM (reserve market).

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market Returns a list of bids consisting of the start time, end time, only hours, price and volume.

Parameters:
  • unit (SupportsMinMax) – A unit that the unit operator manages

  • market_config (MarketConfig) – A market configuration

  • product_tuples (list[Product]) – A list of tuples containing the start and end time of each product

  • kwargs (dict) – Additional arguments

Returns:

A list of bids

Return type:

Orderbook

assume.strategies.flexable.get_specific_revenue(unit: SupportsMinMax, marginal_cost: float, t: datetime, foresight: timedelta)#

get the specific revenue of a unit

Parameters:
  • unit (SupportsMinMax) – A unit that the unit operator manages

  • marginal_cost (float) – The marginal cost of the unit

  • t (datetime) – The start time of the product

  • foresight (timedelta) – The foresight of the unit

Returns:

The specific revenue of the unit

Return type:

float

assume.strategies.flexable_storage module#

assume.strategies.flexable_storage.calculate_price_average(unit, current_time, foresight, price_forecast)#

Calculates the average price for a given time period Returns the average price

Parameters:
  • unit (SupportsMinMaxCharge) – Unit that is dispatched

  • current_time (pd.Timestamp) – Current time

  • foresight (pd.Timedelta) – Foresight

  • price_forecast (pd.Series) – Price forecast

Returns:

Average price

Return type:

float

class assume.strategies.flexable_storage.flexableEOMStorage(*args, **kwargs)#

Bases: BaseStrategy

calculate_bids(unit: SupportsMinMaxCharge, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market

Parameters:
Returns:

bids containing start_time, end_time, only_hours, price, volume

Return type:

Orderbook

Strategy analogue to flexABLE

calculate_reward(unit, marketconfig: MarketConfig, orderbook: list[assume.common.market_objects.Order])#

Calculate reward (costs) :param unit: Unit to calculate reward for :type unit: SupportsMinMax :param marketconfig: Market configuration :type marketconfig: MarketConfig :param orderbook: Orderbook :type orderbook: Orderbook

class assume.strategies.flexable_storage.flexableNegCRMStorage(*args, **kwargs)#

Bases: BaseStrategy

calculate_bids(unit: SupportsMinMaxCharge, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market

Parameters:
Returns:

bids containing start_time, end_time, only_hours, price, volume

Return type:

Orderbook

class assume.strategies.flexable_storage.flexablePosCRMStorage(*args, **kwargs)#

Bases: BaseStrategy

calculate_bids(unit: SupportsMinMaxCharge, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market Returns bids containing start_time, end_time, only_hours, price, volume

Parameters:
Returns:

bids containing start_time, end_time, only_hours, price, volume

Return type:

Orderbook

assume.strategies.flexable_storage.get_specific_revenue(unit, marginal_cost, current_time, foresight, price_forecast)#

Calculates the specific revenue for a given time period Returns the specific revenue

Parameters:
  • unit (SupportsMinMaxCharge) – Unit that is dispatched

  • marginal_cost (float) – Marginal cost

  • current_time (pd.Timestamp) – Current time

  • foresight (pd.Timedelta) – Foresight

  • price_forecast (pd.Series) – Price forecast

Returns:

Specific revenue

Return type:

float

assume.strategies.learning_strategies module#

class assume.strategies.learning_strategies.RLStrategy(*args, **kwargs)#

Bases: LearningStrategy

Reinforcement Learning Strategy

Parameters:
  • foresight (int) – Number of time steps to look ahead. Default 24.

  • max_bid_price (float) – Maximum bid price

  • max_demand (float) – Maximum demand

  • device (str) – Device to run on

  • float_type (str) – Float type to use

  • learning_mode (bool) – Whether to use learning mode

  • actor (torch.nn.Module) – Actor network

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Calculate bids for a unit

Parameters:
Returns:

Bids containing start time, end time, price and volume

Return type:

Orderbook

calculate_reward(unit, marketconfig: MarketConfig, orderbook: list[assume.common.market_objects.Order])#

Calculate reward

Parameters:
  • unit (SupportsMinMax) – Unit to calculate reward for

  • marketconfig (MarketConfig) – Market configuration

  • orderbook (Orderbook) – Orderbook

create_observation(unit: SupportsMinMax, start: datetime, end: datetime)#

Create observation

Parameters:
  • unit (SupportsMinMax) – Unit to create observation for

  • start (datetime) – Start time

  • end (datetime) – End time

Returns:

Observation

Return type:

torch.Tensor

get_actions(next_observation)#

Get actions

Parameters:

next_observation (torch.Tensor) – Next observation

Returns:

Actions

Return type:

torch.Tensor

load_actor_params(load_path)#

Load actor parameters

Parameters:

simulation_id (str) – Simulation ID

assume.strategies.naive_strategies module#

class assume.strategies.naive_strategies.NaiveDAStrategy(*args, **kwargs)#

Bases: BaseStrategy

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Calculates the bids for the next time step.

Parameters:
Returns:

The bids

Return type:

Orderbook

class assume.strategies.naive_strategies.NaiveNegReserveStrategy(*args, **kwargs)#

Bases: BaseStrategy

A naive strategy that bids the ramp down volume on the negative reserve market (price = 0).

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market

Parameters:
  • unit (SupportsMinMax) – the unit to be dispatched

  • market_config (MarketConfig) – the market configuration

  • product_tuples (list[Product]) – list of all products the unit can offer

Returns:

the bids consisting of the start time, end time, only hours, price and volume.

Return type:

Orderbook

class assume.strategies.naive_strategies.NaivePosReserveStrategy(*args, **kwargs)#

Bases: BaseStrategy

A naive strategy that bids the ramp up volume on the positive reserve market (price = 0).

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market

Parameters:
  • unit (SupportsMinMax) – the unit to be dispatched

  • market_config (MarketConfig) – the market configuration

  • product_tuples (list[Product]) – list of all products the unit can offer

Returns:

the bids consisting of the start time, end time, only hours, price and volume.

Return type:

Orderbook

class assume.strategies.naive_strategies.NaiveStrategy(*args, **kwargs)#

Bases: BaseStrategy

A naive strategy that bids the marginal cost of the unit on the market.

calculate_bids(unit: SupportsMinMax, market_config: MarketConfig, product_tuples: list[assume.common.market_objects.Product], **kwargs) list[assume.common.market_objects.Order]#

Takes information from a unit that the unit operator manages and defines how it is dispatched to the market

Parameters:
  • unit (SupportsMinMax) – the unit to be dispatched

  • market_config (MarketConfig) – the market configuration

  • product_tuples (list[Product]) – list of all products the unit can offer

Returns:

the bids

Return type:

Orderbook

Module contents#