public CFGPythonSolution(ISymbolicExpressionTree tree, ICFGPythonProblemData problemData, double timeout, PythonProcess pythonProcess) : base(tree, problemData) { name = ItemName; description = ItemDescription; string program = PythonHelper.FormatToProgram(tree, problemData.LoopBreakConst, problemData.FullHeader, problemData.FullFooter); Add(new Result(ProgramResultName, "The program with header and footer", new TextValue(program))); string code = CFGSymbolicExpressionTreeStringFormatter.StaticFormat(tree); Add(new Result(CodeResultName, "The code that was evolved", new TextValue(code))); Evaluate(problemData, program, timeout, pythonProcess); }
public BrokenIndividual(ISymbolicExpressionTree tree, string exception, bool includeTree, ICFGPythonProblemData problemData) { name = String.Format("{0}: {1}", ItemName, exception); description = ItemDescription; Add(new Result(ModelLengthResultName, "Length of the symbolic regression model.", new IntValue(tree.Length))); Add(new Result(ModelDepthResultName, "Depth of the symbolic regression model.", new IntValue(tree.Depth))); if (includeTree) { Add(new Result(ModelResultName, "The CFG model.", tree)); } Add(new Result(ExceptiontName, "The CFG model.", new StringValue(exception))); string program = PythonHelper.FormatToProgram(tree, problemData.LoopBreakConst, problemData.FullHeader, problemData.FullFooter); Add(new Result(ProgramResultName, "The program with header and footer", new TextValue(program))); string code = CFGSymbolicExpressionTreeStringFormatter.StaticFormat(tree); Add(new Result(CodeResultName, "The code that was evolved", new TextValue(code))); }