ApplyFunctionOverSequence
ptolemy.actor.lib.hoc.ApplyFunctionOverSequence

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.

Author(s): Steve Neuendorffer (Contributor: Edward A. Lee)
Version:$Id: ApplyFunctionOverSequence.doc.html,v 1.1 2006/02/22 18:40:26 mangal Exp $
Pt.Proposed Rating:Green (neuendor)
Pt.Accepted Rating:Yellow (neuendor)


output
The output port.


function
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.