private void DoCollisionForControlElements(ControlElements ce, int interference_level)
 {
     for (int i = 0; i < ce.GetList().Count; i++)
     {
         if (interference_level > Functions.GenerateRandomNumber(0, 10000))
         {
             if (ce[i] == 0)
             {
                 ce[i] = 1;
             }
             else
             {
                 ce[i] = 0;
             }
         }
     }
 }
Example #2
0
 private void DoCollisionForControlPart(ControlElements ce, int interference_level)
 {
     for (int i = 0; i < ce.GetList().Count; i++, x += x_step)
     {
         if (Math.Abs(Function(x)) > (double)1 / interference_level) // dla wartosci
         {
             if (ce[i] == 0)                                         // ustawia zawsze wartosc przeciwna w momencie wystapienia zaklocenia
             {
                 ce[i] = 1;
             }
             else
             {
                 ce[i] = 0;
             }
         }
     }
 }