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, plot_fraction=0.0, 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)[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 combination

  • path (Optional[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 (type[Mechanism]) – The mechanism (protocol) used for all negotiations.

  • 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)

  • verbosity (int) – Verbosity level (minimum is 0)

  • self_play (bool) – Allow negotiations in which all partners are of the same type

  • randomize_runs (bool) – If True negotiations will be run in random order, otherwise each scenario/partner combination will be finished before starting on the next

  • save_every (int) – Number of negotiations after which we dump details and scores

  • save_stats (bool) – Whether to calculate and save extra statistics like pareto_optimality, nash_optimality, kalai_optimality, etc

  • final_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 results

Return type:

SimpleTournamentResults

Returns:

A pandas DataFrame with all negotiation results.