Examples of IORelation


Examples of ptolemy.actor.IORelation

        }

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

        while (relations.hasNext()) {
            IORelation relation = (IORelation) relations.next();
            delete.append("<deleteRelation name=\"" + relation.getName()
                    + "\" class=\"ptolemy.actor.TypedIORelation\"/>");
        }

        delete.append("</group>");
        return delete.toString();
View Full Code Here

Examples of ptolemy.actor.IORelation

                    }
                }

                connect(inputAdder.output, integrators[0].input);

                IORelation inputRelation = (IORelation) connect(input,
                        inputAdder.plus, "inputRelation");
                connect(output, outputAdder.output, "outputRelation");

                if (d != 0) {
                    Scale scaleD = new Scale(this, "ScaleD");
View Full Code Here

Examples of ptolemy.actor.IORelation

        }

        LinkedList temporarySourcePortList = new LinkedList();

        while (newRelationList.size() > 0) {
            IORelation weights = (IORelation) newRelationList.getFirst();

            if (weights != null) {
                Iterator weightPorts = weights.linkedSourcePortList()
                        .iterator();

                while (weightPorts.hasNext()) {
                    IOPort weightPort = (IOPort) weightPorts.next();
View Full Code Here

Examples of ptolemy.actor.IORelation

        }

        LinkedList temporaryDestinationPortList = new LinkedList();

        while (newRelationList.size() > 0) {
            IORelation weights = (IORelation) newRelationList.getFirst();

            if (weights != null) {
                Iterator weightPorts = weights.linkedDestinationPortList()
                        .iterator();

                while (weightPorts.hasNext()) {
                    IOPort weightPort = (IOPort) weightPorts.next();

                    if (!temporaryDestinationPortList.contains(weightPort)) {
                        temporaryDestinationPortList.add(weightPort);

                        Nameable weightPlace = weightPort.getContainer();

                        if (weightPlace instanceof PetriNetActor) {
                            if (weightPort.isOutput()) {
                                newRelationList.addAll(weightPort
                                        .linkedRelationList());
                            } else if (weightPort.isInput()) {
                                newRelationList.addAll(weightPort
                                        .insideRelationList());
                            }
                        } else if (weightPlace instanceof Place) {
                            // Don't do anything for Place
                        } else {
                            _debug("something wrong "
                                    + weightPlace.getFullName());
                        }
                    }
                }

                int weightNumber = _getWeightNumber(weights);
                LinkedList forwardConnectedPlaces = _findForwardConnectedPlaces(weights);
                Iterator forwardConnectedPlace = forwardConnectedPlaces
                        .iterator();
                int itemCount = 0;

                while (forwardConnectedPlace.hasNext()) {
                    Place forwardPlace = (Place) forwardConnectedPlace.next();
                    itemCount++;

                    int oldToken = forwardPlace.getMarking();
                    forwardPlace.increaseMarking(weightNumber);

                    if (_debugging) {
                        _debug("              the " + itemCount + " place is "
                                + forwardPlace.getFullName() + " old  "
                                + oldToken + " new "
                                + forwardPlace.getMarking());
                    }
                }
            }

            newRelationList.remove(weights);
        }

        LinkedList backRelationList = new LinkedList();
        Iterator inputPorts = transition.inputPortList().iterator();

        while (inputPorts.hasNext()) {
            IOPort inPort = (IOPort) inputPorts.next();
            backRelationList.addAll(inPort.linkedRelationList());
        }

        LinkedList temporarySourcePortList = new LinkedList();

        while (backRelationList.size() > 0) {
            IORelation weights = (IORelation) backRelationList.getFirst();

            if (weights != null) {
                Iterator weightPorts = weights.linkedSourcePortList()
                        .iterator();

                while (weightPorts.hasNext()) {
                    IOPort weightPort = (IOPort) weightPorts.next();
View Full Code Here

Examples of ptolemy.actor.IORelation

        LinkedList temporaryDestinationPortList = new LinkedList();
        LinkedList temporaryPlaceList = new LinkedList();

        while (newRelationList.size() > 0) {
            IORelation weights = (IORelation) newRelationList.getFirst();
            Iterator weightPorts = weights.linkedDestinationPortList()
                    .iterator();

            while (weightPorts.hasNext()) {
                IOPort weightPort = (IOPort) weightPorts.next();
View Full Code Here

Examples of ptolemy.actor.IORelation

        LinkedList temporarySourcePortList = new LinkedList();
        LinkedList temporaryPlaceList = new LinkedList();

        while (newRelationList.size() > 0) {
            IORelation weights = (IORelation) newRelationList.getFirst();
            Iterator weightPorts = weights.linkedSourcePortList().iterator();

            while (weightPorts.hasNext()) {
                IOPort weightPort = (IOPort) weightPorts.next();

                if (!temporarySourcePortList.contains(weightPort)) {
View Full Code Here

Examples of ptolemy.actor.IORelation

        }

        LinkedList temporaryPlaceList = new LinkedList();

        while (newRelationList.size() > 0) {
            IORelation weights = (IORelation) newRelationList.getFirst();
            temporaryPlaceList.addAll(_findBackwardConnectedPlaces(weights));
            newRelationList.remove(weights);
        }

        return temporaryPlaceList;
View Full Code Here

Examples of ptolemy.actor.IORelation

        // Probably need to recursively descend into composite actors.
        CompositeEntity container = (CompositeEntity) getContainer();
        Iterator relations = container.relationList().iterator();

        while (relations.hasNext()) {
            IORelation relation = (IORelation) relations.next();

            if (relation.linkedSourcePortList().size() > 1) {
                throw new IllegalActionException(relation,
                        "Relation has multiple sources of data,"
                                + " which is not allowed in PN."
                                + " If you want nondeterministic merge,"
                                + " use the NondeterministicMerge actor.");
View Full Code Here

Examples of ptolemy.actor.IORelation

                    Iterator relations = inPort.linkedRelationList().iterator();
                    int channelIndex = 0;

                    while (relations.hasNext()) {
                        IORelation relation = (IORelation) relations.next();
                        boolean linked = false;

                        for (int i = 0; i < actors.length; ++i) {
                            Iterator outports = actors[i].outputPortList()
                                    .iterator();

                            while (outports.hasNext()) {
                                IOPort outport = (IOPort) outports.next();
                                linked = linked | outport.isLinked(relation);
                            }
                        }

                        for (int j = 0; j < relation.getWidth(); ++j) {
                            flags[channelIndex + j] = linked;
                        }

                        channelIndex += relation.getWidth();
                    }

                    stateMap.put(inPort, flags);
                }
View Full Code Here

Examples of ptolemy.actor.IORelation

                    _inputTokensHolder.put(port, tokens);
                }

                // Connect the corresponding ports of both actors.
                IOPort matchingPort = (IOPort) clone.getPort(port.getName());
                IORelation relation = (IORelation) newRelation("r_" + i++);
                port.link(relation);
                matchingPort.link(relation);

                if (port.isMultiport()) {
                    relation.setWidth(port.getWidth());
                }
            }
        } catch (NameDuplicationException ex) {
            throw new IllegalActionException(this, "name duplication.");
        }
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.