NegotiationManager

class scml.scml2020.NegotiationManager(*args, horizon=5, negotiate_on_signing=True, logdebug=False, use_trading_prices=True, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]

Bases: object

A negotiation manager is a component that provides negotiation control functionality to an agent

Parameters:

horizon – The number of steps in the future to consider for selling outputs.

Provides:
Requires:
Abstract:
Hooks Into:
Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

Attributes Summary

use_trading

Methods Summary

acceptable_unit_price(step, sell)

Returns the maximum/minimum acceptable unit price for buying/selling at the given time-step

init()

on_contracts_finalized(signed, cancelled, ...)

rtype:

None

respond_to_negotiation_request(initiator, ...)

rtype:

Optional[Negotiator]

start_negotiations(product, quantity, ...[, ...])

Starts a set of negotiations to buy/sell the product with the given limits

step()

Generates buy and sell negotiations as needed

target_quantities(steps, sell)

Returns the target quantity to negotiate about for each step in the range given (beginning included and ending excluded) for buying/selling

target_quantity(step, sell)

Returns the target quantity to sell/buy at a given time-step

Attributes Documentation

use_trading

Methods Documentation

abstract acceptable_unit_price(step, sell)[source]

Returns the maximum/minimum acceptable unit price for buying/selling at the given time-step

Parameters:
  • step (int) – Simulation step

  • sell (bool) – Sell or buy

Return type:

int

init()[source]
on_contracts_finalized(signed, cancelled, rejectors)[source]
Return type:

None

abstract respond_to_negotiation_request(initiator, issues, annotation, mechanism)[source]
Return type:

Optional[Negotiator]

start_negotiations(product, quantity, unit_price, step, partners=None)[source]

Starts a set of negotiations to buy/sell the product with the given limits

Parameters:
  • product (int) – product type. If it is an input product, negotiations to buy it will be started otherweise to sell.

  • quantity (int) – The maximum quantity to negotiate about

  • unit_price (int) – The maximum/minimum unit price for buy/sell

  • step (int) – The maximum/minimum time for buy/sell

  • partners (List[str]) – A list of partners to negotiate with

Remarks:

  • This method assumes that product is either my_input_product or my_output_product

Return type:

None

step()[source]

Generates buy and sell negotiations as needed

target_quantities(steps, sell)[source]

Returns the target quantity to negotiate about for each step in the range given (beginning included and ending excluded) for buying/selling

Parameters:
Return type:

ndarray

abstract target_quantity(step, sell)[source]

Returns the target quantity to sell/buy at a given time-step

Parameters:
  • step (int) – Simulation step

  • sell (bool) – Sell or buy

Return type:

int