Package ptolemy.data

Examples of ptolemy.data.Token


            if (_pending.size() > 0) {
                Integer nextKey = (Integer)_pending.firstKey();
                int next = nextKey.intValue();
                while (next == _nextSequenceNumber) {
                    $ASSIGN$SPECIAL$_nextSequenceNumber(11, _nextSequenceNumber);
                    Token token = (Token)_pending.remove(nextKey);
                    output.send(0, token);
                    if (_pending.size() == 0) {
                        break;
                    }
                    nextKey = (Integer)_pending.firstKey();
View Full Code Here


        }
        boolean inRange = false;
        for (int i = 0; i < input.getWidth(); i++) {
            inRange = inRange || (i == _channel);
            if (input.hasToken(i)) {
                Token token = input.get(i);
                if (i == _channel) {
                    output.send(0, token);
                }
            }
        }
View Full Code Here

     * of the ports throw this exception.
     */
    public void fire() throws IllegalActionException  {
        super.fire();
        if (input.hasToken(0)) {
            Token u = input.get(0);
            Token y = C.getToken().multiply(_x).add(D.getToken().multiply(u));
            $ASSIGN$_xPrime(A.getToken().multiply(_x).add(B.getToken().multiply(u)));
            if (_singleOutput) {
                output.send(0, ((DoubleMatrixToken)y).getElementAsToken(0, 0));
            } else {
                output.send(0, y);
View Full Code Here

        super.fire();
        if (control.hasToken(0)) {
            $ASSIGN$_control(((BooleanToken)control.get(0)).booleanValue());
        }
        if (input.hasToken(0)) {
            Token token = input.get(0);
            if (_control) {
                trueOutput.send(0, token);
            } else {
                falseOutput.send(0, token);
            }
View Full Code Here

            int j = 0;
            LinkedList list = new LinkedList();
            ArrayToken array = (ArrayToken) inputArray.get(0);

            while ((i < _outputLength) && (j < array.length())) {
                Token t = array.getElement(j);
                _updateParameter(t);

                if (_debugging) {
                    _debug("** Executing filter model.");
                }
View Full Code Here

     */
    private boolean _getResult() throws IllegalActionException {
        Attribute attribute = _model.getAttribute("evaluatedValue");

        if (attribute instanceof Variable) {
            Token t = ((Variable) attribute).getToken();
            return ((BooleanToken) t).booleanValue();
        } else if (attribute instanceof Settable) {
            BooleanToken t = new BooleanToken(((Settable) attribute)
                    .getExpression());
            return t.booleanValue();
        } else {
            throw new IllegalActionException(this,
                    "The specified model does not have an evaluatedValue parameter.");
        }
    }
View Full Code Here

                parameter.update();
                continue;
            }

            if ((port.getWidth() > 0) && port.hasToken(0)) {
                Token token = port.get(0);
                Attribute attribute = getAttribute(port.getName());

                // Use the token directly rather than a string if possible.
                if (attribute instanceof Variable) {
                    if (_debugging) {
                        _debug("** Transferring input to parameter: "
                                + port.getName());
                    }

                    ((Variable) attribute).setToken(token);
                } else if (attribute instanceof Settable) {
                    if (_debugging) {
                        _debug("** Transferring input as string to parameter: "
                                + port.getName());
                    }

                    ((Settable) attribute).setExpression(token.toString());
                }
            }
        }
    }
View Full Code Here

        int i = 0;
        int j = 0;

        while (inputPort != null) {
            if ((i < inputWidth) && inputPort.hasToken(i)) {
                Token t = inputPort.get(i);

                if (j < _outputWidth) {
                    output.send(j, t);
                }
            }
View Full Code Here

        int outputWidth = (outputPort != null) ? outputPort.getWidth() : 0;
        int j = 0;

        for (int i = 0; i < inputWidth; i++) {
            if (input.hasToken(i)) {
                Token t = input.get(i);

                if (outputPort != null) {
                    outputPort.send(j, t);
                }
            }
View Full Code Here

            int inputWidth = input.getWidth();
            int outputWidth = output.getWidth();

            for (int i = 0; i < inputWidth; i++) {
                if (input.hasToken(i)) {
                    Token inToken = input.get(i);

                    if (i < outputWidth) {
                        output.send(i, inToken);
                    }
                }
View Full Code Here

TOP

Related Classes of ptolemy.data.Token

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.