Distributor
ptolemy.actor.lib.Distributor

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 n tokens from the input, where n is the width of the output port, and writes one token to each output channel, in the order of the channels. If there are fewer than n 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 receive a token in the previous iteration.

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

Author(s): Mudit Goel, Edward A. Lee
Version:$Id: Distributor.java,v 1.48 2005/10/28 20:14:42 cxh Exp $
Pt.Proposed Rating:Yellow (mudit)
Pt.Accepted Rating:Yellow (cxh)




input_tokenConsumptionRate
The parameter controlling the input port consumption rate. This parameter contains an IntToken, initially with a value of 0.