public bool ExecuteOnlyTrue(string file, string condition) { double line = 0; //retorna a porcentagem (como inteiro) dos grafos que satisfazem using (StreamReader stReaderIn = new StreamReader(_path + file + ".g6")) { String g6Line = stReaderIn.ReadLine(); while (g6Line != null) { line++; if (!BuildLogic.EvaluateText(condition, new Graph(g6Line))) { return(false); } g6Line = stReaderIn.ReadLine(); } return(true); } }
public double Execute(string file, string condition) { double total = 0; double contador = 0; //retorna a porcentagem (como inteiro) dos grafos que satisfazem using (StreamReader stReaderIn = new StreamReader(_path + file + ".g6")) { String g6Line = stReaderIn.ReadLine(); while (g6Line != null) { total++; if (BuildLogic.EvaluateText(condition, new Graph(g6Line))) { contador++; } g6Line = stReaderIn.ReadLine(); } return(Math.Round((double)100 * (contador / total), 2)); } }