Package ptolemy.data

Examples of ptolemy.data.DoubleToken


    public void fire() throws IllegalActionException {
        mean.update();
        gamma.update();
        cut.update();
        super.fire();
        output.send(0, new DoubleToken(_current));
    }
View Full Code Here


        if (value instanceof ptolemy.data.Token) {
            tmp = (ptolemy.data.Token) value;
        } else if (value instanceof Integer) {
            tmp = new IntToken(((Integer) value).intValue());
        } else if (value instanceof Double) {
            tmp = new DoubleToken(((Double) value).doubleValue());
        } else if (value instanceof Long) {
            tmp = new LongToken(((Long) value).longValue());
        } else if (value instanceof String) {
            tmp = new StringToken((String) value);
        } else if (value instanceof Boolean) {
View Full Code Here

                        Double value = new Double(x.substring(0, len - 1));
                        if (x.endsWith("p")) {
                            jjtn002._ptToken = new PetiteToken(value
                                    .doubleValue());
                        } else {
                            jjtn002._ptToken = new DoubleToken(value
                                    .doubleValue());
                        }
                    } else {
                        Double value = new Double(x);
                        jjtn002._ptToken = new DoubleToken(value.doubleValue());
                    }
                    jjtn002._isConstant = true;
                } catch (NumberFormatException ee) {
                    {
                        if (true) {
View Full Code Here

            throws NameDuplicationException, IllegalActionException {
        super(container, name);

        output.setTypeEquals(BaseType.DOUBLE);

        mean = new PortParameter(this, "mean", new DoubleToken(0.0));
        mean.setTypeEquals(BaseType.DOUBLE);

        standardDeviation = new PortParameter(this, "standardDeviation");
        standardDeviation.setExpression("1.0");
        standardDeviation.setTypeEquals(BaseType.DOUBLE);
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        super.fire();
        mean.update();
        standardDeviation.update();
        output.send(0, new DoubleToken(_current));
    }
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);
            }
        }
View Full Code Here

        } else if (type == BaseType.DOUBLE) {

            double[][] tokens = (double[][]) outputTokens;
            for (int i = 0; i < port.getWidthInside(); i++) {
                for (int k = 0; k < rate; k++) {
                    Token token = new DoubleToken(tokens[i][k]);
                    port.send(i, token);
                }
            }

        } else if (type == PointerToken.POINTER) {
View Full Code Here

        periodControl.setTypeEquals(BaseType.DOUBLE);

        // Change default values from the base class.
        offsets.setExpression("{0.0}");
        values.setExpression("{1}");
        period.setToken(new DoubleToken(1.0));
    }
View Full Code Here

                } else if (newCoefficient < -1.0) {
                    newCoefficient = -1.0;
                }
            }

            outputArray[i - 1] = new DoubleToken(newCoefficient);
            _reflectionCoefficientsCache[i - 1] = newCoefficient;
            _estimatedErrorPowerCache[i] = newError;
        }

        adaptedReflectionCoefficients.send(0, new ArrayToken(BaseType.DOUBLE,
View Full Code Here

        topLevelActor.setName("universe");

        Manager manager = new Manager(workSpc, "manager");
        DDEDirector director = new DDEDirector(topLevelActor, "director");
        Parameter stopTime = (Parameter) director.getAttribute("stopTime");
        stopTime.setToken(new DoubleToken(57.0));
        topLevelActor.setManager(manager);

        // Set up next level actors
        Clock vowelSrc = new Clock(topLevelActor, "vowelSrc");
        vowelSrc.values.setExpression("{1,1,1,1,1,1,1,1,1,1,1,1,1}");
        vowelSrc.period.setToken(new DoubleToken(100.0));
        vowelSrc.offsets
                .setExpression("{0.5,2.0,5.0,7.0,8.0,11.0,12.5,13.5,14.0,15.5,17.5,19.5,20.5}");
        vowelSrc.stopTime.setToken(new DoubleToken(30.0));

        Clock consonantsSrc = new Clock(topLevelActor, "consonantsSrc");
        consonantsSrc.values
                .setExpression("{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}");
        consonantsSrc.period.setToken(new DoubleToken(100.0));
        consonantsSrc.offsets
                .setExpression("{0.0, 1.0, 1.5, 4.0, 4.5, 6.0, 6.5, 7.5, 8.5, 9.0, 10.0, 10.5, 12.0, 13.0, 14.5, 16.0, 17.0, 18.0, 18.5, 19.0, 20.0}");
        consonantsSrc.stopTime.setToken(new DoubleToken(30.0));

        Clock punctuationSrc = new Clock(topLevelActor, "punctuationSrc");
        punctuationSrc.values.setExpression("{1, 1, 1, 1, 1, 1, 1, 1, 1}");
        punctuationSrc.period.setToken(new DoubleToken(100.0));
        punctuationSrc.offsets
                .setExpression("{2.5, 3.0, 3.5, 5.5, 9.5, 11.5, 15.0, 16.5, 21.0}");
        punctuationSrc.stopTime.setToken(new DoubleToken(30.0));

        PrintString printer = new PrintString(topLevelActor, "printer");
        Consonants consonants = new Consonants(topLevelActor, "consonants");
        Vowels vowels = new Vowels(topLevelActor, "vowels");
        Punctuation punctuation = new Punctuation(topLevelActor, "punctuation");
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.