smac.stats.stats module

class smac.stats.stats.Stats(scenario: smac.scenario.scenario.Scenario)

Bases: object

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

Parameters
  • submitted_ta_runs

  • finished_ta_runs

  • wallclock_time_used

  • ta_time_used

  • inc_changed

get_remaing_time_budget() float

Subtracts the runtime configuration budget with the used wallclock time

get_remaining_ta_budget() float

Subtracts the ta running budget with the used time

get_remaining_ta_runs() int

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

get_used_wallclock_time() float

Returns used wallclock time

Returns

wallclock_time – used wallclock time in sec

Return type

int

is_budget_exhausted() bool

Check whether the configuration budget for time budget, ta_budget and submitted_ta_runs is exhausted

Returns

exhaustedness – true if one of the budgets is exhausted

Return type

boolean

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

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

Prints all statistics

Parameters

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

save() None

Save all relevant attributes to json-dictionary.

start_timing() None

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

Updates statistics how many configurations on average per used in intensify

Parameters

n_configs (int) – number of configurations in current intensify