selector.tournament_dispatcher

This module contains functions for managing tournaments.

Classes

MiniTournamentDispatcher()

Dispatches tournaments.

class selector.tournament_dispatcher.MiniTournamentDispatcher[source]

Bases: object

Dispatches tournaments.

init_tournament(results, configurations, instance_partition, instance_partition_id)[source]

Create a new tournament from the given configurations and list of instances.

Parameters:
  • results (dict) – Dic of results: {conf_id: {instance: runtime}}.

  • configurations (list) – Configurations for the tournament.

  • instance_partition (list) – List of instances.

  • instance_partition_id (int) – ID of the instance set.

Returns:

  • selector.pool.Tournament, Tournament object

  • list, The first configuration/instance assignment to run.

Return type:

tuple

next_tournament_run(results, tournament, finished_conf)[source]

Decide which configuration/instance pair to run next.

Rule: If the configuration that has just finished was neither killed nor has seen all instances, it is assigned a new instance at random. Otherwise, the configuration with the lowest runtime so far is selected.

Parameters:
Returns:

Configuration and instance pair to run next.

Return type:

list

update_tournament(results, tasks, finished_conf, tournament, number_winner, time_out, par_penalty)[source]

Update the tournament based on a finished configuration.

If the finished configuration has seen all instances of the tournament, it is moved either to the best or worst finishers. Best finishers are ordered, while worst finishers are not.

Parameters:
  • results (dict) – Dic of results: {conf_id: {instance: runtime}}.

  • finished_conf (selector.pool.Configuration) – Configuration that finished or was canceled.

  • tournament (selector.pool.Tournament) – Tournament the finished configuration was a member of.

  • number_winner (int) – Determines the number of winners per tournament.

Returns:

  • selector.pool.Tournament, Updated tournament

  • bool, stopping signal.

Return type:

tuple