cartesian_tournament
- negmas.tournaments.cartesian_tournament(competitors, scenarios, competitor_params=None, rotate_ufuns=True, n_repetitions=1, path=None, njobs=0, mechanism_type=<class 'negmas.sao.mechanism.SAOMechanism'>, mechanism_params=None, n_steps=100, time_limit=None, pend=0.0, pend_per_second=0.0, step_time_limit=None, negotiator_time_limit=None, plot_fraction=0.0, plot_params=None, verbosity=1, self_play=True, randomize_runs=True, save_every=0, save_stats=True, final_score=('advantage', 'mean'), id_reveals_type=False, name_reveals_type=True, shorten_names=True, raise_exceptions=True, mask_scenario_names=True)[source]
A simplified version of Cartesian tournaments not using the internal machinay of NegMAS tournaments
- Parameters:
competitors (
list
[type
[Negotiator
] |str
] |tuple
[type
[Negotiator
] |str
,...
]) – A tuple of the competing negotiator types.scenarios (
list
[Scenario
] |tuple
[Scenario
,...
]) – A tuple of base scenarios to use for the tournament.competitor_params (
Optional
[Sequence
[Optional
[dict
]]]) – Either None for no-parameters or a tuple of dictionaries with parameters to initialize the competitors (in order).rotate_ufuns (
bool
) – If True, the ufuns will be rotated over negotiator positions (for bilateral negotiation this leads to two scenarios for each input scenario with reversed ufun order).n_repetitions (
int
) – Number of times to repeat each scenario/partner combinationpath (
Optional
[Path
]) – Path on disk to save the results and details of this tournament. Pass None to disable loggingn_jobs – Number of parallel jobs to run. -1 means running serially (useful for debugging) and 0 means using all cores.
mechanism_type (
type
[Mechanism
]) – The mechanism (protocol) used for all negotiations.n_steps (
UnionType
[int
,tuple
[int
,int
],None
]) – Number of steps/rounds allowed for the each negotiation (None for no-limit and a 2-valued tuple for sampling from a range)time_limit (
Union
[float
,tuple
[float
,float
],None
]) – Number of seconds allowed for the each negotiation (None for no-limit and a 2-valued tuple for sampling from a range)pend (
float
|tuple
[float
,float
]) – Probability of ending the negotiation every step/round (None for no-limit and a 2-valued tuple for sampling from a range)pend_per_second (
float
|tuple
[float
,float
]) – Probability of ending the negotiation every second (None for no-limit and a 2-valued tuple for sampling from a range)step_time_limit (
Union
[float
,tuple
[float
,float
],None
]) – Time limit for every negotiation step (None for no-limit and a 2-valued tuple for sampling from a range)negotiator_time_limit (
Union
[float
,tuple
[float
,float
],None
]) – Time limit for all actions of every negotiator (None for no-limit and a 2-valued tuple for sampling from a range)mechanism_params (
Optional
[dict
[str
,Any
]]) – Parameters of the mechanism (protocol). Usually you need to pass one or more of the following: time_limit (in seconds), n_steps (in rounds), p_ending (probability of ending the negotiation every step).plot_fraction (
float
) – fraction of negotiations for which plots are to be saved (only if path is not None)plot_params (
Optional
[dict
[str
,Any
]]) – Parameters to pass to the plotting functionverbosity (
int
) – Verbosity level (minimum is 0)self_play (
bool
) – Allow negotiations in which all partners are of the same typerandomize_runs (
bool
) – If True negotiations will be run in random order, otherwise each scenario/partner combination will be finished before starting on the nextsave_every (
int
) – Number of negotiations after which we dump details and scoressave_stats (
bool
) – Whether to calculate and save extra statistics like pareto_optimality, nash_optimality, kalai_optimality, etcfinal_score (
tuple
[str
,str
]) – A tuple of two strings giving the metric used for ordering the negotiators for the final score: First string can be one of the following (advantage, utility, partner_welfare, welfare) or any statistic from the set calculated if save_stats is True. The second string can be mean, median, min, max, or std. The default is (‘advantage’, ‘mean’)id_reveals_type (
bool
) – Each negotiator ID will reveal its type.name_reveals_type (
bool
) – Each negotiator name will reveal its type.shorten_names (
bool
) – If True, shorter versions of names will be used for resultsraise_exceptions (
bool
) – When given, negotiators and mechanisms are allowed to raise exceptions stopping the tournamentmask_scenario_names (
bool
) – If given, scenario names will be masked so that the negotiators do not know the original scenario name
- Return type:
- Returns:
A pandas DataFrame with all negotiation results.