Skip to content

Destruction

destruction

Different destruction methods for LNS.

destroy_config(model: Model, config: ActiveConfig, logger: LNSLogger) -> set[Symbol]

Destroy portion of atoms as defined by LNS configuration.

Parameters:

Name Type Description Default
model Model

Model containing the atoms.

required
config ActiveConfig

Active configuration.

required
logger LNSLogger

Logger instance.

required

Returns:

Type Description
set[Symbol]

Set of non destroyed atoms

destroy_random(model: Model, destruction_rate: int) -> set[Symbol]

Destroy random number of shown atoms given by the destruction_rate.

Parameters:

Name Type Description Default
model Model

model.

required
destruction_rate int

Percentage of atoms to destroy.

required

Returns:

Type Description
set[Symbol]

Fixed (not destroyed) atoms.

format_atoms(atoms: set[Symbol]) -> str

Format set of atoms into sorted space-separated string.

Parameters:

Name Type Description Default
atoms set[Symbol]

Set of atoms.

required

Returns:

Type Description
str

Formatted atom string.