GreedySingleAgreementAgent

class scml.oneshot.GreedySingleAgreementAgent(*args, **kwargs)[source]

Bases: scml.OneShotSingleAgreementAgent

A greedy agent based on OneShotSingleAgreementAgent

Methods Summary

before_step()

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

before_step()[source]
best_offer(offers)[source]

Return the ID of the negotiator with the best offer

Parameters

offers – A mapping from negotiator ID to the offer it received

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.

is_acceptable(offer, source, state)[source]

Should decide if the given offer is acceptable

Parameters
  • offer – The offer being tested

  • source – The ID of the negotiator that received this offer

  • state – The state of the negotiation handled by that negotiator

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

Return type

bool

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

Compares two outcomes of the same negotiation

Parameters
  • a – “Outcome”

  • b – “Outcome”

  • negotiator – The negotiator for which the comparison is to be made

  • state – Current state of the negotiation

Returns

True if utility(a) > utility(b)