public decimal CalculateNumberOfInfectiousIndividuals(DiseaseStateDto diseaseStateDto) { var numberOfExposedPeopleOverAverageLatency = diseaseStateDto.NumberOfLatentIndividuals / diseaseStateDto.MeanLatentPeriodInDays; var numberOfInfectedPeopleOverAverageInfectiousPeriod = diseaseStateDto.NumberOfInfectiousIndividuals / diseaseStateDto.MeanInfectiousPeriodInDays; return(decimal.Round(numberOfExposedPeopleOverAverageLatency - numberOfInfectedPeopleOverAverageInfectiousPeriod, 2, MidpointRounding.AwayFromZero)); }
public decimal CalculateNumberOfSusceptibleIndividuals(DiseaseStateDto diseaseStateDto) { var susceptiblePortionOfPopulation = diseaseStateDto.NumberOfSusceptibleIndivudals / diseaseStateDto.TotalPopulation; var averagePeopleInfectedPerInfectiousPerson = diseaseStateDto.BasicReproductiveNumber / diseaseStateDto.MeanInfectiousPeriodInDays; var rateOfChangeInSusceptibleCount = -susceptiblePortionOfPopulation * (averagePeopleInfectedPerInfectiousPerson * diseaseStateDto.NumberOfInfectiousIndividuals + diseaseStateDto.ForceOfBaselineInfection); return(decimal.Round(rateOfChangeInSusceptibleCount, 2, MidpointRounding.AwayFromZero)); }
public void CalculateNumberOfExposedIndividuals_ReturnsExpectedCount() { var diseaseStateDto = new DiseaseStateDto { TotalPopulation = 1000, BasicReproductiveNumber = 2.68M, ForceOfBaselineInfection = 10, MeanInfectiousPeriodInDays = 10, MeanLatentPeriodInDays = 4, NumberOfInfectiousIndividuals = 0, NumberOfLatentIndividuals = 0, NumberOfSusceptibleIndivudals = 990 }; var exposedCalculator = new ExposedCalculator(); var expectedExposed = 9.9M; var actualExposed = exposedCalculator.CalculateNumberOfExposedIndividuals(diseaseStateDto); Assert.AreEqual(expectedExposed, actualExposed); }