scml.scml2020.components.negotiation
Classes
A negotiation manager is a component that provides negotiation control functionality to an agent |
|
A negotiation manager that controls a controller and another for selling for every timestep |
|
A negotiation manager that manages independent negotiators that do not share any information once created |
|
My negotiation strategy |
Module Contents
- class scml.scml2020.components.negotiation.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]
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:
start_negotiationsAn easy to use method to start a set of buy/sell negotiations
- Requires:
- Abstract:
- Hooks Into:
- Remarks:
Attributessection describes the attributes that can be used to construct the component (passed to its__init__method).Providessection 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 theBasessection above for all the bases of this component).Requiressection 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 componentAbstract Objects Layersection describes abstract methods that MUST be implemented by any descendant of this component.Hooks Intosection describes the methods this component overrides callingsuper() which allows other components to hook into the same method (by overriding it). Usually callbacks starting withon_are hooked into this way.Overridessection describes the methods this component overrides without callingsupereffectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting withon_) are overridden this way.
- start_negotiations(product: int, quantity: int, unit_price: int, step: int, partners: List[str] = None) None[source]
Starts a set of negotiations to buy/sell the product with the given limits
- Parameters:
product – product type. If it is an input product, negotiations to buy it will be started otherweise to sell.
quantity – The maximum quantity to negotiate about
unit_price – The maximum/minimum unit price for buy/sell
step – The maximum/minimum time for buy/sell
partners – A list of partners to negotiate with
Remarks:
This method assumes that product is either my_input_product or my_output_product
- on_contracts_finalized(signed: List[negmas.Contract], cancelled: List[negmas.Contract], rejectors: List[List[str]]) None[source]
- _generate_negotiations(step: int, sell: bool) None[source]
Generates all the required negotiations for selling/buying for the given step
- target_quantities(steps: Tuple[int, int], sell: bool) numpy.ndarray[source]
Returns the target quantity to negotiate about for each step in the range given (beginning included and ending excluded) for buying/selling
- Parameters:
steps – Simulation step
sell – Sell or buy
- abstract _start_negotiations(product: int, sell: bool, step: int, qvalues: Tuple[int, int], uvalues: Tuple[int, int], tvalues: Tuple[int, int], partners: List[str]) None[source]
Actually start negotiations with the given agenda
- Parameters:
product – The product to negotiate about.
sell – If true, this is a sell negotiation
step – The step
qvalues – the range of quantities
uvalues – the range of unit prices
tvalues – the range of times
partners – partners
- abstract target_quantity(step: int, sell: bool) int[source]
Returns the target quantity to sell/buy at a given time-step
- Parameters:
step – Simulation step
sell – Sell or buy
- class scml.scml2020.components.negotiation.StepNegotiationManager(*args, negotiator_type: negmas.SAONegotiator | str = AspirationNegotiator, negotiator_params: Dict[str, Any] | None = None, **kwargs)[source]
Bases:
scml.scml2020.components.prediction.MeanERPStrategy,NegotiationManagerA negotiation manager that controls a controller and another for selling for every timestep
- Parameters:
negotiator_type – The negotiator type to use to manage all negotiations
negotiator_params – Paramters of the negotiator
- Provides:
- Requires:
- Hooks Into:
- Remarks:
Attributessection describes the attributes that can be used to construct the component (passed to its__init__method).Providessection 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 theBasessection above for all the bases of this component).Requiressection 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 componentAbstract Objects Layersection describes abstract methods that MUST be implemented by any descendant of this component.Hooks Intosection describes the methods this component overrides callingsuper() which allows other components to hook into the same method (by overriding it). Usually callbacks starting withon_are hooked into this way.Overridessection describes the methods this component overrides without callingsupereffectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting withon_) are overridden this way.
- _start_negotiations(product: int, sell: bool, step: int, qvalues: Tuple[int, int], uvalues: Tuple[int, int], tvalues: Tuple[int, int], partners: List[str]) None[source]
Actually start negotiations with the given agenda
- Parameters:
product – The product to negotiate about.
sell – If true, this is a sell negotiation
step – The step
qvalues – the range of quantities
uvalues – the range of unit prices
tvalues – the range of times
partners – partners
- respond_to_negotiation_request(initiator: str, issues: List[negmas.Issue], annotation: Dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface) negmas.Negotiator | None[source]
- all_negotiations_concluded(controller_index: int, is_seller: bool) None[source]
Called by the
StepControllerto affirm that it is done negotiating for some time-step
- add_controller(is_seller: bool, target, urange: Tuple[int, int], expected_quantity: int, step: int) scml.scml2020.services.controllers.StepController[source]
- insert_controller(controller: scml.scml2020.services.controllers.StepController, is_seller: bool, target, urange: Tuple[int, int], expected_quantity: int, step: int = None) scml.scml2020.services.controllers.StepController[source]
- create_controller(is_seller: bool, target, urange: Tuple[int, int], expected_quantity: int, step: int) scml.scml2020.services.controllers.StepController[source]
- _get_controller(mechanism) scml.scml2020.services.controllers.StepController[source]
- class scml.scml2020.components.negotiation.IndependentNegotiationsManager(*args, negotiator_type: negmas.SAONegotiator | str = AspirationNegotiator, negotiator_params: Dict[str, Any] | None = None, **kwargs)[source]
Bases:
NegotiationManagerA negotiation manager that manages independent negotiators that do not share any information once created
- Parameters:
negotiator_type – The negotiator type to use to manage all negotiations
negotiator_params – Parameters of the negotiator
- Requires:
- Hooks Into:
- Remarks:
Attributessection describes the attributes that can be used to construct the component (passed to its__init__method).Providessection 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 theBasessection above for all the bases of this component).Requiressection 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 componentAbstract Objects Layersection describes abstract methods that MUST be implemented by any descendant of this component.Hooks Intosection describes the methods this component overrides callingsuper() which allows other components to hook into the same method (by overriding it). Usually callbacks starting withon_are hooked into this way.Overridessection describes the methods this component overrides without callingsupereffectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting withon_) are overridden this way.
- _start_negotiations(product: int, sell: bool, step: int, qvalues: Tuple[int, int], uvalues: Tuple[int, int], tvalues: Tuple[int, int], partners: List[str]) None[source]
Actually start negotiations with the given agenda
- Parameters:
product – The product to negotiate about.
sell – If true, this is a sell negotiation
step – The step
qvalues – the range of quantities
uvalues – the range of unit prices
tvalues – the range of times
partners – partners
- respond_to_negotiation_request(initiator: str, issues: List[negmas.Issue], annotation: Dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface) negmas.Negotiator | None[source]
- class scml.scml2020.components.negotiation.MovingRangeNegotiationManager(*args, price_weight=0.7, utility_threshold=0.9, time_threshold=0.9, time_horizon=0.1, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]
My negotiation strategy
- Parameters:
price_weight – The relative importance of price in the utility calculation.
utility_threshold – The fraction of maximum utility above which all offers will be accepted.
time_threshold – The fraction of the negotiation time after which any valid offers will be accepted.
time_range – The time-range for each controller as a fraction of the number of simulation steps
- Hooks Into:
- Remarks:
Attributessection describes the attributes that can be used to construct the component (passed to its__init__method).Providessection 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 theBasessection above for all the bases of this component).Requiressection 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 componentAbstract Objects Layersection describes abstract methods that MUST be implemented by any descendant of this component.Hooks Intosection describes the methods this component overrides callingsuper() which allows other components to hook into the same method (by overriding it). Usually callbacks starting withon_are hooked into this way.Overridessection describes the methods this component overrides without callingsupereffectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting withon_) are overridden this way.
- controllers: Dict[bool, scml.scml2020.services.controllers.SyncController][source]