Package ptolemy.actor

Examples of ptolemy.actor.Director


     @param attribute The attribute that has changed.
     *  @exception IllegalActionException If the parameters are out of range.
     */
    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        Director director = getDirector();

        if (director != null) {
            // FIXME: should this happen every time we call attribute changed?
            director.invalidateResolvedTypes();
        }
    }
View Full Code Here


        if (((BooleanToken)fireAtStart.getToken()).booleanValue()) {
            getDirector().fireAt(this, currentTime);
        } else {
            double meanTimeValue = ((DoubleToken)meanTime.getToken()).doubleValue();
            double exp = -Math.log((1 - Math.random())) * meanTimeValue;
            Director director = getDirector();
            $ASSIGN$_nextFiringTime(director.getModelTime().add(exp));
            director.fireAt(this, _nextFiringTime);
        }
    }
View Full Code Here

    public boolean postfire() throws IllegalActionException  {
        $ASSIGN$_currentOutputIndex(_tentativeCurrentOutputIndex);
        if (_boundaryCrossed) {
            double meanTimeValue = ((DoubleToken)meanTime.getToken()).doubleValue();
            double exp = -Math.log((1 - Math.random())) * meanTimeValue;
            Director director = getDirector();
            $ASSIGN$_nextFiringTime(director.getModelTime().add(exp));
            director.fireAt(this, _nextFiringTime);
        }
        return super.postfire();
    }
View Full Code Here

            }

            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);
                }
            }

            int i = 0;
            int j = 0;
View Full Code Here

            double newStopTimeValue = ((DoubleToken) stopTime.getToken())
                    .doubleValue();

            if (_executing) {
                Time newStopTime = new Time(getDirector(), newStopTimeValue);
                Director director = getDirector();

                if (director != null) {
                    Time currentTime = director.getModelTime();

                    if (newStopTime.compareTo(currentTime) > 0) {
                        director.fireAt(this, newStopTime);
                    } else {
                        throw new IllegalActionException(this, "The stop time "
                                + "is earlier than the current time.");
                    }
                }
View Full Code Here

     @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

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

            }

            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

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

         @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

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.