Exemplo n.º 1
0
        public void DCGRASP()
        {
            IConstructiveHeuristic grasp = new SCPGRASP(0.9, 1e-9);
            double cost = grasp.Execute(scpParser.Problem);

            DestructiveConstructive dc = new DestructiveConstructive();

            cost = dc.Execute(grasp.Problem);
            ((SCP)scpParser.Problem).Solution = dc.OptimumSultion;
            TimeSpan elapsed  = dc.Elapsed;
            bool     validity = SolutionValidity();

            Assert.AreEqual(validity, true);
        }
Exemplo n.º 2
0
        public void DCFOG()
        {
            IConstructiveHeuristic fog = new SCPFirstOrderGreedy();
            double cost = fog.Execute(scpParser.Problem);

            DestructiveConstructive dc = new DestructiveConstructive();

            cost = dc.Execute(fog.Problem);
            ((SCP)scpParser.Problem).Solution = dc.OptimumSultion;
            TimeSpan elapsed  = dc.Elapsed;
            bool     validity = SolutionValidity();

            Assert.AreEqual(validity, true);
        }
Exemplo n.º 3
0
        public void Benchmark2()
        {
            SCPParser parser = new SCPParser();

            files.ForEach(file =>
            {
                IOData.ReadFileToMatrix(parser, file);

                //IHeuristic h1 = new SCPGRASP(0.9, 1e-9);
                IHeuristic h1 = new SCPFirstOrderGreedy();
                double cost   = h1.Execute(parser.Problem);

                DestructiveConstructive dc = new DestructiveConstructive();
                cost = dc.Execute(h1.Problem);
                ((SCP)scpParser.Problem).Solution = dc.OptimumSultion;
                TimeSpan elapsed = dc.Elapsed;

                Monitoring.Instance.Write("DCFOG    " + file.Split('\\')[file.Split('\\').Count() - 1] + " " + cost.ToString() + " " + dc.Elapsed.ToString());
            });
        }