Package ptolemy.data

Examples of ptolemy.data.DoubleToken.doubleValue()


        super.fire();
        if (input.hasToken(0)) {
            DoubleToken inputValue = (DoubleToken)input.get(0);
            double k;
            int M = _backward.length - 1;
            $ASSIGN$_forwardCache(0, inputValue.doubleValue());
            for (int i = 1; i <= M; i++) {
                k = _reflectionCoefs[M - i];
                $ASSIGN$_forwardCache(i, (k * _backwardCache[i]) + _forwardCache[i - 1]);
            }
            output.broadcast(new DoubleToken(_forwardCache[M]));
View Full Code Here


        inputCount.update();
        int count = ((IntToken)inputCount.getToken()).intValue();
        for (int i = 0; i < count; i++) {
            if (input.hasToken(0)) {
                DoubleToken curToken = (DoubleToken)input.get(0);
                double curValue = curToken.doubleValue();
                _addPoint(curValue);
            }
        }
        Token[] values = new Token[_bins.length];
        for (int i = 0; i < _bins.length; i++) {
View Full Code Here

     */
    public void fire() throws IllegalActionException  {
        super.fire();
        if (input.hasToken(0)) {
            DoubleToken in = (DoubleToken)input.get(0);
            double number = in.doubleValue();
            double minValue = ((DoubleToken)min.getToken()).doubleValue();
            output.send(0, _doFunction(number, minValue));
        }
    }

View Full Code Here

        int width = input.getWidth();

        for (int i = width - 1; i >= 0; i--) {
            if (input.hasToken(i)) {
                DoubleToken curToken = (DoubleToken) input.get(i);
                double curValue = curToken.doubleValue();

                // NOTE: Should we test before this cast?
                ((Histogram) plot).addPoint(i, curValue);
            }
        }
View Full Code Here

        for (int i = width - 1; i >= 0; i--) {
            if (input.hasToken(i)) {
                currentTimeValue = input.getModelTime(i).getDoubleValue();

                DoubleToken currentToken = (DoubleToken) input.get(i);
                double currentValue = currentToken.doubleValue();

                // NOTE: We assume the superclass ensures this cast is safe.
                ((Plot) plot).addPoint(i + offset, currentTimeValue,
                        currentValue, true);
            }
View Full Code Here

        int offset = ((IntToken) startingDataset.getToken()).intValue();

        for (int i = width - 1; i >= 0; i--) {
            if (input.hasToken(i)) {
                DoubleToken currentToken = (DoubleToken) input.get(i);
                double currentValue = currentToken.doubleValue();

                // NOTE: We assume the superclass ensures this cast is safe.
                ((Plot) plot).addPoint(i + offset, currentTime, currentValue,
                        true);
            }
View Full Code Here

            if (input.hasToken(i)) {
                DoubleToken curToken = (DoubleToken) input.get(i);
                if (curToken.isNil()) {
                    _connected[i] = false;
                } else {
                    double curValue = curToken.doubleValue();

                    // NOTE: We assume the superclass ensures this
                    // cast is safe.

                    ((Plot) plot).addPoint(i + offset, _xValue, curValue,
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        super.fire();
        if (input.hasToken(0)) {
            DoubleToken in = (DoubleToken) input.get(0);
            double number = in.doubleValue();
            double minValue = ((DoubleToken) min.getToken()).doubleValue();
            output.send(0, _doFunction(number, minValue));
        }
    }

View Full Code Here

        int count = ((IntToken) inputCount.getToken()).intValue();

        for (int i = 0; i < count; i++) {
            if (input.hasToken(0)) {
                DoubleToken curToken = (DoubleToken) input.get(0);
                double curValue = curToken.doubleValue();

                _addPoint(curValue);
            }
        }
View Full Code Here

                if (port instanceof ParameterPort) {
                    Token token = ((ParameterPort) port).getParameter()
                        .getToken();
                    if (token != null) {
                        DoubleToken doubleToken = DoubleToken.convert(token);
                        parameterValue = (char) doubleToken.doubleValue();
                    } else {
                        // We throw an exception here but catch it
                        // below because this method is called from C.
                        throw new InternalErrorException(
                                "Could not get token from ParameterPort \""
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.