public void TestRenderFunction() { EncogProgram expression = new EncogProgram("(sin(x)+cos(x))/2"); RenderEPL render = new RenderEPL(); String result = render.Render(expression); Assert.AreEqual("[#var:0:0][sin:1][#var:0:0][cos:1][+:2][#const:0:2][/:2]", result); }
public void TestRenderComplex() { EncogProgram expression = new EncogProgram("((a+25)^3/25)-((a*3)^4/250)"); RenderEPL render = new RenderEPL(); String result = render.Render(expression); Assert.AreEqual("[#var:0:0][#const:0:25][+:2][#const:0:3][^:2][#const:0:25][/:2][#var:0:0][#const:0:3][*:2][#const:0:4][^:2][#const:0:250][/:2][-:2]", result); }
public void TestRenderBasic() { EncogProgram expression = new EncogProgram("(2+6)"); RenderEPL render = new RenderEPL(); String result = render.Render(expression); Assert.AreEqual("[#const:0:2][#const:0:6][+:2]", result); }
/// <summary> /// The string as an EPL expression. EPL is the format that /// EncogPrograms are usually persisted as. /// </summary> /// <returns>EPL code.</returns> public String GenerateEPL() { var render = new RenderEPL(); return render.Render(this); }