jieunbyun / BNS-JT

Reference: Byun, J.-E. and Song, J. (2021). A general framework of Bayesian network for system reliability analysis using junction tree. Reliability Engineering & System Safety, 216, 107952.
MIT License
5 stars 4 forks source link

line 160 in the gen_bnb #37

Closed dynaryu closed 1 year ago

dynaryu commented 1 year ago

Can you check line 160 in the gen_bnb.py?

sum([x in y for y in rules])

I can't figure out what x is. Is the last value from the previous loop? Thanks.

jieunbyun commented 1 year ago

Do you mean sum( [1 if x in r else 0 for r in c_rules] ) in line 157? If so, x comes from Line 155 "for x in comps_i:".

dynaryu commented 1 year ago

I assumed so, but for loop of comps_i is finished, so the last value of comps_i given the last value of i would be used in that case. You might check the indent if that's not the case. Please let me know.

jieunbyun commented 1 year ago

ah I think you mentioned Line 166. It should have been "k". Now it has been fixed. Thank you for noticing this!