run_tournament

negmas.tournaments.run_tournament(tournament_path, world_generator=None, score_calculator=None, total_timeout=None, parallelism='parallel', scheduler_ip=None, scheduler_port=None, tournament_progress_callback=None, world_progress_callback=None, verbose=False, compact=None, print_exceptions=True, override_ran_worlds=False, max_attempts=9223372036854775807)[source]

Runs a tournament

Parameters:
  • tournament_path (str | Path) – Path at which configs of this tournament are stored

  • world_generator (WorldGenerator | None) – A functions to generate worlds for the tournament that follows the assignments made by the config_assigner

  • score_calculator (Optional[Callable[[list[World], dict[str, Any], bool], WorldRunResults]]) – A function for calculating the score of all agents in a world After it finishes running. The second parameter is a dict describing any scoring context that may have been added by the world config generator or assigner. The third parameter is a boolean specifying whether this is a dry_run. For dry runs, scores are not expected but names and types should exist in the returned WorldRunResults.

  • total_timeout (int | None) – Total timeout for the complete process

  • 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 (str | None) – Port of the dask scheduler if parallelism is dask, dist, or distributed

  • scheduler_ip (str | None) – IP Address of the dask scheduler if parallelism is dask, dist, or distributed

  • world_progress_callback (Optional[Callable[[World | None], None]]) – 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 (Optional[Callable[[WorldRunResults | None, int, int], None]]) – A function to be called with WorldRunResults after each world finished processing

  • verbose (bool) – Verbosity

  • compact (bool | None) – If true, compact logs will be created and effort will be made to reduce the memory footprint

  • print_exceptions (bool) – If true, exceptions encountered during world simulation will be printed to stdout

  • override_ran_worlds (bool) – If true worlds that are already ran will be ran again

  • max_attempts (int) – The maximum number of attempts to run each simulation. Default is infinite

Return type:

None