Class ApplyBinaryFunctionToMultipleArguments


  • public class ApplyBinaryFunctionToMultipleArguments
    extends ConceptFunction
    A concept function that applies a binary concept function to multiple arguments in sequence.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Charles Shelton
    Pt.AcceptedRating:
    Red (cshelton)
    Pt.ProposedRating:
    Red (cshelton)
    • Constructor Detail

      • ApplyBinaryFunctionToMultipleArguments

        public ApplyBinaryFunctionToMultipleArguments​(java.lang.String name,
                                                      Ontology inputOutputOntology,
                                                      ConceptFunction binaryFunction)
                                               throws IllegalActionException
        Create a new ApplyBinaryFunctionToMultipleArguments concept function for the specified binary concept function and ontology.
        Parameters:
        name - The name of this function.
        inputOutputOntology - The ontology over which this function is defined.
        binaryFunction - The binary concept function to be applied to the input arguments
        Throws:
        IllegalActionException - Thrown if the given binary concept function is not specified to have exactly 2 arguments.
    • Method Detail

      • _evaluateFunction

        protected Concept _evaluateFunction​(java.util.List<Concept> argValues)
                                     throws IllegalActionException
        Evaluate the concept function for the given list of arguments. If the list of arguments is empty, return null. If there is only one concept in the argument list, return that concept. If there are 2 or more concepts in the argument list, apply the specified binary concept function sequentially to all input values, and return the final result.
        Specified by:
        _evaluateFunction in class ConceptFunction
        Parameters:
        argValues - The list of concept arguments for which the function will be evaluated.
        Returns:
        The output concept value;
        Throws:
        IllegalActionException - Thrown if there is an error calculating the output concept result.