public void TestRenderFunction() { EncogProgram expression = new EncogProgram("(sin(x)+cos(x))/2"); RenderRPN render = new RenderRPN(); String result = render.Render(expression); Assert.AreEqual("x [sin] x [cos] [+] 2 [/]", result); }
public void TestRenderComplex() { EncogProgram expression = new EncogProgram("((a+25)^3/25)-((a*3)^4/250)"); RenderRPN render = new RenderRPN(); String result = render.Render(expression); Assert.AreEqual("a 25 [+] 3 [^] 25 [/] a 3 [*] 4 [^] 250 [/] [-]", result); }
public void TestRenderBasic() { EncogProgram expression = new EncogProgram("(2+6)"); RenderRPN render = new RenderRPN(); String result = render.Render(expression); Assert.AreEqual("2 6 [+]", result); }
public void TestKnownConst() { EncogProgram expression = new EncogProgram("x*2*PI"); RenderRPN render = new RenderRPN(); String result = render.Render(expression); Assert.AreEqual("x 2 [*] PI [*]", result); }
/// <inheritdoc /> public override string ToString() { var render = new RenderRPN(); String code = render.Render(this); var result = new StringBuilder(); result.Append("[EncogProgram: size="); result.Append(Size); result.Append(", score="); result.Append(Score); result.Append(",code="); result.Append(code); result.Append("]"); return result.ToString(); }