scml.scml2020.agents.decentralizing =================================== .. py:module:: scml.scml2020.agents.decentralizing .. autoapi-nested-parse:: Implements the `DecentralizingAgent` which creates ony buy and one sell controller for each time-step and relinquishes control of negotiations to buy/sell the required number of items of its input/output product. Classes ------- .. autoapisummary:: scml.scml2020.agents.decentralizing.DecentralizingAgent scml.scml2020.agents.decentralizing.MarketAwareDecentralizingAgent scml.scml2020.agents.decentralizing.DecentralizingAgentWithLogging scml.scml2020.agents.decentralizing.IndDecentralizingAgent scml.scml2020.agents.decentralizing.MarketAwareIndDecentralizingAgent Module Contents --------------- .. py:class:: DecentralizingAgent(*args, negotiator_type: Union[negmas.SAONegotiator, str] = AspirationNegotiator, negotiator_params: Optional[Dict[str, Any]] = None, **kwargs) Bases: :py:obj:`_NegotiationCallbacks`, :py:obj:`scml.scml2020.components.StepNegotiationManager`, :py:obj:`scml.scml2020.components.trading.PredictionBasedTradingStrategy`, :py:obj:`scml.scml2020.components.SupplyDrivenProductionStrategy`, :py:obj:`scml.scml2020.world.SCML2020Agent` 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:class:: MarketAwareDecentralizingAgent(*args, buying_margin=None, selling_margin=None, min_price_margin=0.5, max_price_margin=0.5, **kwargs) Bases: :py:obj:`scml.scml2020.components.prediction.MarketAwareTradePredictionStrategy`, :py:obj:`_NegotiationCallbacks`, :py:obj:`scml.scml2020.components.MovingRangeNegotiationManager`, :py:obj:`scml.scml2020.components.trading.PredictionBasedTradingStrategy`, :py:obj:`scml.scml2020.components.signing.KeepOnlyGoodPrices`, :py:obj:`scml.scml2020.components.SupplyDrivenProductionStrategy`, :py:obj:`scml.scml2020.world.SCML2020Agent` 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:class:: DecentralizingAgentWithLogging(*args, **kwargs) Bases: :py:obj:`_NegotiationCallbacks`, :py:obj:`scml.scml2020.components.StepNegotiationManager`, :py:obj:`scml.scml2020.components.trading.PredictionBasedTradingStrategy`, :py:obj:`scml.scml2020.components.SupplyDrivenProductionStrategy`, :py:obj:`scml.scml2020.world.SCML2020Agent` 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:class:: IndDecentralizingAgent(*args, negotiator_type: Union[negmas.SAONegotiator, str] = AspirationNegotiator, negotiator_params: Optional[Dict[str, Any]] = None, **kwargs) Bases: :py:obj:`_NegotiationCallbacks`, :py:obj:`scml.scml2020.components.IndependentNegotiationsManager`, :py:obj:`scml.scml2020.components.trading.PredictionBasedTradingStrategy`, :py:obj:`scml.scml2020.components.SupplyDrivenProductionStrategy`, :py:obj:`scml.scml2020.world.SCML2020Agent` 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:method:: create_ufun(is_seller: bool, issues=None, outcomes=None) Creates a utility function .. py:class:: MarketAwareIndDecentralizingAgent(*args, buying_margin=None, selling_margin=None, min_price_margin=0.5, max_price_margin=0.5, **kwargs) Bases: :py:obj:`scml.scml2020.components.signing.KeepOnlyGoodPrices`, :py:obj:`scml.scml2020.components.prediction.MarketAwareTradePredictionStrategy`, :py:obj:`IndDecentralizingAgent` 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.