Пример #1
0
 public static void MakeValidRandomEquation(Equation eq)
 {
     do
     {
         eq.Cleanup();
         MakeRandomEquation(eq);
         eq.CalcTotalOffSet();
     } while (!Tools.IsANumber(eq.OffSet));
 }
Пример #2
0
 public void CheckNewChild(Equation child)
 {
     for (int i = children.Length - 1; i >= 0; i--)
     {
         if (children[i].OffSet > child.OffSet || children[i].NumberOfAllOperators == 0)
         {
             Equation worstChild = children[0];
             for (int y = 0; y < i; y++)
             {
                 children[y] = children[y + 1];
             }
             worstChild.Cleanup();
             child.MakeClone(worstChild);
             children[i] = worstChild;
             break;
         }
     }
 }
Пример #3
0
 /// <summary>
 /// resets a singl equation making it ready to create a new one
 /// </summary>
 /// <param name="Cand"></param>
 protected void ResetSingle(Equation Cand)
 {
     Cand.Cleanup();
 }