Example #1
0
        public void Test_ValueSum3()
        {
            var bagSize = 5;
            var C       = 10;
            var seed    = 609;
            var testBag = new Knapsack(bagSize, C, seed);

            testBag.GenerateItems();
            testBag.SortTheItems();
            testBag.FitTheItemsInTheBag();
            testBag.PrintTheBag();
            Assert.AreEqual(testBag.ValueSum, 14);
        }
Example #2
0
        public void Test_ValueSum1()
        {
            var bagSize = 30;
            var C       = 20;
            var seed    = 2137;
            var testBag = new Knapsack(bagSize, C, seed);

            testBag.GenerateItems();
            testBag.SortTheItems();
            testBag.FitTheItemsInTheBag();
            testBag.PrintTheBag();
            Assert.AreEqual(testBag.ValueSum, 61);
        }