Rev | Line | |
---|
[434] | 1 | package de.ugoe.cs.quest.plugin.guitar.commands;
|
---|
[227] | 2 |
|
---|
| 3 | import java.security.InvalidParameterException;
|
---|
| 4 | import java.util.List;
|
---|
| 5 |
|
---|
[434] | 6 | import de.ugoe.cs.quest.plugin.guitar.EFGModelGenerator;
|
---|
[433] | 7 | import de.ugoe.cs.quest.usageprofiles.DeterministicFiniteAutomaton;
|
---|
[227] | 8 | import de.ugoe.cs.util.console.Command;
|
---|
[667] | 9 | import de.ugoe.cs.util.console.GlobalDataContainer;
|
---|
[227] | 10 |
|
---|
| 11 | /**
|
---|
| 12 | * <p>
|
---|
| 13 | * Command to that loads an EFG and creates Deterministic Finite Automaton (DFA)
|
---|
| 14 | * with the same structure.
|
---|
| 15 | * </p>
|
---|
| 16 | *
|
---|
| 17 | * @author Steffen Herbold
|
---|
| 18 | * @version 1.0
|
---|
| 19 | */
|
---|
| 20 | public class CMDefgToDFA implements Command {
|
---|
| 21 |
|
---|
| 22 | /*
|
---|
| 23 | * (non-Javadoc)
|
---|
| 24 | *
|
---|
| 25 | * @see de.ugoe.cs.util.console.Command#run(java.util.List)
|
---|
| 26 | */
|
---|
| 27 | @Override
|
---|
| 28 | public void run(List<Object> parameters) {
|
---|
| 29 | String filename;
|
---|
| 30 | String modelname;
|
---|
| 31 | try {
|
---|
| 32 | filename = (String) parameters.get(0);
|
---|
| 33 | modelname = (String) parameters.get(1);
|
---|
| 34 | } catch (Exception e) {
|
---|
| 35 | throw new InvalidParameterException();
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | EFGModelGenerator modelGenerator = new EFGModelGenerator();
|
---|
| 39 | DeterministicFiniteAutomaton model = modelGenerator
|
---|
| 40 | .efgToDeterministicFiniteAutomaton(filename);
|
---|
| 41 | GlobalDataContainer.getInstance().addData(modelname, model);
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | /*
|
---|
| 45 | * (non-Javadoc)
|
---|
| 46 | *
|
---|
| 47 | * @see de.ugoe.cs.util.console.Command#help()
|
---|
| 48 | */
|
---|
| 49 | @Override
|
---|
[664] | 50 | public String help() {
|
---|
| 51 | return "efgToDFA <filename> <modelname>";
|
---|
[227] | 52 | }
|
---|
| 53 |
|
---|
| 54 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.