Examples of Nameable


Examples of ptolemy.kernel.util.Nameable

                    _channel = newValue;
                    // If we are within a class definition, then we should
                    // not create any links.  The links should only exist
                    // within instances. Otherwise, we could end up creating
                    // a link between a class definition and an instance.
                    Nameable container = getContainer();
                    if ((container instanceof TypedCompositeActor)) {
                        // NOTE: There used to be some logic here to call
                        // _updateLinks() only if the manager indicates we
                        // are running, and otherwise to set _updatedLinks
                        // to false. This is no longer necessary as
View Full Code Here

Examples of ptolemy.kernel.util.Nameable

                    String entryName = name.substring(period + 1);

                    // FIXME: Look in the container of the fsm???
                    // Below we look for an attribute only in the fsm
                    // itself.
                    Nameable fsmContainer = fsm.getContainer();

                    if (fsmContainer instanceof CompositeEntity) {
                        Entity refinement = ((CompositeEntity) fsmContainer)
                                .getEntity(refinementName);
View Full Code Here

Examples of ptolemy.kernel.util.Nameable

     *  _fireHierarchicalPetriNetOnce() throws exceptions, which can
     *  happen if the method isTransitionReady() or fireTransition()
     throws exceptions.
     */
    public void fire() throws IllegalActionException {
        Nameable container = getContainer();

        if (container instanceof TypedCompositeActor) {
            TypedCompositeActor petriContainer = (TypedCompositeActor) container;
            boolean test = _fireHierarchicalPetriNetOnce(petriContainer);

View Full Code Here

Examples of ptolemy.kernel.util.Nameable

    public LinkedList findTransitions(TypedCompositeActor container) {
        Iterator components = container.entityList().iterator();
        LinkedList temporaryList = new LinkedList();

        while (components.hasNext()) {
            Nameable component = (Nameable) components.next();

            if (component instanceof Place) {
                // Don't do anything for Place
            } else if (component instanceof PetriNetActor) {
                TypedCompositeActor componentActor = (TypedCompositeActor) component;
View Full Code Here

Examples of ptolemy.kernel.util.Nameable

                    IOPort weightPort = (IOPort) weightPorts.next();

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

                        Nameable weightPlace = weightPort.getContainer();

                        if (weightPlace instanceof PetriNetActor) {
                            if (weightPort.isOutput()) {
                                newRelationList.addAll(weightPort
                                        .insideRelationList());
View Full Code Here

Examples of ptolemy.kernel.util.Nameable

                    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();

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

                        Nameable weightPlace = weightPort.getContainer();

                        if (weightPlace instanceof PetriNetActor) {
                            if (weightPort.isOutput()) {
                                backRelationList.addAll(weightPort
                                        .insideRelationList());
View Full Code Here

Examples of ptolemy.kernel.util.Nameable

            throws IllegalActionException {
        Iterator actors = container.entityList().iterator();
        LinkedList readyComponentList = new LinkedList();

        while (actors.hasNext()) {
            Nameable component = (Nameable) actors.next();

            if (component instanceof PetriNetActor) {
                PetriNetActor petriNetActor = (PetriNetActor) component;

                if (petriNetActor.prefire()) {
View Full Code Here

Examples of ptolemy.kernel.util.Nameable

            if (_debugging) {
                _debug(componentCount + " transitions ready");
            }

            int randomCount = generator.nextInt(componentCount);
            Nameable chosenTransition = (Nameable) components.get(randomCount);

            if (chosenTransition instanceof PetriNetActor) {
                PetriNetActor realPetriNetActor = (PetriNetActor) chosenTransition;
                _fireHierarchicalPetriNetOnce(realPetriNetActor);
            } else if (chosenTransition instanceof TypedCompositeActor) {
View Full Code Here

Examples of ptolemy.kernel.util.Nameable

                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());
View Full Code Here

Examples of ptolemy.kernel.util.Nameable

                IOPort weightPort = (IOPort) weightPorts.next();

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

                    Nameable weightPlace = weightPort.getContainer();

                    if (weightPlace instanceof PetriNetActor) {
                        if (weightPort.isOutput()) {
                            newRelationList.addAll(weightPort
                                    .insideRelationList());
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.