예제 #1
0
        private void PersonExposed(Human agent, IRandomProvider random)
        {
            var symptoms = Parameters.SymptomWeights.Sample(random);

            agent.Symptoms = symptoms;
            var incubationRate = 1d / Parameters.IncubationPeriod;

            agent.IncubationPeriod = random.SampleDaysInState(incubationRate);

            var infectiousRate = 1d / Parameters.TimeInfectious;

            agent.DaysInfectious = random.SampleDaysInState(infectiousRate);
        }
예제 #2
0
        private void IncubationEndsSevere(Human agent, IRandomProvider random)
        {
            agent.SevereToHospital = random.Chance(Parameters.PropStoH);
            var meanTimeToAdmission = agent.SevereToHospital ? Parameters.TimeStoH : Parameters.TimeStoC;
            var progressionRate     = 1d / meanTimeToAdmission;

            agent.DaysIsolated = random.SampleDaysInState(progressionRate);
        }
예제 #3
0
        private void PersonMovedToIcu(Human agent, IRandomProvider random)
        {
            agent.DiesInIcu = random.Chance(Parameters.PropDieInIcu);
            var meanTimeInIcu = agent.DiesInIcu ? Parameters.TimeCtoD : Parameters.TimeCtoR;
            var rateOfExit    = 1d / meanTimeInIcu;

            agent.DaysInIntensiveCare = random.SampleDaysInState(rateOfExit);
        }
예제 #4
0
        private void PersonAdmitToHospital(Human agent, IRandomProvider random)
        {
            agent.HospitalOutcome = Parameters.HospitalizationOutcomes.Sample(random);
            var meanLengthOfStay = agent.HospitalOutcome switch
            {
                HospitalOutcome.Recover => Parameters.TimeHtoR,
                HospitalOutcome.IntensiveCare => Parameters.TimeHToC,
                HospitalOutcome.Die => Parameters.TimeHtoD,
                _ => throw new InvalidEnumArgumentException(
                          $"Mean time in hospital for outcome {agent.HospitalOutcome} has not been mapped in the disease parameters")
            };

            var dischargeRate = 1d / meanLengthOfStay;

            agent.DaysInHospital = random.SampleDaysInState(dischargeRate);
        }
예제 #5
0
 private void AgentExposed(SirAgent agent, IRandomProvider random)
 {
     agent.IncubationTime = random.SampleDaysInState(agent.SirContext.SigmaParam);
 }
예제 #6
0
 private void AgentBecomesInfectious(SirAgent agent, IRandomProvider random)
 {
     agent.InfectiousDays = random.SampleDaysInState(agent.SirContext.GammaParam);
 }