Package ptolemy.actor

Examples of ptolemy.actor.Director


        Actor container = (Actor) getContainer();
        while (viewScreen == null) {
            // Tolerate GR nested within GR, in which case
            // the view screen should be that of the enclosing composite.
            // There could be an intervening FSMDirector, etc.
            Director executiveDirector = container.getExecutiveDirector();
            if (executiveDirector instanceof GRDirector) {
                viewScreen = ((GRDirector)executiveDirector)._getViewScreen();
            } else {
                if (executiveDirector == null) {
                    throw new IllegalActionException(this,
View Full Code Here


                        1));
            }

            if (actor instanceof CompositeActor) {
                CompositeActor compositeActor = (CompositeActor) actor;
                Director insideDirector = compositeActor.getDirector();
                // FIXME: This is bogus.  This is assuming there is no
                // more than one inside director, and is delegating the
                // incrementing of time to that inside director.
                _insideDirector = insideDirector;
                _pseudoTimeEnabled = true;
View Full Code Here

                break;
            }
        }

        // Go through hierarchy to find the minimum step.
        Director executiveDirector = ((CompositeActor) getContainer())
                .getExecutiveDirector();
        if (executiveDirector != null) {
            Time aFutureTimeOfUpperLevel = executiveDirector
                    .getModelNextIterationTime();
            if (aFutureTime.compareTo(aFutureTimeOfUpperLevel) > 0) {
                aFutureTime = aFutureTimeOfUpperLevel;
            }
        }
View Full Code Here

            // Change the color of the icon to red.
            _circle.fillColor.setToken("{1.0, 0.0, 0.1, 0.7}");

            // Request refiring one second later to change
            // the icon back to blue.
            Director director = getDirector();
            director.fireAt(this, director.getModelTime().add(1.0));
        } else {
            // Set color to blue.
            _circle.fillColor.setToken("{0.0, 0.0, 1.0, 0.05}");
        }
View Full Code Here

     while transferring outputs
     */
    protected synchronized void _transferOutputs()
            throws IllegalActionException {
        // Use the executive director to transfer outputs.
        Director executiveDirector = getExecutiveDirector();

        if (executiveDirector != null) {
            Iterator outports = outputPortList().iterator();

            while (outports.hasNext()) {
                IOPort p = (IOPort) outports.next();
                executiveDirector.transferOutputs(p);
            }
        }
    }
View Full Code Here

        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

        // 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

            // 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

        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

     *  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

TOP

Related Classes of ptolemy.actor.Director

Copyright © 2018 www.massapicom. 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.