StepNegotiationManager

class scml.scml2020.StepNegotiationManager(*args, negotiator_type=<class 'negmas.sao.negotiators.timebased.AspirationNegotiator'>, negotiator_params=None, **kwargs)[source]

Bases: scml.scml2020.components.prediction.MeanERPStrategy, scml.scml2020.components.negotiation.NegotiationManager

A negotiation manager that controls a controller and another for selling for every timestep

Parameters
  • negotiator_type (Union[SAONegotiator, str]) – The negotiator type to use to manage all negotiations

  • negotiator_params (Optional[Dict[str, Any]]) – Paramters of the negotiator

Provides:
Requires:
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

internal_state

use_trading

Methods Summary

acceptable_unit_price(step, sell)

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

add_controller(is_seller, target, urange, ...)

rtype

StepController

all_negotiations_concluded(controller_index, ...)

Called by the StepController to affirm that it is done negotiating for some time-step

create_controller(is_seller, target, urange, ...)

rtype

StepController

init()

insert_controller(controller, is_seller, ...)

rtype

StepController

on_contract_breached(contract, breaches, ...)

rtype

None

on_contract_executed(contract)

rtype

None

on_contracts_finalized(signed, cancelled, ...)

rtype

None

predict_quantity(contract)

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

internal_state
use_trading

Methods Documentation

abstract acceptable_unit_price(step, sell)

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

add_controller(is_seller, target, urange, expected_quantity, step)[source]
Return type

StepController

all_negotiations_concluded(controller_index, is_seller)[source]

Called by the StepController to affirm that it is done negotiating for some time-step

Return type

None

create_controller(is_seller, target, urange, expected_quantity, step)[source]
Return type

StepController

init()[source]
insert_controller(controller, is_seller, target, urange, expected_quantity, step=None)[source]
Return type

StepController

on_contract_breached(contract, breaches, resolution)
Return type

None

on_contract_executed(contract)
Return type

None

on_contracts_finalized(signed, cancelled, rejectors)
Return type

None

predict_quantity(contract)
respond_to_negotiation_request(initiator, issues, annotation, mechanism)[source]
Return type

Optional[Negotiator]

start_negotiations(product, quantity, unit_price, step, partners=None)

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 (Optional[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()

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

Parameters
Return type

ndarray

abstract target_quantity(step, sell)

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