public static Fault ReadFault(BinaryReader reader) { var name = reader.ReadString(); var type = reader.ReadInt32(); var identifier = reader.ReadInt32(); var probabilityValue = reader.ReadDouble(); Fault fault; if (type == 1) { fault = new TransientFault(); } else if (type == 2) { fault = new PermanentFault(); } else { throw new Exception("Not implemented yet"); } fault.Name = name; fault.Identifier = identifier; // ReSharper disable once CompareOfFloatsByEqualityOperator fault.ProbabilityOfOccurrence = probabilityValue == -1.0 ? null : (Probability?)new Probability(probabilityValue); return(fault); }
private void M() { var f1 = new TransientFault() { Name = "f1" }; Fault f2 = new TransientFault() { Name = "f2" }; TransientFault f3 = new TransientFault() { Name = "f3" }, f4 = new TransientFault() { Name = "f4" }, f5 = new TransientFault() { Name = "f5" }; var f6 = new TransientFault { Activation = Activation.Forced, Name = "f6" }; }
public ExampleComponent() { F1 = new TransientFault() { DemandType = Fault.DemandTypes.OnStartOfStep };; F1.ProbabilityOfOccurrence = new Probability(0.3); }
public ExampleComponent() { F1 = new TransientFault(); F1.ProbabilityOfOccurrence = new Probability(0.003); F2 = new TransientFault(); F2.ProbabilityOfOccurrence = new Probability(0.0001); }
public DeadReckoningComponent() { FF = new TransientFault(); FF.ProbabilityOfOccurrence = new Probability(0.4); FC = new TransientFault(); FC.ProbabilityOfOccurrence = new Probability(0.01); FS = new PermanentFault(); FS.ProbabilityOfOccurrence = new Probability(0.05); }
public SimpleBayesianExampleComponent() { FL = new TransientFault(); FL.ProbabilityOfOccurrence = new Probability(0.4); FV = new TransientFault(); FV.ProbabilityOfOccurrence = new Probability(0.01); FS = new TransientFault(); FS.ProbabilityOfOccurrence = new Probability(0.05); }
private void M() { var f1 = new TransientFault(); Fault f2 = new TransientFault(); TransientFault f3 = new TransientFault(), f4 = new TransientFault(), f5 = new TransientFault(); var f6 = new TransientFault { Activation = Activation.Forced }; }