Пример #1
0
 /// <summary>
 /// metóda pre výpočet dolnej medze
 /// </summary>
 /// <param name="function">kriteriálna funkcia</param>
 /// <param name="solution">riešenie bez zaokrúhlenia</param>
 /// <returns>dolná medza daného uzla</returns>
 public double CountLowerBound(Equation function, Solution solution)
 {
     double lowerBoundFromRounding = 0;
     Solution roundedSolution = new Solution();
     foreach (double i in solution)
     {
         roundedSolution.Add(Math.Round(i));
     }
     foreach (double i in solution)
     {
         foreach (double j in function.LeftSide)
         {
             if (solution.IndexOf(i)==function.LeftSide.IndexOf(j))
             {
                 lowerBoundFromRounding += j * i;
             }
         }
     }
     return lowerBoundFromRounding;
 }