Package ptolemy.data

Examples of ptolemy.data.DoubleToken


     * @exception IllegalActionException If there is no director.
     */
    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


            }
            if (outNumber < minValue) {
                outNumber = minValue;
            }
        }
        return new DoubleToken(outNumber);
    }
View Full Code Here

                    if ((indata < dipThreshold) && (localMax > squelchValue)) {
                        if (_debugging) {
                            _debug("** Found a peak with value " + localMax+" at index "+localMaxIndex);
                        }
                        resultIndices.add(new IntToken(localMaxIndex));
                        resultPeaks.add(new DoubleToken(localMax));
                        if (resultPeaks.size() > maxPeaks) {
                            break;
                        }
                        localMin = indata;
                        switch (scaleIndicator) {
View Full Code Here

     * or the period is not 0 and not greater than the largest index.
     */
    public void fire() throws IllegalActionException  {
        super.fire();
        double result = _interpolation.interpolate(_iterationCount);
        output.send(0, new DoubleToken(result));
    }
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        super.fire();
        if (input.hasToken(0)) {
            double in = ((DoubleToken) input.get(0)).doubleValue();
            output.send(0, new DoubleToken(_doFunction(in)));
        }
    }
View Full Code Here

            // only the first count tokens are valid.
            Token[] inArray = input.get(0, count);

            for (int i = 0; i < count; i++) {
                double inputValue = ((DoubleToken) (inArray[i])).doubleValue();
                _resultArray[i] = new DoubleToken(_doFunction(inputValue));
            }

            output.send(0, _resultArray, count);
            return COMPLETED;
        } else {
View Full Code Here

            throws NameDuplicationException, IllegalActionException {
        super(container, name);
        input.setTypeEquals(BaseType.DOUBLE);
        output.setTypeEquals(BaseType.DOUBLE);

        risingSlewRate = new Parameter(this, "risingSlewRate", new DoubleToken(
                1.0));
        fallingSlewRate = new Parameter(this, "fallingSlewRate",
                new DoubleToken(-1.0));
    }
View Full Code Here

                        .doubleValue();
                double fallingRate = ((DoubleToken) fallingSlewRate.getToken())
                        .doubleValue();

                if (rate > risingRate) {
                    _newToken = (new DoubleToken(timeDifference * risingRate))
                            .add(_lastToken);
                } else if (rate < fallingRate) {
                    _newToken = (new DoubleToken(timeDifference * fallingRate))
                            .add(_lastToken);
                }

                output.send(0, _newToken);
            }
View Full Code Here

            }
        }

        double timeInterval = director.getModelTime().subtract(_time)
                .getDoubleValue();
        output.send(0, new DoubleToken(_value + (timeInterval * _derivative)));
    }
View Full Code Here

    public boolean postfire() throws IllegalActionException {
        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

TOP

Related Classes of ptolemy.data.DoubleToken

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.