-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor DigitalContactTracingSweep #417
base: master
Are you sure you want to change the base?
Conversation
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. |
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);