########################################################### # # # Construct a BDD for a given threshold # # system and evaluate its reliability # # # ########################################################### from c_bdd import BDDSystem from c_threshold import BDDThreshold # Component reliabilities p = 0.5 # Component weights a = [12, 11, 8, 7, 6, 5, 3, 2] # Threshold b = 30 # Number of components n = len(a) # Sum of weights wsum = 0 for wg in a: wsum += wg sys = BDDSystem(BDDThreshold(a, wsum, b)) result = sys.calculateReliability0(p) sys.printSystem() print("") print("System unreliability = ", result[0]) print("System reliability = ", result[1])