Interface Advanceable

  • All Superinterfaces:
    ContinuousStepSizeController
    All Known Implementing Classes:
    FMUImport, FMUImportHybrid, FMUQSS

    public interface Advanceable
    extends ContinuousStepSizeController
    Interface for actors and directors that, unlike native Ptolemy II actors, do not proactively notify their director (using fireAt()) of events in the future that they might produce, but which may, nevertheless, require execution at some future time. An example of such actors are functional mockup units (FMUs) conforming with the functional mockup interface (FMI) standard version 2.0 or earlier.

    A director that advances time and supports such actors should advance time for actors that implement this interface before deciding on the time advance for other actors. That is, as part of choosing the step size by which to advance time, it should invoke the advance(Time, int) method of this interface with its proposed time advance. If any such actor returns false, then it should query the actor using the methods of the base interface to refine the time step.

    Note that this mechanism is much weaker than the native Ptolemy II method using fireAt(). In particular, this method is advancing time into the future without providing inputs into the future. That is, the actor is expected to advance time without any knowledge of its inputs during the proposed time interval. The actor has to make some assumptions about the inputs during that interval, and those assumptions may be later contradicted by the actual inputs provided by the environment. If such a contradiction occurs, then the actor may need to roll back to a previously stored state and redo some portion of the time step. As of version 2.0, the FMI standard does not require actors to implement such rollback.

    Of the existing Ptolemy II directors, the only one that requires rollback in time is the ContinuousDirector. Moreover, in Ptolemy II, rollback is implementable by every actor that realizes the strict actor semantics, where the fire() method does not change the state of the actor (state changes in postfire()). However, actors that implement this interface may require rollback under any director that advances time.

    As a consequence, there is no Ptolemy II director that can guarantee correct execution of arbitrary combinations of FMUs, unless the FMUs implement rollback. In particular, consider a model contains more than one actor that implements this interface. Suppose it has two. Then it has to advance time of one before the other. Suppose it advances time of the first by 1.0 time unit, and the advance succeeds. Then, suppose it tries to advance the other by 1.0 time unit, and the advance fails. Suppose that second actor suggests a time advance of 0.5 time units, and at time t + 0.5, where t is current time, it produces an output that is an input to the other actor. The other actor will now have an input that it could not possibly have assumed when it advanced its time to t + 1.0, so it will have to roll back to time t + 0.5. If it is not capable of rollback, then there is no assurance that its execution is correct.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Green (eal)
    Pt.ProposedRating:
    Green (hyzheng)
    • Method Detail

      • advance

        boolean advance​(Time time,
                        int microstep)
                 throws IllegalActionException
        Advance to the specified time.
        Parameters:
        time - The time to advance.
        microstep - The microstep to advance.
        Returns:
        True if advancement to the specified time succeeds.
        Throws:
        IllegalActionException - If an error occurs advancing time.