Examples of BooleanToken


Examples of ptolemy.data.BooleanToken

            String variableName = (String) absentDiscreteVariables.next();
            if (variablesOfNode.contains(variableName)) {
                // Set the result token to be false token
                // because the variable is discrete and has no value.
                // Note usually the usage is "x_isPresent && x == 1.0"
                _evaluatedChildToken = new BooleanToken(false);
                if (_constructingRelationList) {
                    _relationList.addRelation(RelationType.INVALID, 0.0);
                } else {
                    // Only update _relationIndex but do not change relation node.
                    _relationIndex++;
View Full Code Here

Examples of ptolemy.data.BooleanToken

        input = new TypedIOPort(this, "input", true, false);
        output = new TypedIOPort(this, "output", false, true);
        input.setTypeEquals(BaseType.GENERAL);
        output.setTypeEquals(BaseType.GENERAL);

        nullDelay = new Parameter(this, "nullDelay", new BooleanToken(true));
        nullDelay.setTypeEquals(BaseType.BOOLEAN);
        realDelay = new Parameter(this, "realDelay", new BooleanToken(false));
        realDelay.setTypeEquals(BaseType.BOOLEAN);
        delay = new Parameter(this, "delay", new DoubleToken(1.0));
        delay.setTypeEquals(BaseType.DOUBLE);
    }
View Full Code Here

Examples of ptolemy.data.BooleanToken

     *   supported by the derived class.
     *  @return A BooleanToken which contains the result of the test.
     */
    public BooleanToken isEqualTo(Token token) throws IllegalActionException {
        if (token instanceof Scene2DToken) {
            return new BooleanToken(this == token);
        } else {
            throw new IllegalActionException(
                    "Equality test not supported between "
                            + this.getClass().getName() + " and "
                            + token.getClass().getName() + ".");
View Full Code Here

Examples of ptolemy.data.BooleanToken

            if (integer < -(1 << (rate - 1))) {
                throw new IllegalActionException(this,
                        "integer is out of range.");
            }

            bits[0] = new BooleanToken(true);

            //integer = (int)(2147483648L + integer);
            integer = ((1 << (rate - 1)) + integer);
        } else {
            if (integer > ((1 << (rate - 1)) - 1)) {
                throw new IllegalActionException(this,
                        "integer is out of range.");
            }

            bits[0] = new BooleanToken(false);
        }

        for (int i = rate - 1; i > 0; i--) {
            int remainder = integer % 2;
            integer = integer / 2;

            if (remainder == 0) {
                bits[i] = new BooleanToken(false);
            } else {
                bits[i] = new BooleanToken(true);
            }
        }

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

Examples of ptolemy.data.BooleanToken

                    _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);

            timeResolution.setVisibility(Settable.FULL);
        } catch (IllegalActionException ex) {
            throw new InternalErrorException(getName()
View Full Code Here

Examples of ptolemy.data.BooleanToken

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

        deadZone = new Parameter(this, "deadZone", new DoubleToken("0.01"));

        isPolling = new Parameter(this, "isPolling", new BooleanToken("true"));

        pollingInterval = new Parameter(this, "pollingInterval", new IntToken(
                "50"));

        x = new TypedIOPort(this, "x", false, true);
View Full Code Here

Examples of ptolemy.data.BooleanToken

        for (int i = 0; i < array1.length(); i++) {
            // Here is where isCloseTo() differs from isEqualTo().
            // Note that we return false the first time we hit an
            // element token that is not close to our current element token.
            BooleanToken result = array1.getElement(i).isCloseTo(
                    array2.getElement(i), epsilon);

            // If the tokens are not close and array1[i] and is not nil, then
            // the arrays really aren't close.
            if (result.booleanValue() == false) {
                if (array1.getElement(i).isNil()
                        && array2.getElement(i).isNil()) {
                    // They are not close, but both are nil, so for
                    // our purposes, the are close.
                } else {
View Full Code Here

Examples of ptolemy.data.BooleanToken

                    input.get(i);
                }
            }

            // Indicate that the test has passed.
            output.send(0, new BooleanToken(true));
            return;
        }

        output.send(0, new BooleanToken(false));

        Token referenceToken = ((ArrayToken) (correctValues.getToken()))
                .getElement(_numberOfInputTokensSeen);
        Token[] reference;
View Full Code Here

Examples of ptolemy.data.BooleanToken

        super.fire();
        _debug("Monitor" + getFullName() + " fired.");
        _thisInput = ((DoubleToken) input.get(0)).doubleValue();

        if ((_thisInput <= _upperBound) && (_thisInput >= _lowerBound)) {
            output.send(0, new BooleanToken(true));
        } else {
            output.send(0, new BooleanToken(false));
        }
    }
View Full Code Here

Examples of ptolemy.data.BooleanToken

        if (input.hasToken(0)) {
            _thisInput = ((DoubleToken) input.get(0)).doubleValue();
        }

        if ((_thisInput <= _upperBound) && (_thisInput >= _lowerBound)) {
            output.send(0, new BooleanToken(true));
        } else {
            output.send(0, new BooleanToken(false));
        }

        _lastInput = _thisInput;
        _first = false;
        return true;
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.