Exemple #1
0
        public Test(string filePath)
        {
            string solutionFileName = PathToSolutionPath(filePath);
            var    knapsackReader   = new KnapsackReader(filePath, solutionFileName);

            Knapsack knapsack;

            do
            {
                knapsack = knapsackReader.ReadKnapsack();

                if (knapsack != null)
                {
                    _knapsacks.Add(knapsack);
                }
            } while (knapsack != null);
        }
Exemple #2
0
        public Test(StreamReader streamReader, GeneratorSetup generatorSetup)
        {
            KnapsackReader knapsackReader = new KnapsackReader(streamReader);

            _generatorSetup = generatorSetup;

            Knapsack knapsack;

            do
            {
                knapsack = knapsackReader.ReadKnapsack();

                if (knapsack != null)
                {
                    _knapsacks.Add(knapsack);
                }
            } while (knapsack != null);
        }