Beispiel #1
0
 private static bool IsUseful(CustomIndex subject, List <CustomIndex> otherCustomIndices, List <CustomIndex> supportedCustomIndices)
 {
     // Subject is useful if it can fit a CustomIndex that no other can fit
     if (supportedCustomIndices.Any(ci => subject.Fits(ci) && !otherCustomIndices.Any(o => o.Fits(ci))))
     {
         return(true);
     }
     return(false);
 }
Beispiel #2
0
        private static int NumSupportedPackages(List <CustomIndex> packageCustomIndices, int i, CustomIndex ci)
        {
            int supported = 0;
            int index     = i;

            while (index < packageCustomIndices.Count)
            {
                if (ci.Fits(packageCustomIndices[index++]))
                {
                    supported++;
                }
                else
                {
                    return(supported);
                }
            }
            return(supported);
        }