Package ptolemy.domains.fsm.kernel.ia

Examples of ptolemy.domains.fsm.kernel.ia.InterfaceAutomaton


        // the two arguments (base and URL) to parse(). Also, a instance
        // of MoMLParser must be used to parse each file, otherwise
        // the same automaton will be returned the second time parse() is
        // called.
        MoMLParser parser = new MoMLParser();
        InterfaceAutomaton automaton = (InterfaceAutomaton) parser.parse(url,
                url);
        automaton.addPorts();

        System.out.println("Deadlock states:");

        Iterator deadlockStates = automaton.deadlockStates().iterator();

        while (deadlockStates.hasNext()) {
            State state = (State) deadlockStates.next();
            System.out.println("    " + state.getFullName());
        }
View Full Code Here


        // the two arguments (base and URL) to parse(). Also, a instance
        // of MoMLParser must be used to parse each file, otherwise
        // the same automaton will be returned the second time parse() is
        // called.
        MoMLParser parser = new MoMLParser();
        InterfaceAutomaton automaton = (InterfaceAutomaton) parser.parse(url,
                url);
        automaton.addPorts();

        automaton.combineInternalTransitions();

        System.out.println(automaton.exportMoML());
    }
View Full Code Here

        URL url = MoMLApplication.specToURL(firstMoML);

        // following the comments in MoMLApplication, use the same URL for
        // the two arguments (base and URL) to parse().
        MoMLParser parser = new MoMLParser();
        InterfaceAutomaton firstAutomaton = (InterfaceAutomaton) parser.parse(
                url, url);
        firstAutomaton.addPorts();

        // Construct the second automaton
        url = MoMLApplication.specToURL(secondMoML);

        // following the comments in MoMLApplication, use the same URL for
        // the two arguments (base and URL) to parse().  Also, a new instance
        // of MoMLParser must be used to parse each file, otherwise
        // the same automaton will be returned the second time parse() is
        // called.
        parser = new MoMLParser();

        InterfaceAutomaton secondAutomaton = (InterfaceAutomaton) parser.parse(
                url, url);
        secondAutomaton.addPorts();

        // Compute the projection and write result
        firstAutomaton.project(secondAutomaton);
        System.out.println(firstAutomaton.exportMoML());
    }
View Full Code Here

            MoMLParser parser = new MoMLParser();
            automata[i] = (InterfaceAutomaton) parser.parse(url, url);
            automata[i].addPorts();
        }

        InterfaceAutomaton composition = automata[0];

        for (int i = 1; i < momls.length; i++) {
            composition = composition.compose(automata[i], considerTransient);
        }

        System.out.println(composition.exportMoML());
    }
View Full Code Here

        URL url = MoMLApplication.specToURL(superMoML);

        // following the comments in MoMLApplication, use the same URL for
        // the two arguments (base and URL) to parse().
        MoMLParser parser = new MoMLParser();
        InterfaceAutomaton superAutomaton = (InterfaceAutomaton) parser.parse(
                url, url);
        superAutomaton.addPorts();

        // Construct the sub automaton
        url = MoMLApplication.specToURL(subMoML);

        // following the comments in MoMLApplication, use the same URL for
        // the two arguments (base and URL) to parse().  Also, a new instance
        // of MoMLParser must be used to parse each file, otherwise
        // the same automaton will be returned the second time parse() is
        // called.
        parser = new MoMLParser();

        InterfaceAutomaton subAutomaton = (InterfaceAutomaton) parser.parse(
                url, url);
        subAutomaton.addPorts();

        // Compute alternating simulation
        Set alternatingSimulation = superAutomaton
                .computeAlternatingSimulation(subAutomaton);

        if (onlyReacheable) {
            alternatingSimulation = InterfaceAutomaton
                    .reacheableAlternatingSimulation(alternatingSimulation,
                            superAutomaton, subAutomaton);
        }

        // Display result
        if (alternatingSimulation.isEmpty()) {
            System.out.println("No alternating simulation between the "
                    + "specified automata.");
        } else {
            System.out.println("Alternating simulation (state_in_"
                    + superAutomaton.getName() + " - state_in_"
                    + subAutomaton.getName() + "):");

            Iterator pairs = alternatingSimulation.iterator();

            while (pairs.hasNext()) {
                StatePair pair = (StatePair) pairs.next();
View Full Code Here

                    Configuration configuration = getConfiguration();
                    Tableau newAutomatonTableau = configuration.openModel(url,
                            url, url.toExternalForm());

                    // compose the two interface automata and show result
                    InterfaceAutomaton model1 = (InterfaceAutomaton) getFrame()
                            .getModel();
                    InterfaceAutomatonGraphFrame graphFrame2 = (InterfaceAutomatonGraphFrame) newAutomatonTableau
                            .getFrame();
                    InterfaceAutomaton model2 = (InterfaceAutomaton) graphFrame2
                            .getModel();

                    InterfaceAutomaton composition = model1.compose(model2);
                    configuration.openModel(composition);
                } catch (Exception ex) {
                    getFrame().report("Error reading input", ex);
                }
            }
View Full Code Here

TOP

Related Classes of ptolemy.domains.fsm.kernel.ia.InterfaceAutomaton

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.