@Test public void testSettingMissingValue() { ModelsEvaluator models = createModels("src/test/resources/config/rankexpression/"); { FunctionEvaluator function = models.evaluatorOf("macros", "secondphase"); assertTrue(Double.isNaN(function.evaluate().asDouble())); } { FunctionEvaluator function = models.evaluatorOf("macros", "secondphase"); function.setMissingValue(5); assertEquals(40.0, function.evaluate().asDouble(), delta); } { FunctionEvaluator function = models.evaluatorOf("macros", "secondphase"); function.setMissingValue(5); function.bind("match", 3); assertEquals(32.0, function.evaluate().asDouble(), delta); } }
public FunctionEvaluator evaluatorOf(String modelName, String ... names) { return requireModel(modelName).evaluatorOf(names); }
ModelsEvaluator extends AbstractComponent { public FunctionEvaluator evaluatorOf(String modelName, String ... names) { return requireModel(modelName).evaluatorOf(names); } }
ModelsEvaluator extends AbstractComponent { public FunctionEvaluator evaluatorOf(String modelName, String ... names) { return requireModel(modelName).evaluatorOf(names); } @Inject  ModelsEvaluator(RankProfilesConfig config,
                           RankingConstantsConfig constantsConfig,
                           FileAcquirer fileAcquirer);  ModelsEvaluator(Map<String, Model> models); }
ModelsEvaluator extends AbstractComponent { public FunctionEvaluator evaluatorOf(String modelName, String ... names) { return requireModel(modelName).evaluatorOf(names); } @Inject  ModelsEvaluator(RankProfilesConfig config,
                           RankingConstantsConfig constantsConfig,
                           FileAcquirer fileAcquirer);  ModelsEvaluator(Map<String, Model> models); Map<String, Model> models(); FunctionEvaluator evaluatorOf(String modelName, String ... names); Model requireModel(String name); }
ModelsEvaluator extends AbstractComponent { public FunctionEvaluator evaluatorOf(String modelName, String ... names) { return requireModel(modelName).evaluatorOf(names); } @Inject  ModelsEvaluator(RankProfilesConfig config,
                           RankingConstantsConfig constantsConfig,
                           FileAcquirer fileAcquirer);  ModelsEvaluator(Map<String, Model> models); Map<String, Model> models(); FunctionEvaluator evaluatorOf(String modelName, String ... names); Model requireModel(String name);  }