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

add test inference based on the notebook #41

Closed dynaryu closed 12 months ago

dynaryu commented 12 months ago

Please see the added tests.

dynaryu commented 12 months ago

working on the pipe system but failed to get it work. Any thoughts?

dynaryu commented 12 months ago

Please check test_sys_fun_pipes1 in test_pipes_sys.py. I compared the results before and after changing to zero-based index, and noticed that the resulting sys_val is different from -1.0 (which I assume a true value). Any thoughts?

jieunbyun commented 12 months ago

When I see test_sys_fun_pipes1, the input component state is {'n1':0, 'n2':0, 'n3':0, ...}, and I get as sys_val -0.0. The result is correct since zero flow will happen with all those nodes connected to the origin nodes having zero capacity.

dynaryu commented 12 months ago

I thought that sys_val should be the same even after the code was changed to zero-based index. Otherwise some part of the code was not changned properly. Any thoughts?

dynaryu commented 12 months ago

When I see test_sys_fun_pipes1, the input component state is {'n1':0, 'n2':0, 'n3':0, ...}, and I get as sys_val -0.0. The result is correct since zero flow will happen with all those nodes connected to the origin nodes having zero capacity.

What's the expected output given the all of the comp states are 1 before the code was changed? When I ran the code, the output was -0.1.

dynaryu commented 12 months ago

I re-run the code, and strangely I got 0 for this time. I am a bit confused. Anyway, I'll look into the issue.