rtac.rtac

This module contains classes that guide the RTAC process according to method.

Functions

rtac_factory(scenario)

Class factory to return the initialized RTAC class appropriate to the RTAC method scenario.ac.

Classes

AbstractRTAC(scenario)

Realtime Algorithm Configuration class.

RTAC(scenario)

Implementation of ReACTR.

RTACpp(scenario)

Implementation of ReACTR++.

class rtac.rtac.AbstractRTAC(scenario: Namespace)[source]

Bases: ABC

Realtime Algorithm Configuration class.

Parameters:

scenario (argparse.Namespace) – Namespace containing all settings for the RTAC.

init_rtac_data() None[source]

Initialize new RTAC data.

Return type:

None

init_tournament_manager() None[source]

Initialize tournament manager object.

Return type:

None

abstract solve_instance(instance: str) None[source]

Solves problem instance and performs all associated functionalities.

Parameters:

instance (str) – Path to problem instance.

Return type:

None

class rtac.rtac.RTAC(scenario: Namespace)[source]

Bases: AbstractRTAC

Implementation of ReACTR.

Parameters:

scenario (argparse.Namespace) – Namespace containing all settings for the RTAC.

black_box(instance: str | None = None) None[source]

Solves problem instance and performs all associated functionalities.

Parameters:

instance (str) – Path to problem instance. Defaults to None.

Return type:

None

gray_box(instance: str, next_instance: str | None = None, early_rtac_data: RTACData | RTACDatapp | None = None) None[source]

Solves problem instance and performs all associated functionalities.

Parameters:
  • instance (str) – Path to problem instance.

  • next_instance (str) – Path to next problem instance. Defaults to None.

  • early_rtac_data (RTACData | RTACDatapp) – Object containing data and objects necessary throughout the RTAC modules.

Return type:

None

plot_performances(results: bool = False, times: bool = False) None[source]

Plots results of the logged RTAC run and saves figure.

Parameters:
  • results (bool) – True if objective value minimization scenario. Defaults to False.

  • times (bool) – True if runtime minimization scenario. Defaults to False.

Return type:

None

Raises:

NotImplementedError – This method is not implemented yet.

provide_early_instance(early_instance: str) None[source]

If next instance is available early, use this function to pass it to the gray-box RAC method.

Parameters:

early_instance (str) – Path to next problem instance. Defaults to None.

Return type:

None

result_output(instance: str) None[source]

Print result to terminal.

Parameters:

instance (str) – Path to problem instance.

Return type:

None

solve_instance(instance: str, next_instance: str | None = None, early_rtac_data: RTACData | RTACDatapp | None = None) None[source]

Solve problem instance.

Parameters:
  • instance (str) – Path to problem instance.

  • next_instance (str) – Path to next problem instance. Defaults to None.

  • early_rtac_data (RTACData | RTACDatapp) – Object containing data and objects necessary throughout the RTAC modules.

Return type:

None

wrap_up_gb() None[source]

Wrap up gray-box RAC method for this ionstance / instance-pair.

Return type:

None

class rtac.rtac.RTACpp(scenario: Namespace)[source]

Bases: RTAC

Implementation of ReACTR++.

init_rtac_data() None[source]

Initialize new RTAC data for ReACTR++.

Return type:

None

init_tournament_manager() None[source]

Initialize tournament manager object for ReACTR++.

Return type:

None

rtac.rtac.rtac_factory(scenario: Namespace) AbstractRTAC[source]

Class factory to return the initialized RTAC class appropriate to the RTAC method scenario.ac.

Parameters:

scenario (argparse.Namespace) – Namespace containing all settings for the RTAC.

Returns:

Initialized AbstractRTAC object matching the RTAC method of the scenario.

Return type:

AbstractRTAC