Examples of Director


Examples of ptolemy.actor.Director

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

Examples of ptolemy.actor.Director

        if (_boundaryCrossed) {
            double meanTimeValue = ((DoubleToken) meanTime.getToken())
                    .doubleValue();
            double exp = -Math.log((1 - Math.random())) * meanTimeValue;
            Director director = getDirector();
            _nextFiringTime = director.getModelTime().add(exp);
            director.fireAt(this, _nextFiringTime);
        }

        return super.postfire();
    }
View Full Code Here

Examples of ptolemy.actor.Director

     *  If the input does not have a token, suspend firing and return.
     *  @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        Director director = getDirector();

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

View Full Code Here

Examples of ptolemy.actor.Director

                Subscriber subscriber = (Subscriber) subscribers.next();
                subscriber.input.liberalLink(_relation);
            }
        }

        Director director = getDirector();
        if (director != null) {
            director.invalidateSchedule();
            director.invalidateResolvedTypes();
        }
        _updatedLinks = true;
    }
View Full Code Here

Examples of ptolemy.actor.Director

                // The Publisher._updateLinks() may have already linked us.
                input.liberalLink(relation);
            }
            _relations.add(relation);
        }
        Director director = getDirector();
        if (director != null) {
            director.invalidateSchedule();
            director.invalidateResolvedTypes();
        }
        _updatedLinks = true;
    }
View Full Code Here

Examples of ptolemy.actor.Director

     *    permissible (e.g. the given time is in the past).
     */
    public void fireAt(Actor actor, Time time) throws IllegalActionException {
        Actor container = (Actor) getContainer();
        if (container != null) {
            Director executiveDirector = container.getExecutiveDirector();
            if (executiveDirector != null) {
                executiveDirector.fireAt(container, time);
            }
        }
    }
View Full Code Here

Examples of ptolemy.actor.Director

     *   throws it.
     */
    public void fireAtCurrentTime(Actor actor) throws IllegalActionException {
        Actor container = (Actor) getContainer();
        if (container != null) {
            Director executiveDirector = container.getExecutiveDirector();
            if (executiveDirector != null) {
                executiveDirector.fireAtCurrentTime(container);
            }
        }
    }
View Full Code Here

Examples of ptolemy.actor.Director

    class ButtonListener implements ActionListener {
        public void actionPerformed(ActionEvent event) {
            try {
                _buttonPressed = true;

                Director director = getDirector();

                // JDK1.2 bug: WallClockTime._getCurrentTime() is
                // protected, but not accessible here.
                // Note, WallClockTime._getCurrentTime() returns a double,
                // which we are going to compare against model time,
                // so we create a Time object that accounts for the
                // precision of the director.
                Time firingTime = new Time(director, _getCurrentTime());

                Time currentTime = director.getModelTime();

                if (firingTime.compareTo(currentTime) < 0) {
                    // This shouldn't happen, but it will prevent us
                    // from enqueuing events in the past
                    firingTime = currentTime;
                }

                director.fireAt(_self, firingTime);
            } catch (IllegalActionException ex) {
                // Should never happen
                throw new InternalErrorException(ex.getMessage());
            }
        }
View Full Code Here

Examples of ptolemy.actor.Director

                .doubleValue();

        if (speed == Double.POSITIVE_INFINITY) {
            super._transmitTo(token, sender, receiver, properties);
        } else {
            Director director = getDirector();

            // FIXME: This isn't right because the receiver
            // may have moved during propagation.  Maybe
            // register a ValueListener to the _location attributes
            // of the receiver actors, and continually recalculate
            // the correct arrival time for the message each time the
            // receiver location changes.  Even so, this will be
            // an approximation, and needs to be fully characterized.
            // Also, the receiver needs to be in range at the
            // conclusion of the propagation, whereas this method is
            // called only if the receiver is in range at the
            // initiation of the transmission.
            WirelessIOPort destination = (WirelessIOPort) receiver
                    .getContainer();
            double distance = _distanceBetween(sender, destination);
            Time time = director.getModelTime().add(distance / speed);

            if (_receptions == null) {
                _receptions = new HashMap();
            }

            Double timeDouble = Double.valueOf(time.getDoubleValue());
            Reception reception = new Reception();
            reception.token = token;
            reception.sender = sender;
            reception.receiver = receiver;
            reception.properties = properties;
            _receptions.put(timeDouble, reception);

            director.fireAt(this, time);
        }
    }
View Full Code Here

Examples of ptolemy.actor.Director

    public boolean postfire() throws IllegalActionException {
        _debug(getName() + " postfire.");
        _lastToken = input.get(0);

        if (((BooleanToken) print.getToken()).booleanValue()) {
            Director dir = getDirector();

            if (dir != null) {
                System.out.println(dir.getModelTime() + " "
                        + ((DoubleToken) _lastToken).doubleValue());
            }
        }

        return true;
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.