pystra.systems.KOfNSystem#

Use it: User guide · Worked example · Theory

class KOfNSystem(children, k, name=None)[source]#

Bases: System

A system that fails when at least k child events fail.

Parameters:
  • children (Iterable[Component | System | LimitState | Callable[..., Any]]) – Child components or subsystems.

  • k (int) – Number of failed children required for system failure.

  • name (str | None) – System name.

Notes

This event-counting representation is intended for simulation, enumeration, and topology construction. Its equivalent limit-state value preserves the failure sign but is discontinuous, so it is generally not a smooth FORM/SORM limit state.

Methods

as_limit_state

Return the composed system as a PySTRA LimitState.

component_failure_masks

Return failure masks for each leaf component.

component_values

Evaluate all leaf component limit states.

evaluate

Evaluate the equivalent scalar system limit state.

failure_mask

Return a boolean mask where the system is failed.

get_limit_state

Return the composed system as a PySTRA LimitState.

iter_components

Yield all leaf components in the system.

as_limit_state()#

Return the composed system as a PySTRA LimitState.

Return type:

LimitState

component_failure_masks(**kwargs)#

Return failure masks for each leaf component.

Return type:

dict[str, bool | ndarray]

component_values(**kwargs)#

Evaluate all leaf component limit states.

Returns:

Mapping component names to their evaluated limit-state values.

Return type:

dict[str, ndarray]

Raises:

ValueError – If duplicate component names would make the mapping ambiguous.

property components: tuple[Component, ...]#

Flat tuple of all leaf components in the system.

evaluate(**kwargs)#

Evaluate the equivalent scalar system limit state.

Return type:

float | ndarray

failure_mask(**kwargs)#

Return a boolean mask where the system is failed.

Return type:

bool | ndarray

get_limit_state()#

Return the composed system as a PySTRA LimitState.

This legacy-style alias mirrors the existing PySTRA getter naming.

Return type:

LimitState

iter_components()#

Yield all leaf components in the system.

Return type:

Iterator[Component]