Class Merge

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

    public class Merge
    extends DETransformer
    A timed merge actor for the DE domain. It merges a set of input signals into a single output signal based on the order of the tags associated with the events of signals. A tag is a tuple of a timestamp (as an instance of Time) and a microstep or index (as non-negative integer). Tags have a lexicographic order.

    This actor has an input port (a multiport) and an output port (a single port). 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.

    There is a boolean parameter discardEvents associated with this actor, which decides how to handle simultaneously available inputs.

    If the discardEvents parameter is configured to true, then each time this actor fires, it reads the first available token from an input channel and send it to the output port. Then this actor discards all the remaining inputs in the rest of channels.

    If the discardEvents parameter is configured to false (the default), then the handling of simultaneous events is a bit more subtle. On each firing, it reads at most one input from each input channel in the order of the channels and puts them on a queue to be produced as an output. It then takes the first token (the oldest one) from the queue and produces it on the output. If after this firing the queue is not empty, then it requests a refiring at the current time.

    Since:
    Ptolemy II 0.4
    Version:
    $Id$
    Author:
    Edward A. Lee, Haiyang Zheng
    Pt.AcceptedRating:
    Green (hyzheng)
    Pt.ProposedRating:
    Green (hyzheng)
    • Field Detail

      • discardEvents

        public Parameter discardEvents
        A flag to indicate whether the input events can be discarded. Its default value is false.