Examples of Director


Examples of ptolemy.actor.Director

     @exception IllegalActionException If there is no director.
     */
    public void initialize() throws IllegalActionException {
        super.initialize();

        Director director = getDirector();

        if (director == null) {
            throw new IllegalActionException(this, "No director!");
        }

        double stopTimeValue = ((DoubleToken) stopTime.getToken())
                .doubleValue();
        _stopTime = new Time(getDirector(), stopTimeValue);

        Time currentTime = director.getModelTime();

        if (!_stopTime.isInfinite() && (_stopTime.compareTo(currentTime) > 0)) {
            director.fireAt(this, _stopTime);
            _executing = true;
        }
    }
View Full Code Here

Examples of ptolemy.actor.Director

            // in wrapup() without this default director.
            //The default director may not work when we need multi tokens to fire
            //the inside model because the receiver it creates is an instance of
            //Mailbox, which can only hold one token. In this case, specify a proper
            //director using the <i>director<i> parameter.
            new Director(this, "defaultDirector");
            director = new Parameter(this, "director", new StringToken(
                    "ptolemy.actor.Director"));
            setClassName("ptolemy.actor.lib.hoc.MobileModel");
        } catch (NameDuplicationException e) {
            // This should not be thrown.
View Full Code Here

Examples of ptolemy.actor.Director

            }

            if (_debugging) {
                _manager.addDebugListener(this);

                Director director = executable.getDirector();

                if (director != null) {
                    director.addDebugListener(this);
                }
            } else {
                _manager.removeDebugListener(this);

                Director director = executable.getDirector();

                if (director != null) {
                    director.removeDebugListener(this);
                }
            }

            // If there is a previous execution, then wait for it to finish.
            // Avoid the synchronize block if possible.
View Full Code Here

Examples of ptolemy.actor.Director

    /** Set this composite actor to opaque and request for reinitialization
     *  from the director if there is one.
     */
    private void _requestInitialization() {
        // Request for initialization.
        Director dir = getDirector();

        if (dir != null) {
            dir.requestInitialization(this);
        }

        // Set this composite to opaque.
        _opaque = true;
    }
View Full Code Here

Examples of ptolemy.actor.Director

         @param actor The actor requesting firing.
         *  @param time The time at which to fire.
         */
        public void fireAt(Actor actor, Time time)
                throws IllegalActionException {
            Director director = IterateOverArray.this.getExecutiveDirector();

            if (director != null) {
                director.fireAt(actor, time);
            }
        }
View Full Code Here

Examples of ptolemy.actor.Director

         @param actor The actor requesting firing.
         *  @param time The time at which to fire.
         */
        public void fireAtCurrentTime(Actor actor)
                throws IllegalActionException {
            Director director = IterateOverArray.this.getExecutiveDirector();

            if (director != null) {
                director.fireAtCurrentTime(actor);
            }
        }
View Full Code Here

Examples of ptolemy.actor.Director

        // matter which actor requests firing.
        Nameable container = getContainer();

        if (container instanceof Actor) {
            Actor modalModel = (Actor) container;
            Director executiveDirector = modalModel.getExecutiveDirector();

            if (executiveDirector != null) {
                executiveDirector.fireAt(modalModel, time);
            } else {
                setModelTime(time);
            }
        }
    }
View Full Code Here

Examples of ptolemy.actor.Director

        // connected to any actors on the inside.
        if (packetIn.getWidth() > 0) {
            if (packetIn.hasToken(0)) {
                StringToken token = (StringToken) packetIn.get(0);

                Director director = getDirector();
                if (director != null) {
                    if (director instanceof PtinyOSDirector) {
                        ((PtinyOSDirector)director).receivePacket(
                                token.stringValue());
View Full Code Here

Examples of ptolemy.actor.Director

                port.workspace().getReadAccess();

                Actor actor = (Actor) port.getContainer();

                if (actor != null) {
                    Director director;

                    if ((port.isOutput()) && (actor instanceof CompositeActor)
                            && ((CompositeActor) actor).isOpaque()) {
                        director = actor.getDirector();
                    } else {
View Full Code Here

Examples of ptolemy.actor.Director

        double periodValue = ((DoubleToken) period.getToken()).doubleValue();

        if (periodValue > 0.0) {
            Actor container = (Actor) getContainer();
            Director executiveDirector = container.getExecutiveDirector();
            Time currentTime = getModelTime();

            if (executiveDirector != null) {
                // Not at the top level.
                executiveDirector.fireAt(container, currentTime
                        .add(periodValue));
            } else {
                // At the top level.
                setModelTime(currentTime.add(periodValue));
            }
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.