CardinalRanking

class negmas.preferences.CardinalRanking(*args, **kwargs)[source]

Bases: Protocol

Implements ranking of outcomes with meaningful differences (i.e. each rank is given a value and nearer values are more similar)

Methods Summary

argrank_with_weights(outcomes[, descending])

Ranks the given list of outcomes with weights.

rank_with_weights(outcomes[, descending])

Ranks the given list of outcomes with weights.

Methods Documentation

abstractmethod argrank_with_weights(outcomes: list[tuple | None], descending=True) list[tuple[tuple[tuple | None], float]][source]

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

Returns:

  • an list of integers giving the index in the input array (outcomes) of an outcome (at the given utility level)
    • the weight of that outcome

  • The list is sorted by weights descendingly

Return type:

  • A list of tuples each with two values

abstractmethod rank_with_weights(outcomes: list[tuple | None], descending=True) list[tuple[tuple[tuple | None], float]][source]

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

Returns:

  • an list of integers giving the index in the input array (outcomes) of an outcome (at the given utility level)
    • the weight of that outcome

  • The list is sorted by weights descendingly

Return type:

  • A list of tuples each with two values