Package ptolemy.graph

Examples of ptolemy.graph.Inequality


            boolean destUndeclared = destinationPort.getTypeTerm().isSettable();

            if (srcUndeclared || destUndeclared) {
                // At least one of the source/destination ports does
                // not have declared type, form type constraint.
                Inequality ineq = new Inequality(sourcePort.getTypeTerm(),
                        destinationPort.getTypeTerm());
                result.add(ineq);
            }
        }
View Full Code Here


                            if (inPortConstraints.isEmpty()
                                    && outPortConstraints.isEmpty()) {
                                // ports not constrained, use default
                                // constraint
                                Inequality inequality = new Inequality(inPort
                                        .getTypeTerm(), outPort.getTypeTerm());
                                result.add(inequality);
                            }
                        }
                    }
View Full Code Here

        if (debug) {
            System.out.println("greater = " + greater);
        }

        if ((lesser != null) && (greater != null) && greater.isSettable()) {
            Inequality inequality = new Inequality(lesser, greater);

            if (debug) {
                System.out.println("adding inequality = " + inequality);
            }
View Full Code Here

        Iterator outputPorts = outputPortList().iterator();

        while (outputPorts.hasNext()) {
            TypedIOPort outputPort = (TypedIOPort) outputPorts.next();
            String label = outputPort.getName();
            Inequality inequality = new Inequality(new PortFunction(label),
                    outputPort.getTypeTerm());
            constraints.add(inequality);
        }

        return constraints;
View Full Code Here

                    // Make sure the constraints are the same.
                    StringBuffer constraintsDescription = new StringBuffer();
                    try {
                        Iterator constraintIterator = constraints.iterator();
                        while (constraintIterator.hasNext()) {
                            Inequality constraint = (Inequality) constraintIterator
                                    .next();
                            constraintsDescription
                                    .append(constraint.toString());
                        }
                    } catch (Throwable throwable) {
                        throw new IllegalActionException(actor, throwable,
                                "Failed to iterate through constraints.");
                    }
                    StringBuffer cloneConstraintsDescription = new StringBuffer();
                    Iterator cloneConstraintIterator = cloneConstraints
                            .iterator();
                    while (cloneConstraintIterator.hasNext()) {
                        Inequality constraint = (Inequality) cloneConstraintIterator
                                .next();
                        cloneConstraintsDescription.append(constraint
                                .toString());
                    }

                    if (!constraintsDescription.toString().equals(
                            cloneConstraintsDescription.toString())) {
                        results
                                .append(actor.getFullName()
                                        + " and its clone do "
                                        + "not have the same constraints:\n"
                                        + constraintsDescription.toString()
                                        + "\nClone:\n"
                                        + cloneConstraintsDescription
                                                .toString() + "\n");
                    }

                    // Check that the type constraint is between ports
                    // and Parameters of the same object.

                    cloneConstraintIterator = cloneConstraints.iterator();
                    while (cloneConstraintIterator.hasNext()) {
                        Inequality constraint = (Inequality) cloneConstraintIterator
                                .next();
                        InequalityTerm greaterTerm = constraint
                                .getGreaterTerm();
                        InequalityTerm lesserTerm = constraint.getLesserTerm();

                        Object greaterAssociatedObject = greaterTerm
                                .getAssociatedObject();
                        Object lesserAssociatedObject = lesserTerm
                                .getAssociatedObject();
View Full Code Here

        Iterator inputPorts = inputPortList().iterator();

        while (inputPorts.hasNext()) {
            TypedIOPort inputPort = (TypedIOPort) inputPorts.next();
            String label = inputPort.getName();
            Inequality inequality = new Inequality(inputPort.getTypeTerm(),
                    outputType.getTypeTerm(label));
            _typeConstraintList.add(inequality);
        }
        _typeConstraintListVersion = workspace().getVersion();
        return _typeConstraintList;
View Full Code Here

        // Set the constraints between record fields and output ports
        List constraints = new LinkedList();

        // Since the input port has a clone of the above RecordType, need to
        // get the type from the input port.
        Inequality inequality = new Inequality(new FunctionTerm(), output
                .getTypeTerm());
        constraints.add(inequality);

        return constraints;
    }
View Full Code Here

TOP

Related Classes of ptolemy.graph.Inequality

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.