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 3 forks source link

line 160 in the gen_bnb #37

Closed dynaryu closed 9 months ago

dynaryu commented 9 months 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 9 months 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 9 months 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 9 months ago

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