########################################################### # # # Exercise 4.13: # # # # Construct an ROBDD for a given 3-out-of-5 # # system and evaluate its reliability # # # ########################################################### from c_robdd import ROBDDSystem from c_threshold import ROBDDThreshold # Component reliabilities p = 0.5 # Component weights a = [1, 1, 1, 1, 1] # Threshold b = 3 # Number of components n = len(a) # Sum of weights wsum = 0 for wg in a: wsum += wg sys = ROBDDSystem(ROBDDThreshold(a, wsum, b)) result = sys.calculateReliability0(p) sys.printSystem() print("") print("System unreliability = ", result[0]) print("System reliability = ", result[1])