Package ptolemy.actor.util

Examples of ptolemy.actor.util.Time.compareTo()


        super.fire();
        Time currentTime = getDirector().getModelTime();
        $ASSIGN$_boundaryCrossed(false);
        $ASSIGN$_tentativeCurrentOutputIndex(_currentOutputIndex);
        output.send(0, _getValue(_tentativeCurrentOutputIndex));
        if (currentTime.compareTo(_nextFiringTime) == 0) {
            $ASSIGN$SPECIAL$_tentativeCurrentOutputIndex(11, _tentativeCurrentOutputIndex);
            if (_tentativeCurrentOutputIndex >= _length) {
                $ASSIGN$_tentativeCurrentOutputIndex(0);
            }
            $ASSIGN$_boundaryCrossed(true);
View Full Code Here


     @exception IllegalActionException Not thrown in this base class.
     */
    public boolean postfire() throws IllegalActionException {
        Time currentTime = getDirector().getModelTime();

        if (currentTime.compareTo(_stopTime) >= 0) {
            return false;
        }

        return true;
    }
View Full Code Here

        if (input.hasToken(0)) {
            _newToken = input.get(0);

            Time currentTime = getDirector().getModelTime();

            if (currentTime.compareTo(_lastTime) == 0) {
                // If the current time is the same as the last time,
                // output the last token, because any change of the
                // output from the last time indicates an infinite
                // rate change.
                // The only exception is that in the first firing,
View Full Code Here

        // First look at interrupt events.
        while (!_interruptQueue.isEmpty()) {
            DEEvent interruptEvent = _interruptQueue.get();
            Time timeStamp = interruptEvent.timeStamp();

            if (timeStamp.compareTo(getModelTime()) < 0) {
                // This should never happen.
                throw new IllegalActionException(this,
                        "external input in the past: " + "input time stamp is "
                                + timeStamp + "current time in TM is "
                                + getModelTime());
View Full Code Here

            if (_debugging) {
                _debug("finishing time = " + finishTime);
            }

            if (finishTime.compareTo(_nextIterationTime) < 0) {
                _nextIterationTime = finishTime;
            }
        }

        if (_isEmbedded()
View Full Code Here

        // check the interupt queue:
        while (!_interruptQueue.isEmpty()) {
            DEEvent interruptEvent = _interruptQueue.get();
            Time timeStamp = interruptEvent.timeStamp();

            if (timeStamp.compareTo(_outsideTime) < 0) {
                // This should never happen.
                throw new IllegalActionException(this,
                        "external input in the past: " + "input time stamp is "
                                + timeStamp + "current time in TM is "
                                + getModelTime());
View Full Code Here

                // This should never happen.
                throw new IllegalActionException(this,
                        "external input in the past: " + "input time stamp is "
                                + timeStamp + "current time in TM is "
                                + getModelTime());
            } else if (timeStamp.compareTo(_outsideTime) == 0) {
                _interruptQueue.take();

                Actor actor = interruptEvent.actor();

                if (actor != null) {
View Full Code Here

        output.send(0, _getValue(_tentativeCurrentOutputIndex));

        // In case current time has reached or crossed a boundary to the
        // next output, update it.
        if (currentTime.compareTo(_nextFiringTime) == 0) {
            _tentativeCurrentOutputIndex++;

            if (_tentativeCurrentOutputIndex >= _length) {
                _tentativeCurrentOutputIndex = 0;
            }
View Full Code Here

            IOPort port = (IOPort) ports.next();
            Receiver[][] receivers = port.getRemoteReceivers();

            for (int i = 0; i < receivers.length; i++) {
                for (int j = 0; j < receivers[i].length; j++) {
                    if (time
                            .compareTo(((DDEReceiver) receivers[i][j])._lastTime) > 0) {
                        ((DDEReceiver) receivers[i][j]).put(new NullToken(),
                                time);
                    }
                }
View Full Code Here

                .doubleValue();

        if (next.hasToken(0)) {
            next.get(0);

            if (now.compareTo(_nextMsgTime) < 0) {
                // ignore this
            } else {
                // compute a random delay between zero and MaxDelay.
                double delay = maxDelayValue * Math.random();
                _nextMsgTime = now.add(delay);
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.