Skip to content

Average Destruction Converter

Converter using the average of all previously observed destruction percentages.

AverageDestructionConverter

Bases: AutoDestructionConverter

Converter using the average of observed destruction percentages.

Parameters:

Name Type Description Default
auto_init_percent int

Initial destruction percentage. Defaults to 0.

0

compute_auto_destruction_percent(config_name: str, project_operators: list[ProjectOperator], destroy_operator_name: str) -> float

Compute auto destruction percentage from running average.

Parameters:

Name Type Description Default
config_name str

Config name.

required
project_operators list[ProjectOperator]

Project operators.

required
destroy_operator_name str

Destroy operator name.

required

Returns:

Type Description
float

Destruction percentage of auto-mode destroy operator.

convert_auto_in_config(config: ActiveConfig, lns_object: Optional[LNS] = None) -> ActiveConfig

Convert auto values and update running averages on improving iterations.

Parameters:

Name Type Description Default
config ActiveConfig

LNPS configuration containing automatic values.

required
lns_object Optional[LNS]

LNS object.

None

Returns:

Type Description
ActiveConfig

LNPS configuration with all automatic values replaced.