scml.scml2020.components ======================== .. py:module:: scml.scml2020.components Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/scml/scml2020/components/negotiation/index /autoapi/scml/scml2020/components/prediction/index /autoapi/scml/scml2020/components/production/index /autoapi/scml/scml2020/components/signing/index /autoapi/scml/scml2020/components/simulation/index /autoapi/scml/scml2020/components/trading/index Attributes ---------- .. autoapisummary:: scml.scml2020.components.__all__ Classes ------- .. autoapisummary:: scml.scml2020.components.ProductionStrategy scml.scml2020.components.SupplyDrivenProductionStrategy scml.scml2020.components.DemandDrivenProductionStrategy scml.scml2020.components.TradeDrivenProductionStrategy scml.scml2020.components.TradePredictionStrategy scml.scml2020.components.FixedTradePredictionStrategy scml.scml2020.components.ExecutionRatePredictionStrategy scml.scml2020.components.FixedERPStrategy scml.scml2020.components.MeanERPStrategy scml.scml2020.components.MarketAwareTradePredictionStrategy scml.scml2020.components.SignAll scml.scml2020.components.SignAllPossible scml.scml2020.components.KeepOnlyGoodPrices scml.scml2020.components.NegotiationManager scml.scml2020.components.StepNegotiationManager scml.scml2020.components.IndependentNegotiationsManager scml.scml2020.components.MovingRangeNegotiationManager scml.scml2020.components.Simulation Package Contents ---------------- .. py:class:: ProductionStrategy(*args, **kwargs) Represents a strategy for controlling production. Provides: - `schedule_range` : A mapping from contract ID to a tuple of the first and last steps at which some lines are occupied to produce the quantity specified by the contract and whether it is a sell contract - `can_be_produced` : Given a contract, it returns whether or not it is possible to produce the quantity entailed by it (which means that there is enough vacant production line slots before/after the contracts delivery time for sell/buy contracts). Hooks Into: - `on_contract_breached` - `on_contract_executed` 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. .. py:attribute:: schedule_range :type: dict[str, tuple[int, int, bool]] Gives the range of steps at which the production needed for a given contract are scheduled .. py:method:: can_be_produced(contract_id: str) Returns True if the SELL contract given can be honored in principle given the production capacity of the agent (n. lines). It does not check for the availability of inputs or enough money to run the production process. Remarks: - Cannot be called before calling on_contracts_finalized .. py:method:: on_contract_executed(contract: negmas.Contract) -> None .. py:method:: on_contract_breached(contract: negmas.Contract, breaches, resolution) -> None .. py:class:: SupplyDrivenProductionStrategy(*args, **kwargs) Bases: :py:obj:`ProductionStrategy` A production strategy that converts all inputs to outputs Hooks Into: - `step` - `on_contracts_finalized` 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. .. py:method:: step() .. py:method:: on_contracts_finalized(signed: list[negmas.Contract], cancelled: list[negmas.Contract], rejectors: list[list[str]]) -> None .. py:class:: DemandDrivenProductionStrategy(*args, **kwargs) Bases: :py:obj:`ProductionStrategy` A production strategy that produces ONLY when a contract is secured Hooks Into: - `on_contract_finalized` 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. .. py:method:: on_contracts_finalized(signed: list[negmas.Contract], cancelled: list[negmas.Contract], rejectors: list[list[str]]) -> None .. py:class:: TradeDrivenProductionStrategy(*args, **kwargs) Bases: :py:obj:`ProductionStrategy` A production strategy that produces ONLY for contracts that the agent did not initiate. Hooks Into: - `on_contract_finalized` 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. .. py:method:: on_contracts_finalized(signed: list[negmas.Contract], cancelled: list[negmas.Contract], rejectors: list[list[str]]) -> None .. py:class:: TradePredictionStrategy(*args, predicted_outputs: Union[int, numpy.ndarray] = None, predicted_inputs: Union[int, numpy.ndarray] = None, add_trade=False, **kwargs) A prediction strategy for expected inputs and outputs at every step :param - `predicted_inputs`: None for default, a number of an n_steps numbers giving predicted inputs :param - `predicted_outputs`: None for default, a number of an n_steps numbers giving predicted outputs Provides: - `expected_inputs` : n_steps vector giving the predicted inputs at every time-step. It defaults to the number of lines. - `expected_outputs` : n_steps vector giving the predicted outputs at every time-step. It defaults to the number of lines. - `input_cost` : n_steps vector giving the predicted input cost at every time-step. It defaults to catalog price. - `output_price` : n_steps vector giving the predicted output price at every time-step. It defaults to catalog price. Hooks Into: - `init` - `before_step` - `step` Abstract: - `trade_prediction_init`: Called during init() to initialize the trade prediction. - `trade_prediction_step`: Called during step() to update the trade prediction. 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. .. py:attribute:: expected_outputs :value: None Expected output quantity every step .. py:attribute:: expected_inputs :value: None Expected input quantity every step .. py:attribute:: input_cost :type: numpy.ndarray :value: None Expected unit price of the input .. py:attribute:: output_price :type: numpy.ndarray :value: None Expected unit price of the output .. py:attribute:: _add_trade :value: False .. py:method:: trade_prediction_init() -> None :abstractmethod: Will be called to update expected_outputs, expected_inputs, input_cost, output_cost during init() .. py:method:: trade_prediction_before_step() -> None Will be called at the beginning of every step to update the prediction .. py:method:: trade_prediction_step() -> None Will be called at the end of every step to update the prediction .. py:method:: init() .. py:method:: before_step() .. py:method:: step() .. py:class:: FixedTradePredictionStrategy(*args, add_trade=True, **kwargs) Bases: :py:obj:`TradePredictionStrategy` Predicts a fixed amount of trade both for the input and output products. Hooks Into: - `internal_state` - `on_contracts_finalized` 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. .. py:attribute:: _add_trade :value: True .. py:method:: trade_prediction_init() Will be called to update expected_outputs, expected_inputs, input_cost, output_cost during init() .. py:property:: internal_state .. py:method:: on_contracts_finalized(signed: List[negmas.Contract], cancelled: List[negmas.Contract], rejectors: List[List[str]]) -> None .. py:class:: ExecutionRatePredictionStrategy A prediction strategy for expected inputs and outputs at every step Provides: - `predict_quantity` : A method for predicting the quantity that will actually be executed from a contract Abstract: - `predict_quantity` : A method for predicting the quantity that will actually be executed from a contract Hooks Into: - `internal_state` 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. .. py:method:: predict_quantity(contract: negmas.Contract) :abstractmethod: .. py:class:: FixedERPStrategy(*args, execution_fraction=0.95, **kwargs) Bases: :py:obj:`ExecutionRatePredictionStrategy` Predicts that the there is a fixed execution rate that does not change for all partners :param execution_fraction: The expected fraction of any contract's quantity to be executed Provides: - `predict_quantity` : A method for predicting the quantity that will actually be executed from a contract Hooks Into: - `internal_state` 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. .. py:attribute:: _execution_fraction :value: 0.95 .. py:method:: predict_quantity(contract: negmas.Contract) .. py:class:: MeanERPStrategy(*args, execution_fraction=0.95, **kwargs) Bases: :py:obj:`ExecutionRatePredictionStrategy` Predicts the mean execution fraction for each partner :param execution_fraction: The expected fraction of any contract's quantity to be executed Provides: - `predict_quantity` : A method for predicting the quantity that will actually be executed from a contract Hooks Into: - `internal_state` - `init` - `on_contract_executed` - `on_contract_breached` 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. .. py:attribute:: _execution_fraction :value: 0.95 .. py:attribute:: _total_quantity :value: None .. py:method:: predict_quantity(contract: negmas.Contract) .. py:method:: init() .. py:property:: internal_state .. py:method:: on_contract_executed(contract: negmas.Contract) -> None .. py:method:: on_contract_breached(contract: negmas.Contract, breaches: List[negmas.Breach], resolution: Optional[negmas.Contract]) -> None .. py:class:: MarketAwareTradePredictionStrategy(*args, predicted_outputs: Union[int, numpy.ndarray] = None, predicted_inputs: Union[int, numpy.ndarray] = None, add_trade=False, **kwargs) Bases: :py:obj:`TradePredictionStrategy` Predicts an amount based on publicly available market information. Falls back to fixed prediction if no information is available Hooks Into: - `internal_state` - `on_contracts_finalized` 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. .. py:method:: init() .. py:method:: trade_prediction_init() Will be called to update expected_outputs, expected_inputs, input_cost, output_cost during init() .. py:method:: __update() .. py:method:: trade_prediction_step() Will be called at the end of every step to update the prediction .. py:method:: trade_prediction_before_step() Will be called at the beginning of every step to update the prediction .. py:property:: internal_state .. py:class:: SignAll Signs all contracts no matter what. Overrides: - `sign_all_contracts` 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. .. py:method:: sign_all_contracts(contracts: List[negmas.Contract]) -> List[Optional[str]] .. py:class:: SignAllPossible Signs all contracts that can in principle be honored. The only check made by this strategy is that for sell contracts there is enough production capacity Overrides: - `sign_all_contracts` 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. .. py:method:: sign_all_contracts(contracts: List[negmas.Contract]) -> List[Optional[str]] .. py:class:: KeepOnlyGoodPrices(*args, buying_margin=0.5, selling_margin=0.5, **kwargs) Signs all contracts that have good prices Overrides: - `sign_all_contracts` .. attribute:: - buying_margin The margin from the catalog price to allow for buying. The agent will never buy at a price higher than the catalog price by more than this margin (relative to catalog price). .. attribute:: - selling_margin The margin from the catalog price to allow for selling. The agent will never sell at a price lower than the catalog price by more than this margin (relative to catalog price). 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. .. py:method:: sign_all_contracts(contracts: List[negmas.Contract]) -> List[Optional[str]] .. py:class:: 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) A negotiation manager is a component that provides negotiation control functionality to an agent :param horizon: The number of steps in the future to consider for selling outputs. Provides: - `start_negotiations` An easy to use method to start a set of buy/sell negotiations Requires: - `acceptable_unit_price` - `target_quantity` - OPTIONALLY `target_quantities` Abstract: - `respond_to_negotiation_request` Hooks Into: - `init` - `step` - `on_contracts_finalized` - `respond_to_negotiation_request` 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. .. py:attribute:: _horizon :value: 5 .. py:attribute:: _negotiate_on_signing :value: True .. py:attribute:: _log :value: False .. py:attribute:: _use_trading :value: True .. py:attribute:: _min_margin :value: 0.5 .. py:attribute:: _max_margin :value: 1.5 .. py:property:: use_trading .. py:method:: init() .. py:method:: start_negotiations(product: int, quantity: int, unit_price: int, step: int, partners: List[str] = None) -> None Starts a set of negotiations to buy/sell the product with the given limits :param product: product type. If it is an input product, negotiations to buy it will be started otherweise to sell. :param quantity: The maximum quantity to negotiate about :param unit_price: The maximum/minimum unit price for buy/sell :param step: The maximum/minimum time for buy/sell :param partners: A list of partners to negotiate with Remarks: - This method assumes that product is either my_input_product or my_output_product .. py:method:: step() Generates buy and sell negotiations as needed .. py:method:: on_contracts_finalized(signed: List[negmas.Contract], cancelled: List[negmas.Contract], rejectors: List[List[str]]) -> None .. py:method:: _generate_negotiations(step: int, sell: bool) -> None Generates all the required negotiations for selling/buying for the given step .. py:method:: _urange(step, is_seller, time_range) .. py:method:: _trange(step, is_seller) .. py:method:: target_quantities(steps: Tuple[int, int], sell: bool) -> numpy.ndarray Returns the target quantity to negotiate about for each step in the range given (beginning included and ending excluded) for buying/selling :param steps: Simulation step :param sell: Sell or buy .. py:method:: _start_negotiations(product: int, sell: bool, step: int, qvalues: Tuple[int, int], uvalues: Tuple[int, int], tvalues: Tuple[int, int], partners: List[str]) -> None :abstractmethod: Actually start negotiations with the given agenda :param product: The product to negotiate about. :param sell: If true, this is a sell negotiation :param step: The step :param qvalues: the range of quantities :param uvalues: the range of unit prices :param tvalues: the range of times :param partners: partners .. py:method:: target_quantity(step: int, sell: bool) -> int :abstractmethod: Returns the target quantity to sell/buy at a given time-step :param step: Simulation step :param sell: Sell or buy .. py:method:: acceptable_unit_price(step: int, sell: bool) -> int :abstractmethod: Returns the maximum/minimum acceptable unit price for buying/selling at the given time-step :param step: Simulation step :param sell: Sell or buy .. py:method:: respond_to_negotiation_request(initiator: str, issues: List[negmas.Issue], annotation: Dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface) -> Optional[negmas.Negotiator] :abstractmethod: .. py:class:: StepNegotiationManager(*args, negotiator_type: Union[negmas.SAONegotiator, str] = AspirationNegotiator, negotiator_params: Optional[Dict[str, Any]] = None, **kwargs) Bases: :py:obj:`scml.scml2020.components.prediction.MeanERPStrategy`, :py:obj:`NegotiationManager` A negotiation manager that controls a controller and another for selling for every timestep :param negotiator_type: The negotiator type to use to manage all negotiations :param negotiator_params: Paramters of the negotiator Provides: - `all_negotiations_concluded` Requires: - `acceptable_unit_price` - `target_quantity` - OPTIONALLY `target_quantities` Hooks Into: - `init` - `respond_to_negotiation_request` 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. .. py:attribute:: negotiator_type .. py:attribute:: negotiator_params :value: None .. py:method:: init() .. py:method:: _start_negotiations(product: int, sell: bool, step: int, qvalues: Tuple[int, int], uvalues: Tuple[int, int], tvalues: Tuple[int, int], partners: List[str]) -> None Actually start negotiations with the given agenda :param product: The product to negotiate about. :param sell: If true, this is a sell negotiation :param step: The step :param qvalues: the range of quantities :param uvalues: the range of unit prices :param tvalues: the range of times :param partners: partners .. py:method:: respond_to_negotiation_request(initiator: str, issues: List[negmas.Issue], annotation: Dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface) -> Optional[negmas.Negotiator] .. py:method:: all_negotiations_concluded(controller_index: int, is_seller: bool) -> None Called by the `StepController` to affirm that it is done negotiating for some time-step .. py:method:: add_controller(is_seller: bool, target, urange: Tuple[int, int], expected_quantity: int, step: int) -> scml.scml2020.services.controllers.StepController .. py:method:: 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 .. py:method:: create_controller(is_seller: bool, target, urange: Tuple[int, int], expected_quantity: int, step: int) -> scml.scml2020.services.controllers.StepController .. py:method:: _get_controller(mechanism) -> scml.scml2020.services.controllers.StepController .. py:class:: IndependentNegotiationsManager(*args, negotiator_type: Union[negmas.SAONegotiator, str] = AspirationNegotiator, negotiator_params: Optional[Dict[str, Any]] = None, **kwargs) Bases: :py:obj:`NegotiationManager` A negotiation manager that manages independent negotiators that do not share any information once created :param negotiator_type: The negotiator type to use to manage all negotiations :param negotiator_params: Parameters of the negotiator Requires: - `create_ufun` - `acceptable_unit_price` - `target_quantity` - OPTIONALLY `target_quantities` Hooks Into: - `respond_to_negotiation_request` 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. .. py:attribute:: negotiator_type .. py:attribute:: negotiator_params :value: None .. py:method:: _start_negotiations(product: int, sell: bool, step: int, qvalues: Tuple[int, int], uvalues: Tuple[int, int], tvalues: Tuple[int, int], partners: List[str]) -> None Actually start negotiations with the given agenda :param product: The product to negotiate about. :param sell: If true, this is a sell negotiation :param step: The step :param qvalues: the range of quantities :param uvalues: the range of unit prices :param tvalues: the range of times :param partners: partners .. py:method:: respond_to_negotiation_request(initiator: str, issues: List[negmas.Issue], annotation: Dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface) -> Optional[negmas.Negotiator] .. py:method:: create_ufun(is_seller: bool, issues=None, outcomes=None) -> negmas.UtilityFunction Creates a utility function .. py:method:: negotiator(is_seller: bool, issues=None, outcomes=None, partner=None) -> negmas.SAONegotiator Creates a negotiator .. py:class:: 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) My negotiation strategy :param price_weight: The relative importance of price in the utility calculation. :param utility_threshold: The fraction of maximum utility above which all offers will be accepted. :param time_threshold: The fraction of the negotiation time after which any valid offers will be accepted. :param time_range: The time-range for each controller as a fraction of the number of simulation steps Hooks Into: - `init` - `step` 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. .. py:attribute:: index :type: List[int] :value: None .. py:attribute:: time_horizon :value: 0.1 .. py:attribute:: _time_threshold :value: 0.9 .. py:attribute:: _price_weight :value: 0.7 .. py:attribute:: _utility_threshold :value: 0.9 .. py:attribute:: _min_margin :value: 0.5 .. py:attribute:: _max_margin :value: 1.5 .. py:attribute:: controllers :type: Dict[bool, scml.scml2020.services.controllers.SyncController] .. py:attribute:: _current_end :value: -1 .. py:attribute:: _current_start :value: -1 .. py:method:: step() .. py:method:: respond_to_negotiation_request(initiator: str, issues: List[negmas.Issue], annotation: Dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface) -> Optional[negmas.Negotiator] .. py:class:: Simulation(*args, **kwargs) Provides a simulator to the agent. Provides: - `simulator` (FactorySimulator): A simulator that can be used to simulate the effect of contracts on the future of the factory Hooks Into: - `init` - `step` 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. .. py:attribute:: simulator :type: scml.scml2020.services.FactorySimulator :value: None .. py:method:: init() .. py:method:: step() .. py:data:: __all__