Package ptolemy.data.ontologies.lattice
Class ApplyBinaryFunctionToMultipleArguments
- java.lang.Object
-
- ptolemy.data.ontologies.ConceptFunction
-
- ptolemy.data.ontologies.lattice.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)
-
-
Field Summary
-
Fields inherited from class ptolemy.data.ontologies.ConceptFunction
_argumentDomainOntologies, _name, _numArgsIsFixed, _outputRangeOntology
-
-
Constructor Summary
Constructors Constructor Description ApplyBinaryFunctionToMultipleArguments(java.lang.String name, Ontology inputOutputOntology, ConceptFunction binaryFunction)
Create a new ApplyBinaryFunctionToMultipleArguments concept function for the specified binary concept function and ontology.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Concept
_evaluateFunction(java.util.List<Concept> argValues)
Evaluate the concept function for the given list of arguments.-
Methods inherited from class ptolemy.data.ontologies.ConceptFunction
evaluateFunction, getArgumentDomainOntologies, getName, getNumberOfArguments, getOutputRangeOntology, isMonotonic, isNumberOfArgumentsFixed, toString
-
-
-
-
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 classConceptFunction
- 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.
-
-