Exemple #1
0
        private void UpdateIncreaseState(string m1)
        {
            foreach (Virus item in this.ListViruses.ToList())
            {
                if (item.IsResistanceM1 && item.isIncrease(this.VirusNum, this.CellsNum))
                {
                    Virus descendent = new Virus(0.1, 0.03, 0.005);
                    //descendent.IsResistanceM1 = true;

                    this.ListViruses.Add(descendent);
                }
            }
        }
Exemple #2
0
        //^do the same active like the last just when the patient gets medicine
        private void UpdateIncreaseState(List <string> m1)
        {
            foreach (Virus item in this.ListViruses.ToList())
            {
                int found = 0;
                foreach (var medicine in m1)
                {
                    if (item.Medicines[medicine] == true)
                    {
                        found++;
                    }
                }
                if (found == m1.Count() && item.isIncrease(this.VirusNum, this.CellsNum))
                {
                    Virus descendent = new Virus(0.1, 0.03, 0.005);
                    //descendent.IsResistanceM1 = true;

                    this.ListViruses.Add(descendent);
                }
            }
            this.VirusNum = this.ListViruses.Count();
        }