A polymorphic distributor, which splits an input stream into a set of
output streams. The distributor has an input port and an output port,
the latter of which is a multiport.
The types of the ports are undeclared and will be resolved by the type
resolution mechanism, with the constraint that the output type must be
greater than or equal to the input type. On each call to the fire method, the
actor reads at most <i>N</i> tokens from the input, where <i>N</i> is
the width of the output port times the <i>blockSize</i> parameter,
and writes <i>blockSize</i> tokens to each output channel,
in the order of the channels. If there are fewer than <i>N</i> tokens
at the input, then the all available input tokens are sent to the output
channels, and the fire() method returns. In the next iteration of this
actor, it will begin producing outputs on the first channel that did
not have enough tokens in the previous iteration.
<p>
For the benefit of domains like SDF, which need to know the token consumption
or production rate for all ports before they can construct a firing schedule,
this actor sets the tokenConsumptionRate parameter for the input port
to equal the number of output channels times the <i>blockSize</i> parameter,
and the output production rate is set to the <i>blockSize</i> parameter.
The consumption rate parameter is set each time that a link is established with
the input port, or when a link is removed. The director is notified
that the schedule is invalid, so that if the link is modified at
run time, the schedule will be recalculated if necessary.
Mudit Goel, Edward A. Lee
$Id: Distributor.java 70402 2014-10-23 00:52:20Z cxh $
Ptolemy II 0.2
Yellow (mudit)
Yellow (cxh)
The number of tokens produced on each output channel on each firing.
This is an integer with default value 0.
The parameter controlling the input port consumption rate.
This is an integer, initially with value 0. Whenever a connection
is made to the output, the value of this parameter is changed to
equal the width of the output times the <i>blockSize</i> parameter.
The parameter specifying the output port production rate.
This is an integer, equal to the value of <i>blockSize</i>.