This actor implements an up-down counter of received tokens. Whenever
a token is received from the <i>increment</i> input, the internal
counter is incremented. Whenever a token is received from the
<i>decrement</i> port, the internal counter is decremented. Whenever
a token is received from either input port, a token is created on the
output port with the integer value of the current count. At most one
token will be consumed from each input during each firing. If a token
is present on both input ports during any firing, then the increment
and the decrement will cancel out, and only one output token will be
produced. If any firing a <i>reset</i> input is present and true,
then the count will be reset.
Steve Neuendorffer
$Id: Counter.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 2.0
Yellow (neuendor)
Yellow (neuendor)
The increment port. If this input port
receives a token, then the counter is incremented. The port
has type general.
The decrement port. If this input port
receives a token, then the counter is decremented. The port
has type general.
The output port with type IntToken.
The reset input port. This is of type boolean.