Examples of BooleanToken


Examples of ptolemy.data.BooleanToken

        }

        // Exclusive-or with the input if there is any.
        for (int i = 0; i < input.getWidth(); i++) {
            if (input.hasToken(0)) {
                BooleanToken inputToken = (BooleanToken) input.get(0);
                boolean inputTokenValue = inputToken.booleanValue();
                parity = parity ^ (inputTokenValue ? 1 : 0);
            }
        }

        _latestShiftReg = reg | parity;
View Full Code Here

Examples of ptolemy.data.BooleanToken

        int reg = _latestShiftReg;

        for (int i = 0; i < _inputNumber; i++) {
            reg = reg << 1;

            BooleanToken input = (BooleanToken) inputToken[i];
            reg = reg | (input.booleanValue() ? 1 : 0);
        }

        _latestShiftReg = reg;

        // Compute the parities for all polynomials respectively.
View Full Code Here

Examples of ptolemy.data.BooleanToken

     *  If there is no input on any channel, then produce no output.
     *  @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        // Don't call "super.fire();" here, the parent class is an actor.
        BooleanToken value = null;
        BooleanToken in = null;

        for (int i = 0; i < input.getWidth(); i++) {
            if (input.isKnown(i)) {
                if (input.hasToken(i)) {
                    in = (BooleanToken) (input.get(i));
View Full Code Here

Examples of ptolemy.data.BooleanToken

    /** Nullify results that cannot be asserted due to unknown inputs.
     */
    private BooleanToken _nullifyIncompleteResults(BooleanToken inValue)
            throws IllegalActionException {
        BooleanToken outValue = inValue;
        ;

        if (!input.isKnown()) {
            switch (_function) {
            case _AND:
View Full Code Here

Examples of ptolemy.data.BooleanToken

        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

Examples of ptolemy.data.BooleanToken

        verticalResolution = new Parameter(this, "verticalResolution",
                new IntToken(400));
        verticalResolution.setTypeEquals(BaseType.INT);

        rotatable = new Parameter(this, "rotatable", new BooleanToken(true));
        rotatable.setTypeEquals(BaseType.BOOLEAN);

        scalable = new Parameter(this, "scalable", new BooleanToken(false));
        scalable.setTypeEquals(BaseType.BOOLEAN);

        translatable = new Parameter(this, "translatable", new BooleanToken(
                false));
        translatable.setTypeEquals(BaseType.BOOLEAN);

        showAxes = new Parameter(this, "showAxes", new BooleanToken(false));
        showAxes.setTypeEquals(BaseType.BOOLEAN);

        iterationSynchronized = new Parameter(this, "iterationSynchronized",
                new BooleanToken(false));
        iterationSynchronized.setTypeEquals(BaseType.BOOLEAN);

        backgroundColor = new ColorAttribute(this, "backgroundColor");
        backgroundColor.setExpression("{0.0, 0.0, 0.0, 1.0}");
View Full Code Here

Examples of ptolemy.data.BooleanToken

        numberOfInputs.setTypeEquals(BaseType.INT);

        numberOfLags = new Parameter(this, "numberOfLags", new IntToken(64));
        numberOfLags.setTypeEquals(BaseType.INT);

        biased = new Parameter(this, "biased", new BooleanToken(false));
        biased.setTypeEquals(BaseType.BOOLEAN);

        symmetricOutput = new Parameter(this, "symmetricOutput",
                new BooleanToken(false));
        symmetricOutput.setTypeEquals(BaseType.BOOLEAN);

        input.setTypeAtLeast(new FunctionTerm(input));

        // Set the output type to be an ArrayType.
View Full Code Here

Examples of ptolemy.data.BooleanToken

     */
    public void fire() throws IllegalActionException {
        super.fire();

        if ((ledRed.getWidth() > 0) && ledRed.hasToken(0)) {
            BooleanToken red = (BooleanToken) ledRed.get(0);

            if (red.booleanValue()) {
                _redOn();
            } else {
                _redOff();
            }
        }

        if ((ledGreen.getWidth() > 0) && ledGreen.hasToken(0)) {
            BooleanToken green = (BooleanToken) ledGreen.get(0);

            if (green.booleanValue()) {
                _greenOn();
            } else {
                _greenOff();
            }
        }

        if ((ledYellow.getWidth() > 0) && ledYellow.hasToken(0)) {
            BooleanToken yellow = (BooleanToken) ledYellow.get(0);

            if (yellow.booleanValue()) {
                _yellowOn();
            } else {
                _yellowOff();
            }
        }
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 SceneGraphToken) {
            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

            CompositeActor model = (CompositeActor) getContainer();
            TypedIOPort port = (TypedIOPort) model.getPort(portName);
            if (port != null) {
                if (port.getWidth() > 0) {
                    if (port.getType() == BaseType.BOOLEAN) {
                        port.send(0, new BooleanToken(expression));
                        return true;
                    } else if (port.getType() == BaseType.STRING) {
                        port.send(0, new StringToken(expression));
                        return true;
                    } else {
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.