scml.std.agent

Module Contents

Classes

EndingNegotiator

Base class for all SAO negotiators.

StdAgent

Base class for all agents in the standard game.

StdSyncAgent

Base class for agents that negotiate synchronously by receiving all offers at once then responding to all of them at once.

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.ControlledNegotiator

Base class for all SAO negotiators.

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 Agent that owns the negotiator.

Remarks:
  • The only method that must be implemented by any SAONegotiator is propose.

  • The default respond method, accepts offers with a utility value no less than whatever propose returns with the same mechanism state.

propose(state)[source]

Propose an offer or None to refuse.

Parameters:

stateGBState giving 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 SAOState giving 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 `offer if 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.OneShotAgent

Base class for all agents in the standard game.

Remarks:
  • You can access all of the negotiators associated with the agent using self.negotiators which is a dictionary mapping the negotiator_id to a tuple of two values: The SAONegotiator object and a key-value context dictionary.

  • The negotiator_id associated 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, StdAgent

Base class for agents that negotiate synchronously by receiving all offers at once then responding to all of them at once.