SAOMechanism

class negmas.sao.SAOMechanism(issues=None, outcomes=None, n_steps=None, time_limit=None, step_time_limit=None, max_n_agents=None, dynamic_entry=False, keep_issue_names=None, outcome_type=<class 'tuple'>, cache_outcomes=True, max_n_outcomes: int = 1000000, annotation: Optional[Dict[str, Any]] = None, end_on_no_response=False, publish_proposer=True, publish_n_acceptances=False, enable_callbacks=False, avoid_ultimatum=False, check_offers=True, ignore_negotiator_exceptions=False, offering_is_accepting=True, allow_offering_just_rejected_outcome=True, name: Optional[str] = None, max_wait: int = 9223372036854775807, sync_calls: bool = False, **kwargs)[source]

Bases: negmas.mechanisms.Mechanism

Implements Several variants of the Stacked Alternating Offers Protocol

Parameters
  • issues – A list of issues defining the outcome-space of the negotiation (See outcomes). Only one of issues and outcomes can be passed (the other must be None)

  • outcomes – A list of outcomes defining the outcome-space of the negotiation (See issues). Only one of issues and outcomes can be passed (the other must be None)

  • n_steps – The maximum number of negotiaion rounds (see time_limit )

  • time_limit – The maximum wall-time allowed for the negotiation (see n_steps)

  • step_time_limit – The maximum wall-time allowed for a single negotiation round.

  • max_n_agents – The maximum number of negotiators allowed to join the negotiation.

  • dynamic_entry – Whether it is allowed for negotiators to join the negotiation after it starts

  • keep_issue_names – DEPRICATED (use outcome_type instead). If true, outcomes and discrete_outcomes will be dictionaries otherwise they will be tuples

  • outcome_type – The outcome type to use for outcomes and distrete_outcomes. It can be tuple, dict or any OutcomeType

  • cache_outcomes – If true, the mechnism will catch outcomes and a discrete version (discrete_outcomes) that can be accessed by any negotiator through their AMI.

  • max_n_outcomes – Maximum number or outcomes to use when disctetizing the outcome-space

  • annotation – A key-value mapping to keep around. Accessible through the AMI but not used by the mechanism.

  • end_on_no_response – End the negotiation if any negotiator returns NO_RESPONSE from respond/counter or returns REJECT_OFFER then refuses to give an offer (by returning None from proposee/`counter).

  • publish_proposer – Put the last proposer in the state.

  • publish_n_acceptances – Put the number of acceptances an offer got so far in the state.

  • enable_callbacks – Enable callbacks like on_round_start, etc. Note that on_negotiation_end is always received by the negotiators no matter what is the setting for this parameter.

  • avoid_ultimatum – If true, a proposal is taken from every agent in the first round then all of them are discarded except one (choose randomly) and the algorithm continues using this one. This prevents negotiators from knowing their order in the round.

  • check_offers – If true, offers are checked to see if they are valid for the negotiation outcome-space and if not the offer is considered None which is the same as refusing to offer (NO_RESPONSE).

  • ignore_negotiator_exceptions – just silently ignore negotiator exceptions and consider them no-responses.

  • offering_is_accepting – Offering an outcome implies accepting it. If not, the agent who proposed an offer will be asked to respond to it after all other agents.

  • name – Name of the mecnanism

  • **kwargs – Extra paramters passed directly to the Mechanism constructor

Remarks:

  • If both n_steps and time_limit are passed, the negotiation ends when either of the limits is reached.

  • Negotiations may take longer than time_limit because negotiators are not interrupted while they are executing their respond or propose methods.

Events:

  • negotiator_exception: Data=(negotiator, exception) raised whenever a negotiator raises an exception if ignore_negotiator_exceptions is set to True.

Attributes Summary

offers

Returns the negotiation history as a list of offers

trace

Returns the negotiation history as a list of negotiator/offer tuples

Methods Summary

extra_state()

Returns any extra state information to be kept in the state and history properties

join(ami, state, *[, ufun, role])

negotiator_offers(negotiator_id)

Returns the offers given by a negotiator (in order)

plot([visible_negotiators, plot_utils, …])

A method for plotting a negotiation session

round()

implements a round of the Stacked Alternating Offers Protocol.

set_sync_call(v)

Attributes Documentation

offers

Returns the negotiation history as a list of offers

trace

Returns the negotiation history as a list of negotiator/offer tuples

Methods Documentation

extra_state()[source]

Returns any extra state information to be kept in the state and history properties

join(ami: negmas.common.AgentMechanismInterface, state: negmas.common.MechanismState, *, ufun: Optional[UtilityFunction] = None, role: str = 'agent')bool[source]
negotiator_offers(negotiator_id: str)List[Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]][source]

Returns the offers given by a negotiator (in order)

plot(visible_negotiators: Union[Tuple[int, int], Tuple[str, str]] = (0, 1), plot_utils=True, plot_outcomes=False, utility_range: Optional[Tuple[float, float]] = None, save_fig: bool = False, path: Optional[str] = None, fig_name: Optional[str] = None)[source]

A method for plotting a negotiation session

round()negmas.mechanisms.MechanismRoundResult[source]

implements a round of the Stacked Alternating Offers Protocol.

set_sync_call(v: bool)[source]