cartesian_tournament
- negmas.tournaments.cartesian_tournament(competitors: list[type[~negmas.negotiators.negotiator.Negotiator] | str] | tuple[type[~negmas.negotiators.negotiator.Negotiator] | str, ...], scenarios: list[~negmas.inout.Scenario] | tuple[~negmas.inout.Scenario, ...], private_infos: list[None | tuple[dict, ...]] | None = None, competitor_params: ~typing.Sequence[dict | None] | None = None, rotate_ufuns: bool = True, rotate_private_infos: bool = True, n_repetitions: int = 1, path: ~pathlib.Path | None = None, njobs: int = 0, mechanism_type: type[~negmas.mechanisms.Mechanism] = <class 'negmas.sao.mechanism.SAOMechanism'>, mechanism_params: dict[str, ~typing.Any] | None = None, n_steps: int | tuple[int, int] | None = 100, time_limit: float | tuple[float, float] | None = None, pend: float | tuple[float, float] = 0.0, pend_per_second: float | tuple[float, float] = 0.0, step_time_limit: float | tuple[float, float] | None = None, negotiator_time_limit: float | tuple[float, float] | None = None, hidden_time_limit: float | tuple[float, float] | None = None, external_timeout: int | None = None, plot_fraction: float = 0.0, plot_params: dict[str, ~typing.Any] | None = None, verbosity: int = 1, self_play: bool = True, randomize_runs: bool = True, sort_runs: bool = False, save_every: int = 0, save_stats: bool = True, save_scenario_figs: bool = True, final_score: tuple[str, str] = ('advantage', 'mean'), id_reveals_type: bool = False, name_reveals_type: bool = True, shorten_names: bool = True, raise_exceptions: bool = True, mask_scenario_names: bool = True, only_failures_on_self_play: bool = False, python_class_identifier='__python_class__') SimpleTournamentResults[source]
A simplified version of Cartesian tournaments not using the internal machinay of NegMAS tournaments
- Parameters:
competitors – A tuple of the competing negotiator types.
scenarios – A tuple of base scenarios to use for the tournament.
competitor_params – Either None for no-parameters or a tuple of dictionaries with parameters to initialize the competitors (in order).
private_infos – If given, a list of the same length as scenarios. Each item is a tuple giving the private information to be passed to every negotiator in every scenario.
rotate_ufuns – 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).rotate_private_infos – If
Trueandrotate_ufunsis alsoTrue, private information will be rotated with the utility functions.n_repetitions – Number of times to repeat each scenario/partner combination
path – Path on disk to save the results and details of this tournament. Pass None to disable logging
n_jobs – Number of parallel jobs to run. -1 means running serially (useful for debugging) and 0 means using all cores.
mechanism_type – The mechanism (protocol) used for all negotiations.
n_steps – 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 – Number of seconds allowed for the each negotiation (None for no-limit and a 2-valued tuple for sampling from a range)
pend – 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 – Probability of ending the negotiation every second (None for no-limit and a 2-valued tuple for sampling from a range)
step_time_limit – Time limit for every negotiation step (None for no-limit and a 2-valued tuple for sampling from a range)
negotiator_time_limit – Time limit for all actions of every negotiator (None for no-limit and a 2-valued tuple for sampling from a range)
hidden_time_limit – Time limit for negotiations that is not known to the negotiators
external_timeout – A timeout applied directly to reception of results from negotiations in parallel runs only.
mechanism_params – 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 – fraction of negotiations for which plots are to be saved (only if
pathis notNone)plot_params – Parameters to pass to the plotting function
verbosity – Verbosity level (minimum is 0)
self_play – Allow negotiations in which all partners are of the same type
only_failures_on_self_play – If given, self-play runs will only be recorded if they fail to reach agreement. This is useful if you want to keep self-play but still penalize strategies for failing to reach agreements in self-play
randomize_runs – If
Truenegotiations will be run in random order, otherwise each scenario/partner combination will be finished before starting on the nextsave_every – Number of negotiations after which we dump details and scores
save_stats – Whether to calculate and save extra statistics like pareto_optimality, nash_optimality, kalai-smorodinsky optimality (ks_optimality), kalai_optimality, etc
save_scenario_figs – Whether to save a png of the scenario represented in the utility domain for every scenario.
final_score – 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_statsisTrue. The second string can be mean, median, min, max, or std. The default is (‘advantage’, ‘mean’)id_reveals_type – Each negotiator ID will reveal its type.
name_reveals_type – Each negotiator name will reveal its type.
shorten_names – If True, shorter versions of names will be used for results
raise_exceptions – When given, negotiators and mechanisms are allowed to raise exceptions stopping the tournament
mask_scenario_names – If given, scenario names will be masked so that the negotiators do not know the original scenario name
- Returns:
A pandas DataFrame with all negotiation results.