scml.oneshot.sysagents
Implements the one shot version of SCML
Module Contents
Classes
The base class of all agents running in OneShot based on OneShotAgent. |
|
Implements an agent for handling system operations |
- class scml.oneshot.sysagents.DefaultOneShotAdapter(*args, **kwargs)[source]
Bases:
negmas.Adapter
,scml.oneshot.mixins.OneShotUFunCreatorMixin
The base class of all agents running in OneShot based on OneShotAgent.
Remarks:
It inherits from
Adapter
allowing it to just pass any calls not defined explicity in it to the internal_obj
object representing the OneShotAgent.
- property awi: scml.oneshot.awi.OneShotAWI[source]
Gets the Agent-world interface.
- on_negotiation_failure(partners, annotation, mechanism, state)[source]
Called whenever a negotiation ends without agreement
- on_negotiation_success(contract: negmas.Contract, mechanism)[source]
Called whenever a negotiation ends with agreement
- on_contract_executed(contract: negmas.Contract) None [source]
Called after successful contract execution for which the agent is one of the partners.
- on_contract_breached(contract: negmas.Contract, breaches: list[negmas.Breach], resolution: negmas.Contract | None) None [source]
Called after complete processing of a contract that involved a breach.
- Parameters:
contract – The contract
breaches – All breaches committed (even if they were resolved)
resolution – The resolution contract if re-negotiation was successful. None if not.
- init_()[source]
Called to initialize the agent after the world is initialized. the AWI is accessible at this point.
- _respond_to_negotiation_request(initiator: str, partners: list[str], issues: list[negmas.Issue], annotation: dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface, role: str | None, req_id: str | None) negmas.Negotiator | None [source]
Called by the mechanism to ask for joining a negotiation. The agent can refuse by returning a None
- Parameters:
initiator – The ID of the agent that initiated the negotiation request
partners – The partner list (will include this agent)
issues – The list of issues
annotation – Any annotation specific to this negotiation.
mechanism – The mechanism that started the negotiation
role – The role of this agent in the negotiation
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
- set_renegotiation_agenda(contract: negmas.Contract, breaches: list[negmas.Breach]) negmas.RenegotiationRequest | None [source]
Received by partners in ascending order of their total breach levels in order to set the renegotiation agenda when contract execution fails
- Parameters:
contract – The contract being breached
breaches – All breaches on
contract
- Returns:
Renegotiation agenda (issues to negotiate about to avoid reporting the breaches).
- respond_to_renegotiation_request(contract: negmas.Contract, breaches: list[negmas.Breach], agenda: negmas.RenegotiationRequest) negmas.Negotiator | None [source]
Called to respond to a renegotiation request
- Parameters:
agenda –
contract –
breaches –
Returns:
- class scml.oneshot.sysagents._StdSystemAgent(*args, role, **kwargs)[source]
Bases:
DefaultOneShotAdapter
Implements an agent for handling system operations
- respond_to_negotiation_request(initiator: str, issues: list[negmas.Issue], annotation: dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface) negmas.Negotiator | None [source]
- on_negotiation_failure(partners: list[str], annotation: dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface, state: negmas.MechanismState) None [source]
Called whenever a negotiation ends without agreement