예제 #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();
 }