public void ExecutarCrossOver() { var sw = new Stopwatch(); sw.Start(); var helper = new JavascriptHelper(Path.Combine(Environment.CurrentDirectory, "Require"), true, false); var scriptCode = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "Require", "global.js")); helper.ConfigurarGeracao(); var ast = helper.GerarAst(scriptCode); int no = new Random().Next(0, helper.ContarNos(ast)); var astNova = helper.ExecutarMutacaoExclusao(ast, no); sw.Stop(); Console.WriteLine("ExecutarMutacaoExclusao {0}", sw.Elapsed.ToString(@"hh\:mm\:ss\.ffff")); Assert.AreNotEqual(ast, astNova); sw.Reset(); sw.Start(); string astFilho1, astFilho2; helper.ExecutarCrossOver(ast, astNova, 348, 456, out astFilho1, out astFilho2); sw.Stop(); Console.WriteLine("ExecutarCrossOver {0}", sw.Elapsed.ToString(@"hh\:mm\:ss\.ffff")); var codigo = helper.GerarCodigo(astFilho1); var codigoNovo = helper.GerarCodigo(astFilho2); Assert.AreNotEqual(codigo, codigoNovo); File.WriteAllText("codigo.txt", codigo); File.WriteAllText("codigoNovo.txt", codigoNovo); }