scml.std.agent
Classes
Base class for all SAO negotiators. Implemented by implementing propose() and respond() methods. |
|
Base class for all agents in the standard game. |
|
Base class for agents that negotiate synchronously by receiving all offers at once then responding to all of them at once. |
Module Contents
- class scml.std.agent.EndingNegotiator(preferences: negmas.preferences.preferences.Preferences | None = None, ufun: negmas.preferences.base_ufun.BaseUtilityFunction | None = None, name: str | None = None, parent: negmas.negotiators.Controller | None = None, owner: negmas.situated.Agent | None = None, id: str | None = None, type_name: str | None = None, can_propose: bool = True, **kwargs)[source]
Bases:
negmas.sao.SAONegotiator,negmas.ControlledNegotiatorBase class for all SAO negotiators. Implemented by implementing propose() and respond() methods.
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The utility function of the negotiator (overrides preferences if given)
owner – The
Agentthat owns the negotiator.
- Remarks:
The only method that must be implemented by any SAONegotiator is
propose.The default
respondmethod, accepts offers with a utility value no less than whateverproposereturns with the same mechanism state.A default implementation of respond() is provided which simply accepts any offer better than the last offer I gave or the next one I would have given in the current state.
See also
SAOCallNegotiator- propose(state)[source]
Propose an offer or None to refuse.
- Parameters:
state –
GBStategiving current state of the negotiation.- Returns:
The outcome being proposed or None to refuse to propose
- Remarks:
This function guarantees that no agents can propose something with a utility value
- respond(state, source=None)[source]
Called to respond to an offer. This is the method that should be overriden to provide an acceptance strategy.
- Parameters:
state – a
SAOStategiving current state of the negotiation.source – The ID of the negotiator that gave this offer
- Returns:
The response to the offer
- Return type:
ResponseType
- Remarks:
The default implementation never ends the negotiation
The default implementation asks the negotiator to
propose`() and accepts the `offerif its utility was at least as good as the offer that it would have proposed (and above the reserved value).The current offer to respond to can be accessed through
state.current_offer
- class scml.std.agent.StdAgent(owner=None, ufun: scml.oneshot.OneShotUFun | None = None, name=None)[source]
Bases:
scml.oneshot.agent.OneShotAgentBase class for all agents in the standard game.
- Remarks:
You can access all of the negotiators associated with the agent using
self.negotiatorswhich is a dictionary mapping thenegotiator_idto a tuple of two values: TheSAONegotiatorobject and a key-value context dictionary.The
negotiator_idassociated with a negotiation with some partner will be the same as the agent ID of that partner. This means that all negotiators engaged with some partner over all simulation steps will have the same ID which is useful if you are keeping information about past negotiations and partner behavior.
- class scml.std.agent.StdSyncAgent(*args, **kwargs)[source]
Bases:
scml.oneshot.agent.OneShotSyncAgent,StdAgentBase class for agents that negotiate synchronously by receiving all offers at once then responding to all of them at once.