JagsSyntaxModel { public static String writeNumber(Number x, boolean jags) { if (x == null) { return "NA"; } String suffix = jags && isInteger(x) ? "L" : ""; return String.valueOf(x) + suffix; } JagsSyntaxModel(Network network, Parameterization pmtz, boolean isJags); String initialValuesText(StartingValueGenerator generator); String analysisText(String prefix); CompiledTemplate readTemplate(String path); String modelText(); String scriptText(String prefix, int nchains, int tuning, int simulation); String dataText(); int getMaxArmCount(); Integer[][] getTreatmentMatrix(); Integer[][] getResponderMatrix(); Double[][] getMeanMatrix(); Double[][] getStdErrMatrix(); Integer[][] getSampleSizeMatrix(); Double[][] getDoubleMatrix(StudyTreatmentTransformer<Double> transformer); Integer[][] getIntegerMatrix(StudyTreatmentTransformer<Integer> transformer); void getMatrix(N[][] m, StudyTreatmentTransformer<N> transformer); static String writeNumber(Number x, boolean jags); static String writeMatrix(Number[][] m, boolean jags); static String writeVector(Number[] v, boolean jags); static String writeExpression(Map<NetworkParameter, Integer> pmtz, Transformer<NetworkParameter, String> transform);  }
@Test public void testWriteInt() { assertEquals("3L", JagsSyntaxModel.writeNumber(3, true)); assertEquals("15L", JagsSyntaxModel.writeNumber(15, true)); }
@Test public void testWriteFloat() { assertEquals("3.0", JagsSyntaxModel.writeNumber(3.0, true)); assertEquals("15.0", JagsSyntaxModel.writeNumber(15.0, true)); }