Pular para conteúdo

tucoopy.diagnostics.reasonable_diagnostics

Reasonable set diagnostics.

The reasonable set bounds each player's payoff between individual rationality and their utopia payoff, while requiring efficiency:

\[R(v) = \{ x : \sum_{i=1}^n x_i = v(N), \, v(\{i\}) \leq x_i \leq M_i \}\]

where \(M\) is the utopia payoff vector.

Examples:

>>> from tucoopy import Game
>>> from tucoopy.diagnostics.reasonable_diagnostics import reasonable_set_diagnostics
>>> g = Game.from_coalitions(n_players=2, values={0: 0, 3: 1})
>>> reasonable_set_diagnostics(g, [0.5, 0.5]).in_set
True

reasonable_set_diagnostics

reasonable_set_diagnostics(
    game, x, *, tol=DEFAULT_GEOMETRY_TOL
)

Membership diagnostics for the reasonable set.

\[R(v) = \{ x : \sum_{i=1}^n x_i = v(N), \, v(\{i\}) \leq x_i \leq M_i \}.\]

Parameters:

Name Type Description Default
game GameProtocol

TU game.

required
x list[float]

Allocation vector of length game.n_players.

required
tol float

Numerical tolerance used for the efficiency check and bound comparisons.

DEFAULT_GEOMETRY_TOL

Returns:

Type Description
BoxBoundSetDiagnostics

Diagnostics object including the bounds and any bound violations.

Raises:

Type Description
InvalidParameterError

If x does not have length game.n_players.

See also

tucoopy.geometry.reasonable_set.ReasonableSet The set-valued wrapper around these constraints.

Examples:

A minimal 3-player example (only the grand coalition has value 1):

>>> from tucoopy import Game
>>> from tucoopy.diagnostics.reasonable_diagnostics import reasonable_set_diagnostics
>>> g = Game.from_coalitions(n_players=3, values={
...     0:0, 1:0, 2:0, 4:0,
...     3:0, 5:0, 6:0,
...     7:1,
... })
>>> d = reasonable_set_diagnostics(g, [1/3, 1/3, 1/3])
>>> d.in_set
True