Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.IllegalActionException


        super.initialize();

        Director director = getDirector();

        if (director == null) {
            throw new IllegalActionException(this, "No director!");
        }

        double stopTimeValue = ((DoubleToken) stopTime.getToken())
                .doubleValue();
        _stopTime = new Time(getDirector(), stopTimeValue);
View Full Code Here


    /** Makes sure that there is only one relation connected to the
     output port and recalculates its width. */
    public void preinitialize() throws IllegalActionException {
        if (outputPortList().size() > 1) {
            throw new IllegalActionException(this,
                    "can have only one output port.");
        }

        if (output.linkedRelationList().size() > 1) {
            throw new IllegalActionException(this,
                    "can have only one output relation linked.");
        }

        _recalculateOutputWidth();
        super.preinitialize();
View Full Code Here

        CTDirector director = (CTDirector) getDirector();

        if (director.isDiscretePhase()) {
            if ((input.hasToken(0) && (!derivative.hasToken(0)))
                    || (!input.hasToken(0) && derivative.hasToken(0))) {
                throw new IllegalActionException(this,
                        " No synchronized inputs.");
            }

            if (input.hasToken(0) && derivative.hasToken(0)) {
                _value = ((DoubleToken) input.get(0)).doubleValue();
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        super.fire();
        int width = input.getWidth();
        if (width == 0) {
            throw new IllegalActionException(this, "No input channels.");
        }
        int outputWidth = 0;
        Token[][] inputs = new Token[width][];
        for (int i = 0; i < width; i++) {
            if (input.hasToken(i)) {
View Full Code Here

                    // Indicate that the cycle count should increase.
                    _tentativeCycleCountIncrement++;
                }

                if (_offsets[_tentativePhase] >= periodValue) {
                    throw new IllegalActionException(this, "Offset number "
                            + _tentativePhase + " with value "
                            + _offsets[_tentativePhase]
                            + " must be strictly less than the "
                            + "period, which is " + periodValue);
                }
View Full Code Here

     @exception IllegalActionException If the director is not
     *  a CTDirector or the parent class throws it.
     */
    public void preinitialize() throws IllegalActionException {
        if (!(getDirector() instanceof CTDirector)) {
            throw new IllegalActionException("ContinuousClock can only"
                    + " be used inside CT domain.");
        }

        super.preinitialize();
    }
View Full Code Here

    public void preinitialize() throws IllegalActionException {
        super.preinitialize();

        if (inputPortList().size() > 1) {
            throw new IllegalActionException(this,
                    "can have only one input port.");
        }
    }
View Full Code Here

                _offsets[i] = ((DoubleToken) offsetsValue.getElement(i))
                        .doubleValue();

                // Check nondecreasing property.
                if (_offsets[i] < previous) {
                    throw new IllegalActionException(this,
                            "Value of offsets is not nondecreasing "
                                    + "and nonnegative.");
                }

                previous = _offsets[i];
            }
        } else if (attribute == period) {
            double periodValue = ((DoubleToken) period.getToken())
                    .doubleValue();

            if (periodValue <= 0.0) {
                throw new IllegalActionException(this,
                        "Period is required to be positive.  "
                                + "Period given: " + periodValue);
            }
        } else {
            super.attributeChanged(attribute);
View Full Code Here

                    // Indicate that the cycle count should increase.
                    _tentativeCycleCountIncrement++;
                }

                if (_offsets[_tentativePhase] >= periodValue) {
                    throw new IllegalActionException(this, "Offset number "
                            + _tentativePhase + " with value "
                            + _offsets[_tentativePhase]
                            + " must be strictly less than the "
                            + "period, which is " + periodValue);
                }
View Full Code Here

    public boolean prefire() throws IllegalActionException {
        // FIXME: why put the check here???
        ArrayToken val = (ArrayToken) (values.getToken());

        if (_offsets.length != val.length()) {
            throw new IllegalActionException(this,
                    "Values and offsets vectors do not have the same length.");
        }

        return super.prefire();
    }
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.IllegalActionException

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.