예제 #1
0
        private void EjecutarILS()
        {
            QAP qap = new QAP(bestSolution);

            BusquedaLocal bl = new BusquedaLocal(qap);

            qap = bl.ResolverBL();
            QAP best = new QAP(qap);

            for (int i = 0; i < 24; i++)
            {
                Mutar(qap);
                bl  = new BusquedaLocal(qap);
                qap = bl.ResolverBL();

                if (qap.GetCoste() < best.GetCoste())
                {
                    best = new QAP(qap);
                }
                else
                {
                    qap = new QAP(best);
                }
            }


            bestSolution = new QAP(best);
        }
예제 #2
0
        private void OptimizacionBL()
        {
            QAP           qap = new QAP(tamProblema, localizacionesEnUnidades, flujosUnidades, distanciasLocalizaciones);
            BusquedaLocal bl  = new BusquedaLocal(qap);

            solucion = bl.ResolverBL();
        }
예제 #3
0
        public BMB(int numMultiarranque, string ruta)
        {
            QAP           qap  = new QAP(ruta);
            BusquedaLocal bl   = new BusquedaLocal(qap);
            QAP           best = bl.ResolverBL();

            for (int i = 1; i < numMultiarranque; i++)
            {
                qap = new QAP(ruta);
                bl  = new BusquedaLocal(qap);
                qap = bl.ResolverBL();
                if (qap.GetCoste() < best.GetCoste())
                {
                    best.SetQAP(qap);
                }
            }

            solucion = best;
        }