Test script for API
Some notes on the functionality required for an API test script:
Prerequisites: need to add temperature/humidity as an input to the API (requires small model changes).
Inputs:
- Raw data CSV with standardised heading fields (based on ARVE Grafana inputs)
- Time range for calculations: start, end and breaks (9am - 6pm, with a break
- for lunch would be the CARA default)
- Time granularity for the calculation (e.g. n = 15 minute intervals, configurable)
Process:
- For each period from n, run a simulation with the current data (i.e. temp, humidity, ACH if available) until the end of the time period assuming n as input conditions. The probability of infection is the predicted 'end of day' score.
- Once each period n has elapsed (i.e. when advancing to n+1) run a short term CARA simulation for just that period of minutes, with conditions averaged between those at time n and n+1. The probability of infection from this calculation is the recorded exposure.
Results: Output table for all n periods of the day:
- The forward predicted end of day score
- The cumulative sum of recorded exposure
- The difference (tracking error) between 1 and 2.
Once validated the fundamental elements of the script should be adapted to run with real time inputs from sensors/database, every n minutes.
We could also do the same with expected new cases, and concentration data; but I suggest we start with probability of infection for the purposes of simplicity.