########################################################### # # # Exercise 4.15c: # # # # Construct an ROBDD for a given threshold # # system and evaluate its reliability # # # ########################################################### from c_robdd import ROBDDSystem from c_threshold import ROBDDThreshold # Component reliabilities p = [0.82, 0.78, 0.66, 0.91, 0.73, 0.88] # Component weights a = [8, 6, 6, 4, 4, 2] # Threshold b = 15 # 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.calculateReliability(p) sys.printSystem() print("") print("System unreliability = ", result[0]) print("System reliability = ", result[1])