winwin_level
- negmas.preferences.winwin_level(u1, u2, outcomes, max_tests=10000)[source]
Finds the win-win level in these two ufuns.
- Parameters:
u1 (UtilityFunction) – first utility function
u2 (UtilityFunction) – second utility function
- Return type:
float
Examples
A nonlinear same ufun case
>>> from negmas.preferences.crisp.mapping import MappingUtilityFunction >>> outcomes = [(_,) for _ in range(10)] >>> u1 = MappingUtilityFunction( ... dict(zip(outcomes, np.linspace(1.0, 0.0, len(outcomes), endpoint=True))) ... )
A linear strictly zero sum case
>>> outcomes = [(_,) for _ in range(10)] >>> u1 = MappingUtilityFunction( ... dict(zip(outcomes, np.linspace(0.0, 1.0, len(outcomes), endpoint=True))) ... ) >>> u2 = MappingUtilityFunction( ... dict(zip(outcomes, np.linspace(1.0, 0.0, len(outcomes), endpoint=True))) ... )