Package ptolemy.data

Examples of ptolemy.data.DoubleToken


        input = new TypedIOPort(this, "input");
        input.setInput(true);
        input.setOutput(false);
        input.setMultiport(true);
        input.setTypeEquals(BaseType.DOUBLE);
        testValue = new Parameter(this, "Value", new DoubleToken(1.0));
        print = new Parameter(this, "Print", new BooleanToken(false));
    }
View Full Code Here


            }
        }

        PSNRValue = 10 * ExtendedMath.log10((double) signalPower / noisePower);

        DoubleToken message = new DoubleToken(PSNRValue);
        output.send(0, message);
    }
View Full Code Here

                // Get the location and wrap each coordinate in a token.
                double[] location = _getLocation();
                Token[] locationArray = new Token[location.length];

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

                double timeValue = getDirector().getModelTime()
                        .getDoubleValue();
                Token[] values = { new ArrayToken(locationArray),
                        new DoubleToken(timeValue), new IntToken(0) };
                Token result = new RecordToken(labels, values);

                output.send(0, result);
            } else {
                // It is the pursuer. Send its parent info to the pursuer.
                if (_timeValue > 0.0) {
                    String[] labels = { "location", "time", "depth" };

                    Token[] values = { new ArrayToken(_parentLocation),
                            new DoubleToken(_timeValue),
                            new IntToken(_parentDepth) };
                    Token result = new RecordToken(labels, values);

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

        double[] location = _getLocation();
        _parentLocation = new DoubleToken[location.length];

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

        _parentDepth = 0;
        _timeValue = 0.0;
    }
View Full Code Here

        sceneGraphOut.setTypeEquals(Scene2DToken.TYPE);

        rgbColor = new ColorAttribute(this, "rgbColor");
        rgbColor.setExpression("{0.0, 0.0, 0.0, 1.0}");

        lineWidth = new Parameter(this, "lineWidth", new DoubleToken(1.0));
        lineWidth.setTypeEquals(BaseType.DOUBLE);

        xStart = new Parameter(this, "xStart", new DoubleToken(0.0));
        xStart.setTypeEquals(BaseType.DOUBLE);

        yStart = new Parameter(this, "yStart", new DoubleToken(0.0));
        yStart.setTypeEquals(BaseType.DOUBLE);

        xEnd = new Parameter(this, "xEnd", new DoubleToken(100.0));
        xEnd.setTypeEquals(BaseType.DOUBLE);

        yEnd = new Parameter(this, "yEnd", new DoubleToken(0.0));
        yEnd.setTypeEquals(BaseType.DOUBLE);
    }
View Full Code Here

        super(container, name);

        angleType = new StringAttribute(this, "angleType");
        angleType.setExpression("radians");

        initialTheta = new Parameter(this, "initialTheta", new DoubleToken(0.0));
        initialTheta.setTypeEquals(BaseType.DOUBLE);

        initialAnchorX = new Parameter(this, "initialAnchorX", new DoubleToken(
                0.0));
        initialAnchorX.setTypeEquals(BaseType.DOUBLE);

        initialAnchorY = new Parameter(this, "initialAnchorY", new DoubleToken(
                0.0));
        initialAnchorY.setTypeEquals(BaseType.DOUBLE);

        theta = new TypedIOPort(this, "theta", true, false);
        theta.setTypeEquals(BaseType.DOUBLE);
View Full Code Here

    private void _initParameters() {
        try {
            _startTime = new Time(this);
            _stopTime = new Time(this, Double.POSITIVE_INFINITY);

            startTime = new Parameter(this, "startTime", new DoubleToken(
                    _startTime.getDoubleValue()));
            startTime.setTypeEquals(BaseType.DOUBLE);
            stopTime = new Parameter(this, "stopTime", new DoubleToken(
                    "Infinity"));
            stopTime.setTypeEquals(BaseType.DOUBLE);
            preemptive = new Parameter(this, "preemptive", new BooleanToken(
                    false));

            preemptive.setTypeEquals(BaseType.BOOLEAN);
            defaultTaskExecutionTime = new Parameter(this,
                    "defaultTaskExecutionTime", new DoubleToken(0.0));
            defaultTaskExecutionTime.setTypeEquals(BaseType.DOUBLE);

            synchronizeToRealTime = new Parameter(this,
                    "synchronizeToRealTime", new BooleanToken(false));
            synchronizeToRealTime.setTypeEquals(BaseType.BOOLEAN);
View Full Code Here

     *   actor with this name.
     */
    public Torus3D(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        angleSpan = new Parameter(this, "angleSpan", new DoubleToken(
                2 * Math.PI));
        slices = new Parameter(this, "slices", new IntToken(28));
        crossSectionRadius = new Parameter(this, "crossSectionRadius",
                new DoubleToken(0.15));
        hullRadius = new Parameter(this, "hullRadius", new DoubleToken(0.75));
    }
View Full Code Here

        sureRange.setToken("100.0");
        sureRange.setTypeEquals(BaseType.DOUBLE);

        output.outsideTransmitProperties.setExpression("{range=Infinity}");

        delay = new Parameter(this, "delay", new DoubleToken(1.0));
        delay.setTypeEquals(BaseType.DOUBLE);

        seed = new Parameter(this, "seed", new LongToken(0));
        seed.setTypeEquals(BaseType.LONG);
View Full Code Here

                }

                // Request refiring after a certain amount of time specified
                // by the <i>delay<i> parameter.
                Director director = getDirector();
                Token[] values = { new DoubleToken(data),
                        new StringToken(destination), new StringToken(to),
                        new IntToken(hops + 1) };
                double delayTime = ((DoubleToken) delay.getToken())
                        .doubleValue();
                Time time = director.getModelTime().add(delayTime);

                if (_receptions == null) {
                    _receptions = new HashMap();
                }

                Double timeDouble = Double.valueOf(time.getDoubleValue());
                String[] labels = { "data", "destination", "routeTo", "hops" };
                RecordToken result = new RecordToken(labels, values);
                _receptions.put(timeDouble, result);

                director.fireAt(this, time);

                if (multi) {
                    Token[] values2 = { new DoubleToken(data),
                            new StringToken(destination), new StringToken(to2),
                            new IntToken(hops + 1) };

                    if (_receptions == null) {
                        _receptions = new HashMap();
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.