Package org.encog.ml.prg.expvalue

Examples of org.encog.ml.prg.expvalue.ExpressionValue.toStringValue()


     
      if( result.isString() ) {
        line.append("\"");
      }
     
      line.append(result.toStringValue());
     
      if( result.isString() ) {
        line.append("\"");
      }
    }
View Full Code Here


    return renderNode(this.program.getRootNode());
  }

  private String handleConst(ProgramNode node) {
    ExpressionValue v = node.getData()[0];
    return v.toStringValue();
  }

  private String handleVar(ProgramNode node) {
    int varIndex = (int)node.getData()[0].toIntValue();
    return this.program.getVariables().getVariableName(varIndex);
View Full Code Here

    Assert.assertTrue(exp.isInt());
    Assert.assertEquals( 1, exp.toIntValue());
 
    exp = EncogProgram.parseExpression("cstr(1.2345678)");
    Assert.assertTrue(exp.isString());
    Assert.assertEquals( "1.2345678", exp.toStringValue());
   
    exp = EncogProgram.parseExpression("cfloat(\"1.2345678\")");
    Assert.assertTrue(exp.isFloat());
    Assert.assertEquals( "1.2345678", exp.toStringValue());
   
View Full Code Here

    Assert.assertTrue(exp.isString());
    Assert.assertEquals( "1.2345678", exp.toStringValue());
   
    exp = EncogProgram.parseExpression("cfloat(\"1.2345678\")");
    Assert.assertTrue(exp.isFloat());
    Assert.assertEquals( "1.2345678", exp.toStringValue());
   
  }
 
  public void testPrecedence() {
    Assert.assertEquals( -2.5, EncogProgram.parseFloat("1.0+2.0*3.0/4.0-5.0"),Encog.DEFAULT_DOUBLE_EQUAL);   
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.