Example #1
0
        public string CheckIfAllItemsAreAllocated(Configuration configuration, IUtilities Utilities, IPricingUtilities PricingUtilities,
                                                  string itemAllocationMethod, IOutputUtilities OutputUtilities, string pricingRule, string priceUpdatingRule)
        {
            string res = "";

            z = i; // K

            //============ TEST ==============
            LowerBound = Utilities.ComputeLowerBound(NotRemovedItems, configuration.BinWidth, configuration.BinHeight);
            NotRemovedItems.Clear();

            if ((z + LowerBound) > Zstar)
            {
                //goto l2;
                //UpdateItemPrices(configuration, PricingUtilities, priceUpdatingRule);
                res = "UpdateItemPrices";
            }
            //================================

            bool isSortedTemporaryItemsEmpty = true;

            //controllo se tutta la lista รจ stata svuotata
            foreach (Item temporaryItem in TemporaryItems)
            {
                if (temporaryItem.IsRemoved == false)
                {
                    isSortedTemporaryItemsEmpty = false;
                    break;
                }
            }

            if (isSortedTemporaryItemsEmpty)
            {
                //goto l0;
                //UpdateBestSolution(OutputUtilities, itemAllocationMethod, pricingRule, priceUpdatingRule);
                res = "UpdateBestSolution";
            }
            if (!isSortedTemporaryItemsEmpty)
            {
                i += 1;
                //l1
                //FillUpBinI(itemAllocationMethod, Utilities);
                res = "FillUpBinI";
            }
            return(res);
        }