RankerMixin

class negmas.negotiators.RankerMixin[source]

Bases: object

Adds the ability to rank outcomes returning the ranks without weights. Outcomes of equal utility are ordered arbitrarily. None stands for the null outcome

Methods Summary

init()

is_better(first, second[, epsilon])

Compares two offers using the ufun returning whether the first is better than the second

rank(outcomes[, descending])

Ranks the given list of outcomes.

Methods Documentation

init()[source]
is_better(first: Outcome, second: Outcome, epsilon: float = 1e-10)Optional[bool][source]

Compares two offers using the ufun returning whether the first is better than the second

Parameters
  • first – First outcome to be compared

  • second – Second outcome to be compared

  • epsilon – comparison threshold. If the utility difference within the range [-epsilon, epsilon] the two outcomes are assumed to be compatible

Returns

True if utility(first) > utility(second) + epsilon None if |utility(first) - utility(second)| <= epsilon or the utun is not defined False if utility(first) < utility(second) - epsilon

rank(outcomes: List[Optional[Outcome]], descending=True)List[int][source]

Ranks the given list of outcomes. None stands for the null outcome.

Returns

  • A list of integers in the specified order of utility values of outcomes