Package ptolemy.kernel

Examples of ptolemy.kernel.Relation


                // Create the appropriate links.
                MultiCompositeActor container = (MultiCompositeActor) getContainer();

                if (container != null) {
                    String relationName = name + "Relation";
                    Relation relation = container.getRelation(relationName);

                    if (relation == null) {
                        relation = container.newRelation(relationName);

                        Port containerPort = container.getPort(name);
View Full Code Here


                        }
                    }
                }

                // Rename the corresponding relation.
                Relation relation = container.getRelation(oldName + "Relation");

                if (relation != null) {
                    relation.setName(name + "Relation");
                }
            }
        } finally {
            _workspace.doneWriting();
        }
View Full Code Here

        //_fBack2.delay.setToken(new DoubleToken(4.5));
        _fBack1.delay.setToken(new DoubleToken(1.0));
        _fBack2.delay.setToken(new DoubleToken(1.0));

        // Set up ports, relations and connections
        Relation clkRelation = toplevel.connect(_clock.output, _join1.input);
        _join2.input.link(clkRelation);

        toplevel.connect(_join1.output, _fork1.input);
        toplevel.connect(_fork1.output1, _rcvr1.input);
        toplevel.connect(_fork1.output2, _fBack1.input);
View Full Code Here

        }

        Iterator relations = _model.relationList().iterator();

        while (relations.hasNext()) {
            Relation relation = (Relation) (relations.next());
            String relationDeletes = _deletesIfNecessary(relation);

            if (relationDeletes != null) {
                moml.append("<relation name=\"" + relation.getName() + "\">"
                        + relationDeletes + "\"/></relation>");
            }
        }

        if (moml.length() > 0) {
View Full Code Here

            return;
        }
        // Unlink to all previous relations, if any.
        Iterator relations = _relations.iterator();
        while (relations.hasNext()) {
            Relation relation = (Relation) relations.next();
            input.unlink(relation);
        }
        _relations.clear();

        // Link to all matching publishers.
View Full Code Here

        PSDFDirector director = (PSDFDirector) getContainer();
        CompositeActor model = (CompositeActor) director.getContainer();
        Iterator relations = model.relationList().iterator();

        while (relations.hasNext()) {
            Relation relation = (Relation) relations.next();
            Variable variable = (Variable) relation.getAttribute("bufferSize");
            result.append(relation.getName() + ": ");

            if (variable == null) {
                result.append("null");
            } else {
                result.append(variable.getExpression());
View Full Code Here

            _debug("The buffer size map:\n");

            Iterator relations = _bufferSizeMap.keySet().iterator();

            while (relations.hasNext()) {
                Relation relation = (Relation) relations.next();
                _debug(relation.getName() + ": " + _bufferSizeMap.get(relation)
                        + "\n");
            }
        }

        _saveBufferSizes(_bufferSizeMap);
View Full Code Here

                                + "\nA dump of the offending edge follows.\n"
                                + nextEdge + "\n");
                    }

                    Iterator relations = relationList.iterator();
                    Relation relation = (Relation) relations.next();
                    String produced = strategy.producedExpression(nextEdge);
                    String consumed = strategy.consumedExpression(nextEdge);
                    String bufferSizeExpression = "((" + produced + ") * ("
                            + consumed + ")) / "
                            + PSDFGraphs.gcdExpression(produced, consumed);

                    // Due to the bottom-up traversal in _expandAPGAN,
                    // relations that are linked to multiple sink
                    // nodes will have their buffer sizes
                    // progressively replaced by those of outer
                    // clusterings, and will end up with the buffer
                    // size determined by the outermost clustering.
                    _debug("Associating buffer size expression '"
                            + bufferSizeExpression + "' with relation '"
                            + relation.getName() + "'\n");
                    _bufferSizeMap.put(relation, bufferSizeExpression);
                }

                return symbolicSchedule;
            }
View Full Code Here

        ChangeRequest request = new ChangeRequest(this, "Record buffer sizes") {
            protected void _execute() throws KernelException {
                Iterator relations = container.relationList().iterator();

                while (relations.hasNext()) {
                    Relation relation = (Relation) relations.next();
                    Object bufferSizeObject = minimumBufferSizes.get(relation);

                    if (bufferSizeObject instanceof Integer) {
                        int bufferSize = ((Integer) bufferSizeObject)
                                .intValue();
                        DFUtilities.setOrCreate(relation, "bufferSize",
                                bufferSize);

                        if (_debugging) {
                            _debug("Adding bufferSize parameter to "
                                    + relation.getName() + " with value "
                                    + bufferSize);
                        }
                    } else if (bufferSizeObject instanceof String) {
                        String bufferSizeExpression = (String) bufferSizeObject;
                        DFUtilities.setOrCreate(relation, "bufferSize", "\""
                                + bufferSizeExpression + "\"");

                        if (_debugging) {
                            _debug("Adding bufferSize parameter to "
                                    + relation.getName() + " with expression "
                                    + bufferSizeExpression);
                        }
                    } else if (bufferSizeObject == null) {
                    } else {
                        throw new InternalErrorException(
View Full Code Here

            // Collect constraints from all transitions.
            Iterator transitionRelations = relationList().iterator();

            while (transitionRelations.hasNext()) {
                Relation tr = (Relation) transitionRelations.next();
                attributes = tr.attributeList(HasTypeConstraints.class)
                        .iterator();

                while (attributes.hasNext()) {
                    HasTypeConstraints typeableAttribute = (HasTypeConstraints) attributes
                            .next();
View Full Code Here

TOP

Related Classes of ptolemy.kernel.Relation

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.