Exemplo n.º 1
0
        public void run()
        {
            CSVFile      csvFile = new CSVFile();
            TrepaColinas tr      = getNewIntace();

            csvFile.Write(0, 0, tr.descricao());
            csvFile.addCabecalhoTC(data);
            Hipotese best = null;

            for (int i = 0; i < tests; i++)
            {
                tr = getNewIntace();
                tr.run();
                Hipotese hip = tr.getBest();
                if ((best == null || best.eval > hip.eval) && hip.valido == 0) // guardar a melhor
                {
                    best = new Hipotese(hip, "Melhor", hip.interacao);
                    best.evaluate();
                }

                //Console.Out.WriteLine(hip.ToString2() + " : " + hip.ToString());
                //System.Threading.Thread.Sleep(100);

                csvFile.addBestTrepaColinas(tr);
            }
            if (best != null)
            {
                best.evaluate();
                csvFile.addHipoteseTC(best);
            }
            else
            {
                csvFile.Write(0, -1, "Nao foi encontrada nenhuma solucao");
            }
            csvFile.toFile(outputfile);
        }
Exemplo n.º 2
0
 public override string descricao()
 {
     return(_evolutivo.descricao() + " e " + _trepaColinas.descricao());
 }