Class SubscriptionAggregator

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class SubscriptionAggregator
    extends Subscriber
    Aggregate data produced by multiple publishers. This is a generalization of the Subscriber (the base class) where the channel name is interpreted as a regular expression. Data produced by all publishers that publish on a channel name that matches the regular expression are aggregated using the operation given by the operation parameter.

    Note that the channel parameter of the superclass is now a regular expression in this class. Thus, this class is usually slower than the superclass. One thing to watch out for is using . instead of \. and * instead of .+. For example, channel.foo.* does not mean the same thing as channel\.foo.+. The latter requires a dot between channel and foo, where the former does not.

    Since:
    Ptolemy II 5.2
    Version:
    $Id$
    Author:
    Edward A. Lee, Raymond A. Cardillo, contributor: Christopher Brooks, Bert Rodiers
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Green (cxh)
    • Field Detail

      • operation

        public StringParameter operation
        The operation used to aggregate the data produced by matching publishers. The choices are "add" and "multiply". Note that "multiply" is a poor choice if the data type has a non-commutative multiplication operation (e.g. matrix types) because the result will be nondeterministic. This is a string that defaults to "add".