Exemplo n.º 1
0
        private void EvaluateInfection(Disease disease, Person person, Person[] people)
        {
            foreach (var collision in _pathfinder.GetCollisions(person, people))
            {
                if (collision.State == State.Suspeptible && Randomness.Percent() < disease.Infectivity)
                {
                    collision.State = State.Infected;
                }
            }

            if (person.DaysInfected++ > disease.SymptomaticDays)
            {
                if (Randomness.Percent() < disease.FatalityRate)
                {
                    person.State = State.Dead;
                }
                else if (Randomness.Percent() < disease.RecoveryRate)
                {
                    person.State = State.Recovered;
                }
            }
        }
Exemplo n.º 2
0
        private Point GetRandomBusiness()
        {
            var business = Randomness.Next(_businesses);

            return(business.Location);
        }
Exemplo n.º 3
0
        private Point GetRandomResidence()
        {
            var residence = Randomness.Next(_residence);

            return(residence.Location);
        }