run_tournament
- negmas.tournaments.run_tournament(tournament_path: str | Path, world_generator: WorldGenerator | None = None, score_calculator: Callable[[list[World], dict[str, Any], bool], WorldRunResults] | None = None, total_timeout: int | None = None, parallelism='parallel', scheduler_ip: str | None = None, scheduler_port: str | None = None, tournament_progress_callback: Callable[[WorldRunResults | None, int, int], None] | None = None, world_progress_callback: Callable[[World | None], None] | None = None, verbose: bool = False, compact: bool | None = None, print_exceptions: bool = True, override_ran_worlds: bool = False, max_attempts: int = 9223372036854775807) None[source]
Runs a tournament
- Parameters:
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_assignerscore_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
WorldRunResultsafter each world finished processingverbose – 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