source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/efg/commands/CMDefgToMM.java @ 303

Last change on this file since 303 was 227, checked in by sherbold, 13 years ago
  • extracted class de.ugoe.cs.eventbench.efg.EFGModelGenerator from de.ugoe.cs.eventbench.efg.commands.CMDefgToMM

+ added command efgToDFA

  • extracted class de.ugoe.cs.eventbench.efg.GUITARTestCaseParser from de.ugoe.cs.eventbench.efg.commands.CMDefgTestCasesToSequences
  • Property svn:mime-type set to text/plain
File size: 1.4 KB
Line 
1package de.ugoe.cs.eventbench.efg.commands;
2
3import java.security.InvalidParameterException;
4import java.util.List;
5
6import de.ugoe.cs.eventbench.data.GlobalDataContainer;
7import de.ugoe.cs.eventbench.efg.EFGModelGenerator;
8import de.ugoe.cs.eventbench.models.FirstOrderMarkovModel;
9import de.ugoe.cs.util.console.Command;
10import de.ugoe.cs.util.console.Console;
11
12/**
13 * <p>
14 * Command to that loads an EFG and creates a first-order Markov model with the
15 * same structure.
16 * </p>
17 *
18 * @author Steffen Herbold
19 * @version 1.0
20 */
21public class CMDefgToMM implements Command {
22
23        /*
24         * (non-Javadoc)
25         *
26         * @see de.ugoe.cs.util.console.Command#run(java.util.List)
27         */
28        @Override
29        public void run(List<Object> parameters) {
30                String filename;
31                String modelname;
32                try {
33                        filename = (String) parameters.get(0);
34                        modelname = (String) parameters.get(1);
35                } catch (Exception e) {
36                        throw new InvalidParameterException();
37                }
38
39                EFGModelGenerator modelGenerator = new EFGModelGenerator();
40                FirstOrderMarkovModel model = modelGenerator
41                                .efgToFirstOrderMarkovModel(filename);
42                GlobalDataContainer.getInstance().addData(modelname, model);
43        }
44
45        /*
46         * (non-Javadoc)
47         *
48         * @see de.ugoe.cs.util.console.Command#help()
49         */
50        @Override
51        public void help() {
52                Console.println("Usage: efgToMM <filename> <modelname>");
53        }
54
55}
Note: See TracBrowser for help on using the repository browser.