rtac.ac_functionalities.tournament
This module contains classes implementing problem instance solving tournaments by differently configured target algorithms according to the RTAC method utilized.
Functions
|
Class factory to return the initialized TournamentManager class appropriate to the RTAC method scenario.ac. |
Classes
|
Abstract class for tournaments. |
|
Tournament class with functions needed for ReACTR method tournaments. |
Class that contains gray-box tournament functions to be inserted into tournament classes if scenario.gray_box is True. |
|
|
Tournament class with functions needed for ReACTR method tournaments. |
- class rtac.ac_functionalities.tournament.AbstractTournament(scenario: Namespace, ta_runner: BaseTARunner, rtac_data: RTACData | RTACDatapp, logs: RTACLogs)[source]
Bases:
ABCAbstract class for tournaments.
- Parameters:
scenario (argparse.Namespace) – Namespace containing all settings for the RTAC.
ta_runner (BaseTARunner) – Target algorithm runner object.
rtac_data (RTACData | RTACDatapp) – Object containing data and objects necessary throughout the RTAC modules.
logs (RTACLogs) – Object containing loggers and logging functions.
- close_tournament() None[source]
Initiates termination of all target algorithm runs.
- Return type:
None
- pid_alive(pid) None[source]
Checks if process is till alive using PID.
- Parameters:
pid (int) – Unique identifier for process.
- Return type:
None
- abstract start_tournament(instance: str, contender_dict: dict[slice(<class 'str'>, <class 'rtac.ac_functionalities.rtac_data.Configuration'>, None)], tourn_nr: int) None[source]
Sets up tournament data and information and starts the tournament with scenario.number_cores configured target algorithms running in parallel, using settings according to the RTAC method.
- Parameters:
instance (str) – Path to the problem instance to solve.
contender_dict (dict[str, Configuration]) – Dictionary containing configurations to run in the tournament, with configuration IDs as keys and Configuration objects as values.
tourn_nr (int) – Number of the tournament during this RTAC run.
- Return type:
None
- class rtac.ac_functionalities.tournament.Tournament(scenario: Namespace, ta_runner: BaseTARunner, rtac_data: RTACData | RTACDatapp, logs: RTACLogs)[source]
Bases:
AbstractTournamentTournament class with functions needed for ReACTR method tournaments.
- fill_tournament(cores_start: list[int]) None[source]
Fills up the remaining cores to be used in an early started tournament.
- Parameters:
cores_start (list[int]) – List of cores which to start the contenders on.
- Return type:
None
- start_tournament(instance: str, contender_dict: dict[slice(<class 'str'>, <class 'rtac.ac_functionalities.rtac_data.Configuration'>, None)], tourn_nr: int, cores_start: list[int]) None[source]
Sets up tournament data and starts the tournament with scenario.number_cores configured target algorithms running in parallel according to the ReACTR method.
- Parameters:
instance (str) – Path to the problem instance to solve.
contender_dict (dict[str, Configuration]) – Dictionary containing configurations to run in the tournament, with configuration IDs as keys and Configuration objects as values.
tourn_nr (int) – Number of the tournament during this RTAC run.
cores_start (list[int]) – List of cores which to start the contenders on.
- Return type:
None
- class rtac.ac_functionalities.tournament.Tournament_GB[source]
Bases:
objectClass that contains gray-box tournament functions to be inserted into tournament classes if scenario.gray_box is True.
- class rtac.ac_functionalities.tournament.Tournamentpp(scenario: Namespace, ta_runner: BaseTARunner, rtac_data: RTACData | RTACDatapp, logs: RTACLogs)[source]
Bases:
TournamentTournament class with functions needed for ReACTR method tournaments.
- rtac.ac_functionalities.tournament.tournament_factory(scenario: Namespace, ta_runner: BaseTARunner, rtac_data: RTACData | RTACDatapp, logs: RTACLogs) Tournament | Tournamentpp[source]
Class factory to return the initialized TournamentManager class appropriate to the RTAC method scenario.ac.
- Parameters:
scenario (argparse.Namespace) – Namespace containing all settings for the RTAC.
ta_runner (BaseTARunner) – Target algorithm runner object.
rtac_data (RTACData | RTACDatapp) – Object containing data and objects necessary throughout the RTAC modules.
logs (RTACLogs) – Object containing loggers and logging functions.
- Returns:
Initialized Tournament object matching the RTAC method of the scenario.
- Return type: