Пример #1
0
        public CovidStateModel(DiseaseParameters diseaseParameters)
        {
            Parameters = diseaseParameters;
            //TODO: process parameters?

            SetupStates();

            SetInfectionTransition(new Infection(this, Infectiousness));

            // Incubation transitions
            CreateConditionalTransition(E, A, (agent) => agent.Symptoms == Symptoms.Asymptomatic && agent.NumberOfDaysInCurrentState >= agent.IncubationPeriod);
            CreateConditionalTransition(E, M, (agent) => agent.Symptoms == Symptoms.Mild && agent.NumberOfDaysInCurrentState >= agent.IncubationPeriod);
            CreateConditionalTransition(E, Sv, (agent) => agent.Symptoms == Symptoms.Severe && agent.NumberOfDaysInCurrentState >= agent.IncubationPeriod);

            // Severe to isolation
            CreateConditionalTransition(Sv, Ih, agent => agent.SevereToHospital && agent.NumberOfDaysInCurrentState > agent.DaysInfectious);
            CreateConditionalTransition(Sv, Ic, agent => !agent.SevereToHospital && agent.NumberOfDaysInCurrentState > agent.DaysInfectious);

            // Admitted to hospital
            CreateConditionalTransition(Ih, Hr, agent => agent.HospitalOutcome == HospitalOutcome.Recover && agent.NumberOfDaysInCurrentState >= agent.DaysInHospital);
            CreateConditionalTransition(Ih, Hc, agent => agent.HospitalOutcome == HospitalOutcome.IntensiveCare && agent.NumberOfDaysInCurrentState >= agent.DaysInHospital);
            CreateConditionalTransition(Ih, Hd, agent => agent.HospitalOutcome == HospitalOutcome.Die && agent.NumberOfDaysInCurrentState >= agent.DaysInHospital);

            // Moved to intensive care
            CreateConditionalTransition(Ic, Cr, agent => !agent.DiesInIcu && agent.NumberOfDaysInCurrentState >= agent.DaysIsolated);
            CreateConditionalTransition(Ic, Cd, agent => agent.DiesInIcu && agent.NumberOfDaysInCurrentState >= agent.DaysIsolated);
            CreateConditionalTransition(Hc, Cr, agent => !agent.DiesInIcu && agent.NumberOfDaysInCurrentState >= agent.DaysInHospital);
            CreateConditionalTransition(Hc, Cd, agent => agent.DiesInIcu && agent.NumberOfDaysInCurrentState >= agent.DaysInHospital);

            // Recovery transitions
            CreateConditionalTransition(A, Ar, (agent) => agent.NumberOfDaysInCurrentState >= agent.DaysInfectious);
            CreateConditionalTransition(M, Mr, (agent) => agent.NumberOfDaysInCurrentState >= agent.DaysInfectious);
            CreateConditionalTransition(Hr, Rh, agent => agent.NumberOfDaysInCurrentState >= agent.DaysInHospital);
            CreateConditionalTransition(Cr, Rc, agent => agent.NumberOfDaysInCurrentState >= agent.DaysInIntensiveCare);

            // Deaths
            CreateConditionalTransition(Hd, Dh, agent => agent.NumberOfDaysInCurrentState >= agent.DaysInHospital);
            CreateConditionalTransition(Cd, Dc, agent => agent.NumberOfDaysInCurrentState >= agent.DaysInIntensiveCare);
        }
Пример #2
0
 internal override DiseaseParameters ApplyAction(DiseaseParameters diseaseParameters)
 {
     return(diseaseParameters);
 }
Пример #3
0
        internal override DiseaseParameters ApplyAction(DiseaseParameters diseaseParameters)
        {
            diseaseParameters.AmountOfInfectedPeopleComingBackFromHolidayDaily = 0;

            return(diseaseParameters);
        }
Пример #4
0
 internal abstract DiseaseParameters ApplyAction(DiseaseParameters diseaseParameters);
Пример #5
0
 internal override DiseaseParameters ApplyAction(DiseaseParameters diseaseParameters)
 {
     diseaseParameters.InfectionChance *= 0.6;
     return(diseaseParameters);
 }