Skip to content

Dataclasses

smac.runhistory.dataclasses #

InstanceSeedBudgetKey dataclass #

InstanceSeedBudgetKey(
    instance: str | None = None,
    seed: int | None = None,
    budget: float | None = None,
)

Key for instance, seed and budget.

PARAMETER DESCRIPTION
instance

TYPE: str | None, defaults to None DEFAULT: None

seed

TYPE: int | None, defaults to None DEFAULT: None

budget

TYPE: float | None, defaults to None DEFAULT: None

get_instance_seed_key #

get_instance_seed_key() -> InstanceSeedKey

Returns the instance-seed key. The budget is omitted.

Source code in smac/runhistory/dataclasses.py
def get_instance_seed_key(self) -> InstanceSeedKey:
    """Returns the instance-seed key. The budget is omitted."""
    return InstanceSeedKey(instance=self.instance, seed=self.seed)

InstanceSeedKey dataclass #

InstanceSeedKey(
    instance: str | None = None, seed: int | None = None
)

Key for instance and seed.

PARAMETER DESCRIPTION
instance

TYPE: str | None, defaults to None DEFAULT: None

seed

TYPE: int | None, defaults to None DEFAULT: None

TrajectoryItem dataclass #

TrajectoryItem(
    config_ids: list[int],
    costs: list[float | list[float]],
    trial: int,
    walltime: float,
)

Item of a trajectory.

PARAMETER DESCRIPTION
config_ids

Configuration ids of the current incumbents.

TYPE: list[int]

costs

Costs of the current incumbents. In case of multi-objective, this is a list of lists.

TYPE: list[float | list[float]]

trial

How many trials have been evaluated so far.

TYPE: int

walltime

How much walltime has been used so far.

TYPE: float

TrialInfo dataclass #

TrialInfo(
    config: Configuration,
    instance: str | None = None,
    seed: int | None = None,
    budget: float | None = None,
    additional_info: dict[str, Any] = dict(),
)

Information about a trial.

PARAMETER DESCRIPTION
config

TYPE: Configuration

instance

TYPE: str | None, defaults to None DEFAULT: None

seed

TYPE: int | None, defaults to None DEFAULT: None

budget

TYPE: float | None, defaults to None DEFAULT: None

additional_info

TYPE: dict[str, Any] DEFAULT: dict()

get_instance_seed_budget_key #

get_instance_seed_budget_key() -> InstanceSeedBudgetKey

Instantiates and returns an InstanceSeedBudgetKey object.

Source code in smac/runhistory/dataclasses.py
def get_instance_seed_budget_key(self) -> InstanceSeedBudgetKey:
    """Instantiates and returns an InstanceSeedBudgetKey object."""
    return InstanceSeedBudgetKey(instance=self.instance, seed=self.seed, budget=self.budget)

get_instance_seed_key #

get_instance_seed_key() -> InstanceSeedKey

Instantiates and returns an InstanceSeedKey object

Source code in smac/runhistory/dataclasses.py
def get_instance_seed_key(self) -> InstanceSeedKey:
    """Instantiates and returns an InstanceSeedKey object"""
    return InstanceSeedKey(instance=self.instance, seed=self.seed)

TrialKey dataclass #

TrialKey(
    config_id: int,
    instance: str | None = None,
    seed: int | None = None,
    budget: float | None = None,
)

Key of a trial.

PARAMETER DESCRIPTION
config_id

TYPE: int

instance

TYPE: str | None, defaults to None DEFAULT: None

seed

TYPE: int | None, defaults to None DEFAULT: None

budget

TYPE: float | None, defaults to None DEFAULT: None

TrialValue dataclass #

TrialValue(
    cost: float | list[float],
    time: float = 0.0,
    cpu_time: float = 0.0,
    status: StatusType = SUCCESS,
    starttime: float = 0.0,
    endtime: float = 0.0,
    additional_info: dict[str, Any] = dict(),
)

Values of a trial.

PARAMETER DESCRIPTION
cost

TYPE: float | list[float]

time

TYPE: float, defaults to 0.0 DEFAULT: 0.0

cpu_time

Describes the amount of time the trial spend on hardware.

TYPE: float, defaults to 0.0 DEFAULT: 0.0

status

TYPE: StatusType, defaults to StatusType.SUCCESS DEFAULT: SUCCESS

starttime

TYPE: float, defaults to 0.0 DEFAULT: 0.0

endtime

TYPE: float, defaults to 0.0 DEFAULT: 0.0

additional_info

TYPE: dict[str, Any], defaults to {} DEFAULT: dict()