fault_injector.fault_lib module
DriftFault
- class fault_injector.fault_lib.DriftFault(params: dict = None)[source]
Bases:
BaseFaultSimulate a Drift Fault: a gradual, systematic deviation of sensor readings from their true values over time.
- Parameters:
params (dict, optional) – Dictionary containing the drift_rate key. drift_rate corresponds to the slope of the fault-induced offset. If None, defaults to drift_rate of 1.
NormalNoiseFault
- class fault_injector.fault_lib.NormalNoiseFault(params: dict = None)[source]
Bases:
BaseFaultSimulates a normal (gaussian) noise fault
- Parameters:
params (dict, optional) –
mu (numeric): Mean of the Gaussian noise distribution
sigma (numeric): Standard deviation of the Gaussian noise distribution. Must be non-negative.
NaNFault
OffsetFault
- class fault_injector.fault_lib.OffsetFault(params: dict = None)[source]
Bases:
BaseFaultSimulate an Offset Fault: models a sensor error where a constant bias is added to the measured values during a specific time window.
- Parameters:
params (dict, optional) – dictionary expecting the offset_by key. This is the value that is constantly added to the true values. If set to None, offset_by defaults to 1.
StuckValueFault
- class fault_injector.fault_lib.StuckValueFault(params: dict = None)[source]
Bases:
BaseFaultSimulate a stuck value by repeating the stuck value for the desired length of values.
- Parameters:
params (dict, optional) – dictionary containing the stuck_val key, which corresponds to the repeated value in the output. If set to None, defaults to a stuck_val of 1.
UniformNoiseFault
- class fault_injector.fault_lib.UniformNoiseFault(params: dict = None)[source]
Bases:
BaseFaultSimulate uniform noise fault.
- Parameters:
params (dict) –
min_val (numeric): Mean of the Gaussian noise distribution.
max_val (numeric): Standard deviation of the Gaussian noise distribution. Must be non-negative.