Exemplo n.º 1
0
        static void Main(string[] args)
        {
            int    nbBlock;
            int    nbAisle;
            int    aisleLenght;
            int    nbRun;
            int    pickingListSize;
            string algoUsed;

            if (args.Length == 6)
            {
                nbBlock         = ConvertToInt(args[0]);
                nbAisle         = ConvertToInt(args[1]);
                aisleLenght     = ConvertToInt(args[2]);
                nbRun           = ConvertToInt(args[3]);
                pickingListSize = ConvertToInt(args[4]);
                algoUsed        = args[5];
            }
            else
            {
                nbBlock         = ConvertToInt(ConfigurationManager.AppSettings["nbBlock"]);
                nbAisle         = ConvertToInt(ConfigurationManager.AppSettings["nbAisle"]);
                aisleLenght     = ConvertToInt(ConfigurationManager.AppSettings["aisleLenght"]);
                nbRun           = ConvertToInt(ConfigurationManager.AppSettings["nbRun"]);
                pickingListSize = ConvertToInt(ConfigurationManager.AppSettings["pickingListSize"]);
                algoUsed        = ConfigurationManager.AppSettings["algoUsed"];
            }
            var          solversName = algoUsed.Split(';');
            List <float> accumulated = null;

            for (int i = 0; i < nbRun; i++)
            {
                var problem = WarehousePickingCoreGenerator.GenerateProblem(nbBlock, nbAisle, aisleLenght,
                                                                            pickingListSize);
                var solvers =
                    solversName.Select(
                        x => WarehousePickingCoreGenerator.GenerateSolver(x, problem.Item1, problem.Item2));
                var solutions = solvers.Select(s => (float)s.Solve().Length()).ToList();
                if (accumulated == null)
                {
                    accumulated = solutions;
                }
                else
                {
                    for (int j = 0; j < accumulated.Count; j++)
                    {
                        accumulated[j] += solutions[j];
                    }
                }
            }
            Debug.Assert(accumulated != null, "accumulated != null");
            for (int j = 0; j < accumulated.Count; j++)
            {
                accumulated[j] /= (float)nbRun;
            }
            var res = String.Join(";", accumulated);

            Console.WriteLine(res);
            Console.ReadLine();
        }
Exemplo n.º 2
0
 private void SShapeSolver_Click(object sender, EventArgs e)
 {
     if (_sShapeSolver == null)
     {
         _sShapeSolver =
             WarehousePickingCoreGenerator.GenerateSolver(warehouse_picking_core.Solver.SShapeSolver.SolverName,
                                                          _currentWarehouse,
                                                          _currentPickings);
     }
     Solver_Click(_sShapeSolver);
 }
Exemplo n.º 3
0
        private void DummySolver_Click(object sender, EventArgs e)
        {
            if (_currentWarehouse == null || _currentPickings == null)
            {
                MessageBox.Show(@"Please start to generate a warehouse");
                return;
            }
            if (_dummySolver == null)
            {
                _dummySolver =
                    WarehousePickingCoreGenerator.GenerateSolver(warehouse_picking_core.Solver.DummySolver.SolverName,
                                                                 _currentWarehouse,
                                                                 _currentPickings);
            }
            var solution = _dummySolver.Solve();

            if (IsValidSolution(solution, _currentWarehouse))
            {
                _drawer.DrawSolution(solution);
                Refresh();
                UpdateDistanceLastSolution(solution);
            }
        }
Exemplo n.º 4
0
        private void generate_Click(object sender, EventArgs e)
        {
            var rnd = new Random();
            //const int nbBlock = 1;
            int nbBlock     = rnd.Next(1, 5);
            int nbAisles    = rnd.Next(1, 20);
            int aisleLenght = rnd.Next(5, 25);

            //int nbBlock = 2;
            //int nbAisles = 6;
            //int aisleLenght = 1;
            if (_drawer == null)
            {
                _drawer = new Drawer();
            }
            else
            {
                _drawer.Clear();
            }
            int       wishSize  = rnd.Next(1, nbBlock * nbAisles * aisleLenght) / 1;
            var       problem   = WarehousePickingCoreGenerator.GenerateProblem(nbBlock, nbAisles, aisleLenght, wishSize);
            var       warehouse = problem.Item1;
            IPickings pickings  = problem.Item2;

            _drawer.DrawWarehouse(warehouse);
            Paint += _drawer.Drawing_handler;
            _drawer.DrawPickingObjectif(pickings);
            Refresh();
            _currentWarehouse = warehouse;
            _currentPickings  = pickings;
            _dummySolver      = null;
            _sShapeSolver     = null;
            _sShapeSolverV2   = null;
            _largestGapSolver = null;
            _returnSolver     = null;
            _compositeSolver  = null;
        }