covid-sim
covid-sim copied to clipboard
Refactor DigitalContactTracingSweep
Refactor the DigitalContactTracingSweep function in Sweep.cpp.
Specifically, extract four functions:
-
static void GetDctStartEndTimes(int infector, int contact, unsigned short contact_time, unsigned short& dct_start_time, unsigned short& dct_end_time);
-
void AddToDctQueue(int tn, int ad, int i3, int ci, unsigned short ts);
-
static void RemoveFromDctQueue(int j, int i, int k, int contact, int infector, unsigned short contact_time);
-
static void RemoveContactFromDctQueue(int contact);
Maybe this should be moved out of Sweep.cpp? The file is quite large, so it may be useful to break it down.
@zdroid Yes - plans are afoot to break both Sweep.cpp and Update.cpp into separate files/classes. But not in this PR - to keep things simpler for the reviewers, I have not broken up these files.
@weshinsley @dlaydon @matt-gretton-dann Is Digital Contact Tracing actively used? If so, do we have any regression tests for it? It might not be worth refactoring otherwise - and I'll move on to something else. Thanks.
@weshinsley Hi - can I just confirm if Digital Contact Tracing is actively used? I can unit test and simplify the code - just looking to see if it is active before asking for a merge request.
Hi @mstevens-uk, thanks for asking. We are using this code right now, but it isn't added to the formal regression tests. Therefore if you could refrain from changing or refactoring it for now that would be helpful. Thanks.
Understood.