negmas.tournaments.run_tournament(tournament_path: Union[str, os.PathLike], world_generator: Optional[negmas.tournaments.WorldGenerator] = None, score_calculator: Optional[Callable[[List[negmas.situated.World], Dict[str, Any], bool], negmas.tournaments.WorldRunResults]] = None, total_timeout: Optional[int] = None, parallelism='parallel', scheduler_ip: Optional[str] = None, scheduler_port: Optional[str] = None, tournament_progress_callback: Optional[Callable[[Optional[negmas.tournaments.WorldRunResults], int, int], None]] = None, world_progress_callback: Optional[Callable[[Optional[negmas.situated.World]], None]] = None, verbose: bool = False, compact: Optional[bool] = None, print_exceptions: bool = True, override_ran_worlds: bool = False, max_attempts: int = inf)None[source]

Runs a tournament

  • tournament_path – Path at which configs of this tournament are stored

  • world_generator – A functions to generate worlds for the tournament that follows the assignments made by the config_assigner

  • score_calculator – 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 – 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 – 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

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

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

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

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