resplab / epicR

R package for the Evaluation Platform in COPD (EPIC), an agent-based whole-disease model for projection of health and economic outcomes and COPD interventions.
11 stars 11 forks source link

validation functions should get updated #110

Closed safaahmadian closed 2 years ago

safaahmadian commented 3 years ago

The sanity_check is not updated after medications were added to the model, so all the tests fail. Other functions need to be checked as well.

aminadibi commented 2 years ago

For the second sanity test, where all utilities are set to 0, it seems that patient id 0 will still collect utilities:

> sanity_check()
Initializing the session
test 1: zero all costs
The value of bg_util_by_stage : 0.81
patient Id is : 0
time is : 1
The value of bg_util_by_stage : 0.81
patient Id is : 0
time is : 2
The value of bg_util_by_stage : 0.81
patient Id is : 0
time is : 3
The value of bg_util_by_stage : 0.81
patient Id is : 0
time is : 4
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 5
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 6
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 7
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 8
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 9
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 10
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 11
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 12
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 13
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 14
The value of bg_util_by_stage : 0.72
patient Id is : 0
time is : 15
The value of bg_util_by_stage : 0.68
patient Id is : 0
time is : 16
The value of bg_util_by_stage : 0.68
patient Id is : 0
time is : 17
The value of bg_util_by_stage : 0.68
patient Id is : 0
time is : 18
The value of bg_util_by_stage : 0.68
patient Id is : 0
time is : 19
The value of bg_util_by_stage : 0.68
patient Id is : 0
time is : 20
aminadibi commented 2 years ago

The problem was caused by carry over memory input, due to not terminating sessions between sanity checks. Fixed in https://github.com/resplab/epicR/commit/11363f0e7043c7c525e248bfd928237d770f11a0 https://github.com/resplab/epicR/releases/tag/v0.28.2