Package ptolemy.data

Examples of ptolemy.data.DoubleToken


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

        output.setTypeEquals(BaseType.DOUBLE);

        p = new PortParameter(this, "p", new DoubleToken(0.5));
        p.setTypeEquals(BaseType.DOUBLE);
        new SingletonParameter(p.getPort(), "_showName")
                .setToken(BooleanToken.TRUE);

        p.moveToFirst();
View Full Code Here


     @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        p.update();
        super.fire();
        output.send(0, new DoubleToken(_current));
    }
View Full Code Here

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

        output.setTypeEquals(BaseType.INT);

        mean = new PortParameter(this, "mean", new DoubleToken(1.0));
        mean.setTypeEquals(BaseType.DOUBLE);
        new SingletonParameter(mean.getPort(), "_showName")
                .setToken(BooleanToken.TRUE);

        mean.moveToFirst();
View Full Code Here

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

        output.setTypeEquals(BaseType.DOUBLE);

        lambda = new PortParameter(this, "lambda", new DoubleToken(1.0));
        lambda.setTypeEquals(BaseType.DOUBLE);
        new SingletonParameter(lambda.getPort(), "_showName")
                .setToken(BooleanToken.TRUE);

        lambda.moveToFirst();
View Full Code Here

     @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        lambda.update();
        super.fire();
        output.send(0, new DoubleToken(_current));
    }
View Full Code Here

        }

        // Output the zeroth order prediction error power, which is
        // simply the power of the input process.
        double P = r[0];
        power[0] = new DoubleToken(P);

        double gamma;

        // The order recurrence
        for (int M = 0; M < order; M++) {
            // Compute the new reflection coefficient.
            double deltaM = 0.0;

            for (int m = 0; m < (M + 1); m++) {
                deltaM += (a[m] * r[(M + 1) - m]);
            }

            // Compute and output the reflection coefficient
            // (which is also equal to the last AR parameter).
            if (SignalProcessing.close(P, 0.0)) {
                aP[M + 1] = gamma = 0.0;
            } else {
                aP[M + 1] = gamma = -deltaM / P;
            }

            refl[M] = new DoubleToken(-gamma);

            for (int m = 1; m < (M + 1); m++) {
                aP[m] = a[m] + (gamma * a[(M + 1) - m]);
            }

            // Update the prediction error power.
            P = P * (1.0 - (gamma * gamma));

            if ((P < 0.0) || SignalProcessing.close(P, 0.0)) {
                P = 0.0;
            }

            power[M + 1] = new DoubleToken(P);

            // Swap a and aP for next order recurrence.
            double[] temp = a;
            a = aP;
            aP = temp;
        }

        // Generate the lp outputs.
        for (int m = 1; m <= order; m++) {
            lp[m - 1] = new DoubleToken(-a[m]);
        }

        linearPredictor.broadcast(new ArrayToken(BaseType.DOUBLE, lp));
        reflectionCoefficients.broadcast(new ArrayToken(BaseType.DOUBLE, refl));
        errorPower.broadcast(new ArrayToken(BaseType.DOUBLE, power));
View Full Code Here

        n = new PortParameter(this, "n", new IntToken(1));
        n.setTypeEquals(BaseType.INT);
        new SingletonParameter(n.getPort(), "_showName")
                .setToken(BooleanToken.TRUE);

        p = new PortParameter(this, "p", new DoubleToken(0.5));
        p.setTypeEquals(BaseType.DOUBLE);
        new SingletonParameter(p.getPort(), "_showName")
                .setToken(BooleanToken.TRUE);

        p.moveToFirst();
View Full Code Here

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

        output.setTypeEquals(BaseType.DOUBLE);

        lowerBound = new PortParameter(this, "lowerBound", new DoubleToken(0.0));
        lowerBound.setTypeEquals(BaseType.DOUBLE);
        new SingletonParameter(lowerBound.getPort(), "_showName")
                .setToken(BooleanToken.TRUE);

        upperBound = new PortParameter(this, "upperBound", new DoubleToken(1.0));
        upperBound.setTypeEquals(BaseType.DOUBLE);
        new SingletonParameter(upperBound.getPort(), "_showName")
                .setToken(BooleanToken.TRUE);
    }
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        lowerBound.update();
        upperBound.update();
        super.fire();
        output.send(0, new DoubleToken(_current));
    }
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        alpha.update();
        beta.update();
        super.fire();
        output.send(0, new DoubleToken(_current));
    }
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.