create_cartesian_tournament

negmas.tournaments.create_cartesian_tournament(competitors, scenarios, competitor_params=None, non_competitors=(), non_competitor_params=None, rotate_ufuns=False, n_repetitions=1, n_steps=2, n_rounds=None, timelimit=None, **kwargs)[source]

Creates a Cartesian tournament (every competitor against every other competitor)

Parameters:
  • competitors (list[str | type[Agent] | type[Negotiator]] | tuple[str | type[Agent] | type[Negotiator], ...]) – A list of class names for the competitors.

  • non_competitors (list[str | type[Agent] | type[Negotiator]] | tuple[str | type[Agent] | type[Negotiator], ...]) – A list of class names for agents that will run against the competitors but never be evaluated themselves.

  • scenarios (list[Scenario] | tuple[Scenario, ...]) – A generator that yields NegScenario objects specifying negotiation scenarios upon request

  • name – Tournament name

  • competitor_params (Optional[Sequence[Optional[dict[str, None]]]]) – A list of competitor parameters (used to initialize the competitors).

  • non_competitor_params (Optional[Sequence[Optional[dict]]]) – A list of non-competitor parameters (used to initialize the non-competitors).

  • rotate_ufuns (bool) – If True, all N rotations of the N ufuns in every scenario will be tried.

  • stage_winners_fraction – in [0, 1). Fraction of agents to to go to the next stage at every stage. If zero, and round_robin, it becomes a single stage competition.

  • agent_names_reveal_type – If true then the type of an agent should be readable in its name (most likely at its beginning).

  • n_configs – The number of different world configs (up to competitor assignment) to be generated.

  • n_runs_per_world – Number of runs per world. All of these world runs will have identical competitor assignment and identical world configuration.

  • total_timeout – Total timeout for the complete process

  • tournament_path – Path at which to store all results. A new folder with the name of the tournament will be created at this path. A scores.csv file will keep the scores and logs folder will keep detailed logs

  • parallelism – Type of parallelism. Can be ‘serial’ for serial, ‘parallel’ for parallel and ‘distributed’ for distributed! For parallel, you can add the fraction of CPUs to use after a colon (e.g. parallel:0.5 to use half of the CPU in the machine). By defaults parallel uses all CPUs in the machine

  • scheduler_port – Port of the dask scheduler if parallelism is dask, dist, or distributed

  • scheduler_ip – IP Address of the dask scheduler if parallelism is dask, dist, or distributed

  • world_progress_callback – A function to be called after every step of every world run (only allowed for serial and parallel evaluation and should be used with cautious).

  • tournament_progress_callback – A function to be called with WorldRunResults after each world finished processing

  • verbose – Verbosity

  • configs_only – If true, a config file for each

  • compact – If true, compact logs will be created and effort will be made to reduce the memory footprint

  • print_exceptions – If true, print all exceptions to screen

  • metric – The metric to use for evaluation

  • forced_logs_fraction – The fraction of simulations for which to always save logs. Notice that this has no effect except if no logs were to be saved otherwise (i.e. no_logs is passed as True)

  • save_video_fraction – The fraction of simulations for which to save videos

  • video_params – The parameters to pass to the video saving function

  • video_saver – The parameters to pass to the video saving function after the world

  • max_attempts – The maximum number of times to retry running simulations

  • extra_scores_to_use – The type of extra-scores to use. If None normal scores will be used. Only effective if scores is None.

  • kwargs – Arguments to pass to the config_generator function

Return type:

PathLike

Returns:

TournamentResults The results of the tournament or a PathLike giving the location where configs were saved