Skip to content

Commit

Permalink
Fix stability computing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoCeratto committed Mar 22, 2023
1 parent 3954208 commit 915a9dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions detector/detector/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,9 @@ def run_detection(start_date, end_date, services) -> None:
new.confirmed_perc * new.cnt/totcnt * %(mu)f + blocking_status.confirmed_perc * blocking_status.cnt/totcnt * %(tau)f AS confirmed_perc,
new.pure_anomaly_perc * new.cnt/totcnt * %(mu)f + blocking_status.pure_anomaly_perc * blocking_status.cnt/totcnt * %(tau)f AS pure_anomaly_perc,
new.accessible_perc * new.cnt/totcnt * %(mu)f + blocking_status.accessible_perc * blocking_status.cnt/totcnt * %(tau)f AS accessible_perc,
( cos(3.14/2*(new.accessible_perc - blocking_status.accessible_perc)/100) * 0.7 +
blocking_status.stability * 0.3) AS stability
if(new.cnt > 0,
cos(3.14/2*(new.accessible_perc - blocking_status.accessible_perc)/100) * 0.7 + blocking_status.stability * 0.3,
blocking_status.stability) AS stability
FROM blocking_status FINAL
Expand Down

0 comments on commit 915a9dd

Please sign in to comment.