@Test public void testFloatAdd() throws InvalidIdentification { Parameter floatPara = prm .getParameter(NamedObjectId.newBuilder().setName("/REFMDB/SUBSYS1/FloatPara1_1_2").build()); Parameter floatAddition = prm .getParameter(NamedObjectId.newBuilder().setName("/REFMDB/SUBSYS1/AlgoFloatAddition").build()); final ArrayList<ParameterValue> params = new ArrayList<>(); prm.addRequest(Arrays.asList(floatPara, floatAddition), (ParameterConsumer) (subscriptionId, items) -> params.addAll(items)); proc.start(); tmGenerator.generate_PKT1_1(); assertEquals(2, params.size()); for (ParameterValue pvwi : params) { if (pvwi.getParameter().equals(floatPara)) { assertEquals(0.1672918, pvwi.getEngValue().getFloatValue(), 0.001); } else if (pvwi.getParameter().equals(floatAddition)) { assertEquals(2.1672918, pvwi.getEngValue().getFloatValue(), 0.001); } else { fail("Unexpected parameter " + pvwi.getParameter()); } } }
@Override public Parameter getParameter(NamedObjectId paraId) throws InvalidIdentification { Parameter p; if (paraId.hasNamespace()) { p = outParamIndex.get(paraId.getNamespace(), paraId.getName()); } else { p = outParamIndex.get(paraId.getName()); } if (p != null) { return p; } else { throw new InvalidIdentification(); } }
AlgorithmManager extends AbstractProcessorService implements ParameterProvider, DVParameterConsumer, ProcessorService { @Override public Parameter getParameter(NamedObjectId paraId) throws InvalidIdentification { Parameter p; if (paraId.hasNamespace()) { p = outParamIndex.get(paraId.getNamespace(), paraId.getName()); } else { p = outParamIndex.get(paraId.getName()); } if (p != null) { return p; } else { throw new InvalidIdentification(); } } }
AlgorithmManager extends AbstractProcessorService implements ParameterProvider, DVParameterConsumer, ProcessorService { @Override public Parameter getParameter(NamedObjectId paraId) throws InvalidIdentification { Parameter p; if (paraId.hasNamespace()) { p = outParamIndex.get(paraId.getNamespace(), paraId.getName()); } else { p = outParamIndex.get(paraId.getName()); } if (p != null) { return p; } else { throw new InvalidIdentification(); } }  }
AlgorithmManager extends AbstractProcessorService implements ParameterProvider, DVParameterConsumer, ProcessorService { @Override public Parameter getParameter(NamedObjectId paraId) throws InvalidIdentification { Parameter p; if (paraId.hasNamespace()) { p = outParamIndex.get(paraId.getNamespace(), paraId.getName()); } else { p = outParamIndex.get(paraId.getName()); } if (p != null) { return p; } else { throw new InvalidIdentification(); } }  @Override void init(Processor processor, YConfiguration config, Object spec); static void registerAlgorithmEngine(String name, AlgorithmEngine eng); int getSubscriptionId(); @Override void startProviding(Parameter paramDef); AlgorithmExecutionContext createContext(String name); void activateAlgorithm(Algorithm algorithm, AlgorithmExecutionContext execCtx,
            AlgorithmExecListener listener); void deactivateAlgorithm(Algorithm algorithm, AlgorithmExecutionContext execCtx); @Override void startProvidingAll(); @Override void stopProviding(Parameter paramDef); @Override boolean canProvide(Parameter p); @Override boolean canProvide(NamedObjectId itemId); @Override Parameter getParameter(NamedObjectId paraId); @Override List<ParameterValue> updateParameters(int subscriptionId, List<ParameterValue> items); List<ParameterValue> updateParameters(List<ParameterValue> items, AlgorithmExecutionContext ctx); @Override void setParameterListener(ParameterListener parameterRequestManager); Processor getProcessor(); void clearAlgorithmOverride(CustomAlgorithm calg); void setAlgorithmText(CustomAlgorithm calg, String text); }
AlgorithmManager extends AbstractProcessorService implements ParameterProvider, DVParameterConsumer, ProcessorService { @Override public Parameter getParameter(NamedObjectId paraId) throws InvalidIdentification { Parameter p; if (paraId.hasNamespace()) { p = outParamIndex.get(paraId.getNamespace(), paraId.getName()); } else { p = outParamIndex.get(paraId.getName()); } if (p != null) { return p; } else { throw new InvalidIdentification(); } }  @Override void init(Processor processor, YConfiguration config, Object spec); static void registerAlgorithmEngine(String name, AlgorithmEngine eng); int getSubscriptionId(); @Override void startProviding(Parameter paramDef); AlgorithmExecutionContext createContext(String name); void activateAlgorithm(Algorithm algorithm, AlgorithmExecutionContext execCtx,
            AlgorithmExecListener listener); void deactivateAlgorithm(Algorithm algorithm, AlgorithmExecutionContext execCtx); @Override void startProvidingAll(); @Override void stopProviding(Parameter paramDef); @Override boolean canProvide(Parameter p); @Override boolean canProvide(NamedObjectId itemId); @Override Parameter getParameter(NamedObjectId paraId); @Override List<ParameterValue> updateParameters(int subscriptionId, List<ParameterValue> items); List<ParameterValue> updateParameters(List<ParameterValue> items, AlgorithmExecutionContext ctx); @Override void setParameterListener(ParameterListener parameterRequestManager); Processor getProcessor(); void clearAlgorithmOverride(CustomAlgorithm calg); void setAlgorithmText(CustomAlgorithm calg, String text);  }