Example #1
0
 public void OneTimeSetUp()
 {
     personCitizen        = PersonFactory.GenerateCitizen();
     personMedicalStaff   = PersonFactory.GenerateMedicalStaff();
     personMilitary       = PersonFactory.GenerateMilitary();
     personFirstResponder = PersonFactory.GenerateFirstResponder();
 }
Example #2
0
 public void ProtectionTest()
 {
     Assert.AreEqual(person.Prevention, 0);
     Assert.GreaterOrEqual(PersonFactory.GenerateMedicalStaff().Protection, 97.70);
     Assert.GreaterOrEqual(PersonFactory.GenerateMilitary().Protection, 88.79);
     Assert.GreaterOrEqual(PersonFactory.GenerateFirstResponder().Protection, 97.70);
 }
Example #3
0
        public bool MeetTest(Person.HealthStatusEnum meetPersonHealth, Person.HealthStatusEnum personHealth)
        {
            Person meetPerson = PersonFactory.GenerateMedicalStaff();

            meetPerson.Health = meetPersonHealth;
            person.Health     = personHealth;

            person.Meet(meetPerson);
            return(person.IsContagious);
        }
Example #4
0
        /// <summary>
        /// Primary simulator class constructor //TODO: Add more complex settings
        /// </summary>
        /// <param name="citizenCount">Ordinary citizen count</param>
        /// <param name="medicalStaffCount">Medical staff count</param>
        /// <param name="firstResponderCount">First responder count</param>
        /// <param name="militaryCount">Military personnel count</param>
        /// <param name="infectedCitizenCount">Infected citizen count</param>
        public Simulator(uint citizenCount, uint medicalStaffCount, uint firstResponderCount, uint militaryCount,
                         uint infectedCitizenCount)
        {
            //Generate people
            for (uint i = 0; i < citizenCount; i++)
            {
                Citizens.Add(PersonFactory.GenerateCitizen());
            }

            //Generate people
            for (uint i = 0; i < infectedCitizenCount; i++)
            {
                Citizens.Add(PersonFactory.GenerateCitizen(Person.HealthStatusEnum.Symptoms));
            }

            //Generate medicalStaff
            for (uint i = 0; i < medicalStaffCount; i++)
            {
                Citizens.Add(PersonFactory.GenerateMedicalStaff());
            }

            //Generate military
            for (uint i = 0; i < militaryCount; i++)
            {
                Citizens.Add(PersonFactory.GenerateMilitary());
            }

            //Generate firstResponder
            for (uint i = 0; i < firstResponderCount; i++)
            {
                Citizens.Add(PersonFactory.GenerateMilitary());
            }

            Console.WriteLine($"Starting state {_day++}");
            Console.WriteLine(
                $"Healthy count: {Citizens.Count(person => person.Health == Person.HealthStatusEnum.Healthy)}");
            Console.WriteLine(
                $"Asymptomatic count: {Citizens.Count(person => person.Health == Person.HealthStatusEnum.Asymptomatic)}");
            Console.WriteLine(
                $"Symptoms count: {Citizens.Count(person => person.Health == Person.HealthStatusEnum.Symptoms)}");
            Console.WriteLine(
                $"Seriously ill count: {Citizens.Count(person => person.Health == Person.HealthStatusEnum.SeriouslyIll)}");
            Console.WriteLine(
                $"Immune count: {Citizens.Count(person => person.Health == Person.HealthStatusEnum.Immune)}");
            Console.WriteLine(
                $"Dead count: {Citizens.Count(person => person.Health == Person.HealthStatusEnum.Deceased)}");
            Console.WriteLine(
                "###############");
        }