Package ptolemy.data

Examples of ptolemy.data.DoubleToken.doubleValue()


        if ((_delayedInputTokensList.size() != 0)
                && _delayedOutputTokens.isEmpty()) {
            // NOTE: the input has a fixed data type as double.
            DoubleToken delayToken = (DoubleToken) _delayedInputTokensList
                    .removeFirst();
            double delay = delayToken.doubleValue();
            _nextTimeFree = currentTime.add(delay);
            _delayedOutputTokens.put(new TimedEvent(_nextTimeFree, value
                    .getToken()));
            getDirector().fireAt(this, _nextTimeFree);
        }
View Full Code Here


        super.fire();
        double increment = 0.0;

        if ((input.getWidth() > 0) && input.hasToken(0)) {
            DoubleToken in = (DoubleToken) input.get(0);
            increment = in.doubleValue();
        }

        output.broadcast(new DoubleToken(value + increment));
        value += 1.0;
View Full Code Here

            }

            DoubleToken time = (DoubleToken) inputToken.get("time");
            IntToken d = (IntToken) inputToken.get("depth");

            if ((time.doubleValue() > _timeValue)
                    || ((time.doubleValue() == _timeValue) && (d.intValue() < _parentDepth))) {
                //the root node may have been changed
                //or there is a shorter path.
                ArrayToken locationArray = (ArrayToken) inputToken
                        .get("location");
View Full Code Here

            DoubleToken time = (DoubleToken) inputToken.get("time");
            IntToken d = (IntToken) inputToken.get("depth");

            if ((time.doubleValue() > _timeValue)
                    || ((time.doubleValue() == _timeValue) && (d.intValue() < _parentDepth))) {
                //the root node may have been changed
                //or there is a shorter path.
                ArrayToken locationArray = (ArrayToken) inputToken
                        .get("location");
                int length = locationArray.length();
View Full Code Here

                for (int i = 0; i < length; i++) {
                    _parentLocation[i] = ((DoubleToken) locationArray
                            .getElement(i)).doubleValue();
                }

                _timeValue = time.doubleValue();
                _parentDepth = d.intValue();

                _speed = _getSpeed();
            }
        }
View Full Code Here

            }

            DoubleToken time = (DoubleToken) inputToken.get("time");
            IntToken d = (IntToken) inputToken.get("depth");

            if ((time.doubleValue() > _timeValue)
                    || ((time.doubleValue() == _timeValue) && (d.intValue() < _parentDepth))) {
                //the root node may have been changed
                //or there is a shorter path.
                ArrayToken locationArray = (ArrayToken) inputToken
                        .get("location");
View Full Code Here

            DoubleToken time = (DoubleToken) inputToken.get("time");
            IntToken d = (IntToken) inputToken.get("depth");

            if ((time.doubleValue() > _timeValue)
                    || ((time.doubleValue() == _timeValue) && (d.intValue() < _parentDepth))) {
                //the root node may have been changed
                //or there is a shorter path.
                ArrayToken locationArray = (ArrayToken) inputToken
                        .get("location");
                int length = locationArray.length();
View Full Code Here

                for (int i = 0; i < length; i++) {
                    _parentLocation[i] = (DoubleToken) locationArray
                            .getElement(i);
                }

                _timeValue = time.doubleValue();
                _parentDepth = d.intValue();

                String[] labels = { "location", "time", "depth" };

                Token[] values = { new ArrayToken(_parentLocation),
View Full Code Here

                // Try to create a new [double] type with just one member.
                // The following conversion will fail if the member cannot
                // be converted to an int.
                DoubleToken singleMember = DoubleToken.convert(token);
                double[] matrix = new double[1];
                matrix[0] = singleMember.doubleValue();
                return new DoubleMatrixToken(matrix, 1, 1);
            }
        }
    }
View Full Code Here

    public void fire() throws IllegalActionException {
        super.fire();
        if (input.hasToken(0)) {
            DoubleToken in = (DoubleToken) input.get(0);

            _forwardCache[0] = in.doubleValue(); // _forwardCache(0) = x(n)

            _doFilter();

            _backwardCache[0] = _forwardCache[0]; // _backwardCache[0] = x[n]
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.