scml.oneshot.adapter ==================== .. py:module:: scml.oneshot.adapter Classes ------- .. autoapisummary:: scml.oneshot.adapter.OneShotSCML2020Adapter Module Contents --------------- .. py:class:: OneShotSCML2020Adapter(*args, **kwargs) Bases: :py:obj:`scml.oneshot.sysagents.DefaultOneShotAdapter` Base class for adapters allowing SCML std agents to run as Oneshot agents in SCML2020Oneshot worlds .. py:attribute:: _obj :type: scml.scml2020.agent.SCML2020Agent .. py:method:: reset() .. py:method:: is_clean() -> bool .. py:method:: on_negotiation_failure(partners, annotation, mechanism, state) Called whenever a negotiation ends without agreement .. py:method:: on_negotiation_success(contract, mechanism) Called whenever a negotiation ends with agreement .. py:method:: on_contract_executed(contract: negmas.Contract) -> None Called after successful contract execution for which the agent is one of the partners. .. py:method:: on_contract_breached(contract: negmas.Contract, breaches: List[negmas.Breach], resolution: Optional[negmas.Contract]) -> None Called after complete processing of a contract that involved a breach. :param contract: The contract :param breaches: All breaches committed (even if they were resolved) :param resolution: The resolution contract if re-negotiation was successful. None if not. .. py:method:: init() Override this method to modify initialization logic .. py:method:: before_step() .. py:method:: to_dict() .. py:method:: _respond_to_negotiation_request(initiator, partners, issues, annotation, mechanism, role, req_id) Called by the mechanism to ask for joining a negotiation. The agent can refuse by returning a None :param initiator: The ID of the agent that initiated the negotiation request :param partners: The partner list (will include this agent) :param issues: The list of issues :param annotation: Any annotation specific to this negotiation. :param mechanism: The mechanism that started the negotiation :param role: The role of this agent in the negotiation :param req_id: The req_id passed to the AWI when starting the negotiation (only to the initiator). :returns: None to refuse the negotiation or a `Negotiator` object appropriate to the given mechanism to accept it. Remarks: - It is expected that world designers will introduce a better way to respond and override this function to call it .. py:method:: set_renegotiation_agenda(contract, breaches) Received by partners in ascending order of their total breach levels in order to set the renegotiation agenda when contract execution fails :param contract: The contract being breached :param breaches: All breaches on `contract` :returns: Renegotiation agenda (issues to negotiate about to avoid reporting the breaches). .. py:method:: respond_to_renegotiation_request(contract, breaches, agenda) Called to respond to a renegotiation request :param agenda: :param contract: :param breaches: Returns: .. py:method:: on_neg_request_rejected(req_id, by) Called when a requested negotiation is rejected :param req_id: The request ID passed to _request_negotiation :param by: A list of agents that refused to participate or None if the failure was for another reason .. py:method:: on_neg_request_accepted(req_id, mechanism) Called when a requested negotiation is accepted