selector.instance_sets

In this module the choice of instance sets for tournaments is handled.

Classes

TimedInstanceSet(instance_set, ...[, ...])

Selects the next instance set to run a tournament on.

class selector.instance_sets.TimedInstanceSet(instance_set, start_instance_size, set_size=None, runtime=42, start_time=0.1, end_time=0.7)[source]

Bases: InstanceSet

Selects the next instance set to run a tournament on.

Parameters:
  • instance_set (list) – Set of instances available.

  • start_instance_size (int) – Size of the first instances se to be created.

  • set_size (int) – If not set, the biggest instance set to be created includes all instances in training instance_set. If set, the biggest instance set will be of the size of the given int.

  • runtime (int) – Maximum runtime of the AC process.

  • start_time (float) – Fracture of the Maximum runtime when increasing the set size starts.

  • end_time (int) – Fracture of the Maximum runtime when maximum set size ought to be reached. Depending on the scenario, this cannot be quaranteed.

get_subset(next_tournament_set_id, time, iteration)[source]

Create an instance set for the next tournament. The set contains all instances that were included in the previous sets as well as a new subset of instances.

Parameters:
  • next_tournament_set_id (int) – Id of the subset to get the next instances for.

  • time (int) – Currently passed time since start of the AC process.

  • iteration (int) – Last iteration that was finished.

Returns:

  • int, id of the instance set.

  • list, next instance set.

Return type:

tuple

next_set()[source]

Create a new instance set with instances not included in any created set before. This is not thread safe and should only be called from the master node.