CASCI-lab / CANA

CANAlization: Control & Redundancy in Boolean Networks
https://casci-lab.github.io/CANA/
MIT License
22 stars 15 forks source link

Add sensitivity #25

Closed austin-marcus closed 1 year ago

xuan-w commented 1 year ago

Actually sensitivity was already implemented, under function name c_sensitivity(), which is a general version of sensitivity. The new sensitivity implementation has two problems: 1, it involves prime implicants, which is unnecessary for sensitivity calculation; 2, it is a special case of c=1 for c_sensitivity, so actually it is better to call c_sensitivity(). For activity, the original code was wrong, Thank Felipe for spotting that. I was under the impression that there is an implementation that doesn't involve prime implicants, I don't know why it wasn't there. Probably got lost when merging code.

xuan-w commented 1 year ago

I think it might be a better idea that when all the prime implicants have been calculated, we use them to get activity. If not, just calculate activity from LUT. So we get faster calculation in both situations. For c=1 sensitivity, that is the same. If PIs are already there, use sum of activity, otherwise use the old code.