Apply a function over one or more input sequences.
This actor will collect tokens from each input port into arrays
and, when enough input tokens have arrived, pass those arrays
to the function specified either at the <i>function</i> parameter
or the port.
<p>
To use this actor, create any number of input ports, add
a parameter named <i>tokenConsumptionRate</i> to each input
port, and set the value of this parameter to the number
of tokens that you would like to be collected into an
array for each function application. Also, create
and set a parameter named <i>tokenProductionRate</i>
in the output port. (If <i>tokenConsumptionRate</i>
or <i>tokenProductionRate</i> are not defined, then they
will be assumed to have value one).
Then define a function that takes as many array-valued
arguments as there are input ports and returns an
array-valued result. For example, the following function
will compute the FFT of the input array using the FFT()
function in the expression language:
<pre>
function(x:{double}) abs(FFT(x, 8))
</pre>
Note that if the <i>tokenConsumptionRate</i> of a port is
changed during the execution of the model, the change is
ignored until the next execution of the model.
Steve Neuendorffer (Contributor: Edward A. Lee)
$Id: ApplyFunctionOverSequence.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 4.1
Green (neuendor)
Yellow (neuendor)
The output port.
The input port for function definition. The type of this port is
undeclared, but to have this actor work, the designer has to provide
a matched function token for it.
Note: The reason that we don't declare the type for it is because
currently there is not cast supported in the FunctionType class.
we'll fix this later.