########################################################### # # # Exercise 4.15b: # # # # 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.5 # Component weights a = [2, 4, 4, 6, 6, 8] # 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.calculateReliability0(p) sys.printSystem() print("") print("System unreliability = ", result[0]) print("System reliability = ", result[1])