Examples of Director


Examples of ptolemy.actor.Director

        NamedObj container = getContainer();
        // NOTE: the container may not be a composite actor.
        // For example, the container may be an entity as a library,
        // where the director is already at the top level.
        if (container instanceof CompositeActor) {
            Director executiveDirector = ((CompositeActor) container)
                    .getExecutiveDirector();
            if (executiveDirector != null) {
                return executiveDirector.getModelNextIterationTime();
            }
        }
        return Time.POSITIVE_INFINITY;
    }
View Full Code Here

Examples of ptolemy.actor.Director

        // is embedded in a DE model but has no input ports, without the
        // following statements, the composite actor has no chance to be fired.

        if (_isEmbedded() && (_enclosingContinuousDirector() == null)) {
            Actor container = (Actor) getContainer();
            Director director = container.getExecutiveDirector();
            director.fireAt(container, _startTime);
        }
        // Set a breakpoint with index 0 for the stop time.
        // Note that do not use fireAt because that will set index to 1,
        // which may produce more than one output at the stop time.
        _breakpoints.insert(new SuperdenseTime(_stopTime, 0));
View Full Code Here

Examples of ptolemy.actor.Director

            // Update the cache.
            _enclosingContinuousDirector = null;
            NamedObj container = getContainer().getContainer();
            while (container != null) {
                if (container instanceof Actor) {
                    Director director = ((Actor) container).getDirector();
                    if (director instanceof ContinuousDirector) {
                        _enclosingContinuousDirector = (ContinuousDirector) director;
                        break;
                    }
                    if (!(director instanceof QuasiTransparentDirector)) {
View Full Code Here

Examples of ptolemy.actor.Director

        postfireResult = _commit() && postfireResult;
        // request a refiring at a future time,
        // the current time + suggested step size
        if (_currentStepSize == 0) {
            Actor container = (Actor) getContainer();
            Director enclosingDirector = container.getExecutiveDirector();
            enclosingDirector.fireAt(container, _currentTime);
        }

        return postfireResult;
    }
View Full Code Here

Examples of ptolemy.actor.Director

     *  is not an instance of this same class.
     *  @return True if it is OK to fire again.
     */
    private boolean _postfireWithEnclosingNonContinuousDirector()
            throws IllegalActionException {
        Director enclosingDirector = ((Actor) getContainer())
                .getExecutiveDirector();
        int comparison = _currentTime.compareTo(enclosingDirector
                .getModelTime());
        if (comparison > 0) {
            // We have to defer the commit until current time of the environment
            // matches our local current time. Call fireAt() to ensure that the
            // enclosing director invokes prefire at the local current time.
            // This local current time should not exceed the least time on
            // the breakpoint table.
            enclosingDirector.fireAt((Actor) getContainer(), _currentTime);
            _commitIsPending = true;
            return true;
        } else {
            // NOTE: It is, in theory, impossible for local current time to
            // be less than the environment time because the prefire() method
            // would have thrown an exception. Hence, current time must match
            // the environment time.
            _commitIsPending = false;

            // Request a refiring at the current time.
            // The reason for this is that local time has not advanced,
            // so we can't be sure of any interval of future time over which
            // we will not produce an event. Only when the step size is
            // greater than zero, as we have speculatively executed into
            // the future, can we allow the enclosing director to advance time.
            enclosingDirector.fireAt((Actor) getContainer(), _currentTime);

            return _commit();
        }
    }
View Full Code Here

Examples of ptolemy.codegen.kernel.Director

                            getComponent().getName()
                                    + "'s output offset initialization")));
            initializeCode.append(code);
        }

        Director directorHelper = (Director) _getHelper(((ptolemy.actor.CompositeActor) getComponent())
                .getDirector());

        // Generate the initialize code by the director helper.
        initializeCode.append(directorHelper.generateInitializeCode());

        return initializeCode.toString();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.