tucoopy.diagnostics.core_cover_diagnostics¶
Core cover diagnostics.¶
This module provides membership-style diagnostics for the core cover (a polytopal superset of the core defined via minimal rights and utopia payoffs).
Examples:
>>> from tucoopy import Game
>>> from tucoopy.diagnostics.core_cover_diagnostics import core_cover_diagnostics
>>> g = Game.from_coalitions(n_players=2, values={0: 0, 1: 0, 2: 0, 3: 1})
>>> d = core_cover_diagnostics(g, [0.5, 0.5])
>>> d.in_set
True
core_cover_diagnostics ¶
core_cover_diagnostics(
game, x, *, tol=DEFAULT_GEOMETRY_TOL
)
Membership diagnostics for the core cover.
$\(\text{CoreCover}(v) = \{ x : \sum_{i=1}^n x_i = v(N), m_i \leq x_i \leq M_i \}\)$.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game | GameProtocol | TU game. | required |
x | list[float] | Allocation vector of length | 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 |
Notes
The core cover is defined via:
- utopia payoff
M(upper bounds), and - minimal rights
m(lower bounds),
combined with efficiency.
Examples:
A minimal 3-player example (only the grand coalition has value 1):
>>> from tucoopy import Game
>>> from tucoopy.diagnostics.core_cover_diagnostics import core_cover_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 = core_cover_diagnostics(g, [1/3, 1/3, 1/3])
>>> d.efficient
True
>>> isinstance(d.violations, list)
True