public void getRecursivePattern(Pallet pallet)
        {
            int level = 1;
            int Lstar;
            int Wstar;
            Pallet smallerArea;
            BlockHeuristic blockHeuristic = new BlockHeuristic();
            while (true) {
                if (level == 1) {
                    blockHeuristic.getPattern(pallet);

                }

                else
                {
                }

            }
        }
Esempio n. 2
0
        private void runButton_Click(object sender, EventArgs e)
        {
            if (drawingDone)
            {
                drawingDone = true;
            }
            else {
                this.CreateGraphics().Clear(SystemColors.Control);
            }
            Configuration.boxHeight = (int)boxHeightValue.Value;
            Configuration.boxWidth = (int)boxWidthValue.Value;
            Configuration.palletHeight = (int)palletHeightValue.Value;
            Configuration.palletWidth = (int)palletWidthValue.Value;
            Configuration.chosenAlgo = chosenAlgoValue.SelectedIndex;

            pallet = new Pallet(this.CreateGraphics());
            string algo = chosenAlgoValue.SelectedIndex.ToString() ;
            switch(algo){
                case "-1":
                    //TODO warning
                    return;
                case "0":
                    BlockHeuristic blockHeuristic = new BlockHeuristic();
                    blockHeuristic.getPattern(pallet);
                    break;
                case "1":
                    RecursiveBlockHeuristics recursiveBlockHeuristic = new RecursiveBlockHeuristics();
                    //TODO
                    recursiveBlockHeuristic.getPattern(pallet);
                    break;
                case "2":
                    //TODO genetic
                    break;
            }
            getAreaBound();
            getBarnesBound();
            drawResults();
            pallet.getBorder();
            bool pattern = pallet.getCorrectPattern();
            Console.WriteLine(pattern);
            Console.ReadLine();
            shiftInBoxes.Text = "Shift in boxes: " +  pallet.getStabilityShift().ToString();
        }