Class AbstractAlgorithmExecutor

java.lang.Object
org.yamcs.algorithms.AbstractAlgorithmExecutor
All Implemented Interfaces:
AlgorithmExecutor
Direct Known Subclasses:
AbstractJavaExprExecutor, MathAlgorithmExecutor, ScriptAlgorithmExecutor

public abstract class AbstractAlgorithmExecutor extends Object implements AlgorithmExecutor
Skeleton implementation for algorithms conforming to the XTCE Algorithm definition.

It collects all the inputs into an inputList and implements the triggering based on the mandatory parameters.

  • Field Details

  • Constructor Details

  • Method Details

    • update

      public boolean update(ProcessingData processingData)
      update the parameters and return true if the algorithm should run
      Specified by:
      update in interface AlgorithmExecutor
      Parameters:
      processingData -
      Returns:
      true if the algorithm should run
    • getInputParameter

      public ParameterValue getInputParameter(ProcessingData processingData, ParameterInstanceRef pref)
    • getInputArgument

      public ArgumentValue getInputArgument(ProcessingData processingData, ArgumentInstanceRef ref)
    • updateInput

      protected void updateInput(int idx, InputParameter inputParameter, ParameterValue newValue)
      Called when the given inputParameter receives a value. idx is the index of the inputParameter in the algorithm definition input list.

      newValue can be either a ParameterValue or a ArgumentValue

      Can be used by subclasses to perform specific actions;

      Note that all values are also collected in the inputList

      Parameters:
      inputParameter -
      newValue -
    • updateInputArgument

      protected void updateInputArgument(int idx, InputParameter inputParameter, ArgumentValue newValue)
      Called when the given inputParameter which contains a reference to an argument receives an argument value.

      idx is the index of the inputParameter in the algorithm.

      Parameters:
      idx -
      inputParameter -
      newValue -
    • getOutputParameter

      protected Parameter getOutputParameter(int idx)
      Returns the output parameter with the given index.
      Parameters:
      idx -
      Returns:
    • getExecutionContext

      public AlgorithmExecutionContext getExecutionContext()
      Specified by:
      getExecutionContext in interface AlgorithmExecutor
      Returns:
      the execution context in which the executor activates
    • getAlgorithm

      public Algorithm getAlgorithm()
      Specified by:
      getAlgorithm in interface AlgorithmExecutor