Package eas.math.fundamentalAlgorithms.graphBased.algorithms.type0grammars

Examples of eas.math.fundamentalAlgorithms.graphBased.algorithms.type0grammars.Grammar


        if (dia.getDirectory() == null || dia.getFile() == null) {
            env.getSimTime().timeTerminate();
            System.exit(0);
        }
       
        grammar = new Grammar(new File(dia.getDirectory() + File.separator + dia.getFile()), new Nonterminal(new StringBuffer("S")));
       
        env.addAgent(
                new GrammarAgent(
                        env.getFirstFreeID(),
                        env,
View Full Code Here


       
        return "";
    }

    public Grammar generateType3Grammar() {
        Grammar g = new Grammar(new Nonterminal(new StringBuffer(this.initialState)));

        LinkedList<String> reachableStates = new LinkedList<>(this.getAllReachableStates());
       
        Collections.sort(reachableStates);
       
        for (String fromState : reachableStates) {
            for (Transition targetTransition : this.getTransitionsFrom(fromState)) {
                String toState = targetTransition.getDestination();
                String symbol = targetTransition.getLabel();
               
                g.addRule(new Rule(
                        new Word(new Symbol[] {new Nonterminal(new StringBuffer(fromState))}),
                        new Word(new Symbol[] {
                                new Terminal(new StringBuffer(symbol)),
                                new Nonterminal(new StringBuffer(toState))})));
            }
           
            if (this.finalStates.contains(fromState)) {
                g.addRule(new Rule(
                        new Word(new Symbol[] {new Nonterminal(new StringBuffer(fromState))}),
                        new Word(new Symbol[] {})));
            }
        }
       
View Full Code Here

        super.runBeforeSimulation(umg, params);
        LinkedList<RepresentableAsGraph> list = new LinkedList<RepresentableAsGraph>();
        list.add(new FSM());
        list.add(new PDA());
        list.add(new Turing());
        list.add(new Grammar());
        list.add(new BDD());
        list.add(new Huffman());
        list.add(new PlainDOT());
        list.add(new PatTree());
        list.add(new MARB());
View Full Code Here

TOP

Related Classes of eas.math.fundamentalAlgorithms.graphBased.algorithms.type0grammars.Grammar

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.