
Average |
ptolemy.actor.lib.Average |
Output the average of the inputs after the last time a true token is
received at the reset port.
One output is produced each time the actor is fired.
The inputs and outputs can be any token type that
supports addition and division by an integer. The output type is
constrained to be the same as the input type.
Note that if the input is an integer, then the output is an
integer, which may not be what you want. You may need to set
the input and output ports to double to force the result to be
a double.
Note that the type system will fail to catch some errors. Static type
checking may result in a resolved type that does not support addition
and division. In this case, a run-time error will occur.
Author(s): Edward A. Lee, Jie Liu
Version:$Id: Average.java,v 1.46 2005/10/28 20:14:36 cxh Exp $
Pt.Proposed Rating:Green (eal)
Pt.Accepted Rating:Green (bilung)
reset
The reset port of type BooleanToken. If this input port
receives a True token, then the averaging process will be
reset.