API map¶
The public API is intentionally restricted:
import tucoopyis a small, stable convenience surface.- Most functionality lives in the canonical subpackages:
tucoopy.basetucoopy.gamestucoopy.solutionstucoopy.geometrytucoopy.transformstucoopy.propertiestucoopy.powertucoopy.iotucoopy.backendstucoopy.viz
Stable top-level (tucoopy)¶
from tucoopy import Game, glove_game, mask_from_players, nucleolus, shapley_value, weighted_voting_game
Notes:
nucleolus()is optional (it requires SciPy at runtime when called).- Core vertices are intended for small
n(for visualization use).
Canonical subpackages¶
tucoopy.base¶
Game representations + IO-friendly helpers:
- Coalition helpers:
all_coalitions,subcoalitions,players,size,grand_coalition,mask_from_players - Games:
Game,TabularGame,ValueFunctionGame
tucoopy.properties¶
Properties / recognizers:
is_convex,is_concaveis_essential,is_monotone,is_normalized,is_superadditiveis_simple_game,validate_simple_game,is_weighted_voting_gamebalancedness_check(LP)
tucoopy.io¶
JSON helpers + animation spec:
- Dataclasses:
AnimationSpec,GameSpec,SeriesSpec,FrameSpec - Helpers:
game_to_spec,series_from_allocations,build_animation_spec - JSON (games):
game_to_dict,game_from_dict
tucoopy.backends¶
Adapters for optional dependencies:
- LP adapter:
tucoopy.backends.lp.linprog_solve - NumPy helper:
tucoopy.backends.numpy_fast.require_numpy
tucoopy.games¶
Classic games / generators:
glove_gameweighted_voting_gameairport_gamebankruptcy_gamesavings_gameunanimity_gameapex_game
tucoopy.solutions¶
Solution concepts:
- Values:
shapley_value,banzhaf_value,normalized_banzhaf_value - Nucleolus family (SciPy):
least_core,nucleolus,prenucleolus(+ result dataclasses) - Kernel family (NumPy):
kernel,prekernel(+ result dataclasses) - \(\tau\) value helpers:
tau_value,utopia_payoff,minimal_rights
tucoopy.geometry¶
Geometry for visualization:
- Core:
Core(game).vertices()(smalln) - Excess / checks:
excesses,max_excess,tight_coalitions,is_in_core,is_in_epsilon_core,is_imputation,is_efficient - Imputation set:
imputation_lower_bounds,is_in_imputation_set,project_to_imputation,ImputationSet(game).vertices() - \(\epsilon\)-core:
EpsilonCore(game, eps).poly,EpsilonCore(game, eps).vertices(),least_core_polytope - Weber set:
marginal_vector,weber_marginal_vectors,weber_sample - Bargaining set (SciPy):
bargaining_set_check,bargaining_set_sample,is_in_bargaining_set - Balancedness (SciPy):
balancedness_check(+ result dataclass)
tucoopy.power¶
- Voting indices:
shapley_shubik_index,banzhaf_index - DP-based indices (integer weights):
shapley_shubik_index_weighted_voting,banzhaf_index_weighted_voting
tucoopy.transforms¶
Transforms / representations:
to_dense_valuesmobius_transform,inverse_mobius_transformharsanyi_dividends