Class SuperdenseTimeTest

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

    public class SuperdenseTimeTest
    extends TypedAtomicActor
    A test actor illustrating a potential bug in DE in its handling of superdense time. In particular, the outputs of this actor have no causal dependence on the inputs, and hence no delay is needed in a feedback loop that feeds outputs back to the inputs. Inputs are read and processed in postfire(). However, if the output is fed directly back to an input, then the input used to be read in the same iteration in which the output was produced. If, however, there is an intervening actor in the feedback loop, then the input would be read in the next iteration. This leads to strange behavior where the presence of even a no-op actor (like a unit gain) changes the behavior of the model.

    What is the solution here?

    This actor first outputs nothing. In postfire(), it reads inputs and sums them, and if any inputs were present, it requests a new firing. In that firing, it produces the calculated sum. After 10 firings, it stops producing outputs.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (ltrnc)
    Pt.ProposedRating:
    Red (ltrnc)