OneShotSingleAgreementAgent

class scml.oneshot.OneShotSingleAgreementAgent(*args, strict=False, **kwargs)[source]

Bases: negmas.sao.controllers.SAOSingleAgreementController, scml.OneShotSyncAgent

A synchronized agent that tries to get no more than one agreement.

This controller manages a set of negotiations from which only a single one – at most – is likely to result in an agreement. To guarantee a single agreement, pass strict=True

The general algorithm for this controller is something like this:

  • Receive offers from all partners.

  • Find the best offer among them by calling the abstract best_offer method.

  • Check if this best offer is acceptable using the abstract is_acceptable method.

    • If the best offer is acceptable, accept it and end all other negotiations.

    • If the best offer is still not acceptable, then all offers are rejected and with the partner who sent it receiving the result of best_outcome while the rest of the partners receive the result of make_outcome.

  • The default behavior of best_outcome is to return the outcome with maximum utility.

  • The default behavior of make_outcome is to return the best offer received in this round if it is valid for the respective negotiation and the result of best_outcome otherwise.

Parameters

strict (bool) – If True the controller is guaranteed to get a single agreement but it will have to send no-response repeatedly so there is a higher chance of never getting an agreement when two of those controllers negotiate with each other

Methods Summary

best_offer(offers)

Return the ID of the negotiator with the best offer

is_acceptable(offer, source, state)

Should decide if the given offer is acceptable

is_better(a, b, negotiator, state)

Compares two outcomes of the same negotiation

Methods Documentation

abstract best_offer(offers)[source]

Return the ID of the negotiator with the best offer

Parameters

offers (Dict[str, Union[OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]]) – A mapping from negotiator ID to the offer it received

Return type

Optional[str]

Returns

The ID of the negotiator with best offer. Ties should be broken. Return None only if there is no way to calculate the best offer.

abstract is_acceptable(offer, source, state)[source]

Should decide if the given offer is acceptable

Parameters
Remarks:
  • If True is returned, this offer will be accepted and all other negotiations will be ended.

Return type

bool

abstract is_better(a, b, negotiator, state)[source]

Compares two outcomes of the same negotiation

Parameters
Returns

True if utility(a) > utility(b)