smac.stats.stats module

class smac.stats.stats.Stats(scenario: smac.scenario.scenario.Scenario)[source]

Bases: object

All statistics collected during configuration run. Written to output-directory to be restored

ta_runs
wallclock_time_used
ta_time_used
inc_changed

Constructor

Parameters
  • scenario (Scenario) –

  • output_dir (str) –

get_remaing_time_budget() → float[source]

Subtracts the runtime configuration budget with the used wallclock time

get_remaining_ta_budget() → float[source]

Subtracts the ta running budget with the used time

get_remaining_ta_runs() → int[source]

Subtract the target algorithm runs in the scenario with the used ta runs

get_used_wallclock_time() → float[source]

Returns used wallclock time

Returns

wallclock_time – used wallclock time in sec

Return type

int

is_budget_exhausted() → bool[source]

Check whether the configuration budget for time budget, ta_budget and ta_runs is empty

Returns

exhaustedness – true if one of the budgets is exhausted

Return type

boolean

load(fn: Optional[str] = None) → None[source]

Load all attributes from dictionary in file into stats-object.

Parameters

fn (string or None) – Path to file to load stats from. If no path is given, the path given in the current scenario is used.

print_stats(debug_out: bool = False) → None[source]

Prints all statistics

Parameters

debug (bool) – use logging.debug instead of logging.info if set to true

save() → None[source]

Save all relevant attributes to json-dictionary.

start_timing() → None[source]

Starts the timer (for the runtime configuration budget). Substracting wallclock time used so we can continue loaded Stats.

update_average_configs_per_intensify(n_configs: int) → None[source]

Updates statistics how many configurations on average per used in intensify

Parameters

n_configs (int) – number of configurations in current intensify