Skip to content

Auto Destruction Converters

Implementations of the AutoDestructionConverter interface:

Utility functions

utils

Utility functions for auto destruction converters.

calculate_actual_destruction_percent(destruction_candidate_atoms: set[Symbol], model: Model) -> float

Return percentage of atoms subject to destruction actually destroyed in given model.

Parameters:

Name Type Description Default
destruction_candidate_atoms set[Symbol]

Atoms subject to destruction

required
model Model

Model used to determine destruction percentage.

required

Returns:

Type Description
float

Percentage of atoms subject to destruction that were destroyed.

is_new_model_better(new_model: Optional[Model], current_model: Model) -> bool

Check whether new model is better than current model.

Parameters:

Name Type Description Default
new_model Optional[Model]

New model.

required
current_model Model

Current model.

required

Returns:

Type Description
bool

True if new model is better than current model, otherwise False.