Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/EFGModelGenerator.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/EFGModelGenerator.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/EFGModelGenerator.java	(revision 1309)
@@ -0,0 +1,147 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Random;
+
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.plugin.guitar.eventcore.GUITAREventTarget;
+import de.ugoe.cs.autoquest.plugin.guitar.eventcore.GUITAREventType;
+import de.ugoe.cs.autoquest.plugin.guitar.eventcore.GUITARReplayable;
+import de.ugoe.cs.autoquest.usageprofiles.DeterministicFiniteAutomaton;
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
+import edu.umd.cs.guitar.model.GUITARConstants;
+import edu.umd.cs.guitar.model.IO;
+import edu.umd.cs.guitar.model.data.EFG;
+import edu.umd.cs.guitar.model.data.EventGraphType;
+import edu.umd.cs.guitar.model.data.EventType;
+
+/**
+ * <p>
+ * Provides functionality to generates models defined in the package
+ * de.ugoe.cs.autoquest.usageprofiles from EFGs.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class EFGModelGenerator {
+
+	/**
+	 * <p>
+	 * Generates a {@link FirstOrderMarkovModel} from an EFG. In the generated
+	 * model, all following events are equally possible, i.e., the model is
+	 * equal to a {@link DeterministicFiniteAutomaton}. 
+	 * </p>
+	 * 
+	 * @param efgFileName
+	 *            name of the EFG file
+	 * @return model generated from the EFG
+	 */
+	public FirstOrderMarkovModel efgToFirstOrderMarkovModel(String efgFileName) {
+		EFG efg = (EFG) IO.readObjFromFile(efgFileName, EFG.class);
+
+		Collection<List<Event>> subsequences = generateEdgeSequences(efg);
+		FirstOrderMarkovModel model = new FirstOrderMarkovModel(new Random());
+		model.train(subsequences);
+		return model;
+	}
+
+	/**
+	 * <p>
+	 * Generates a {@link DeterministicFiniteAutomaton} from an EFG.
+	 * </p>
+	 * 
+	 * @param efgFileName
+	 *            name of the EFG file
+	 * @return model generated from the EFG
+	 */
+	public DeterministicFiniteAutomaton efgToDeterministicFiniteAutomaton(
+			String efgFileName) {
+		EFG efg = (EFG) IO.readObjFromFile(efgFileName, EFG.class);
+
+		Collection<List<Event>> subsequences = generateEdgeSequences(efg);
+		DeterministicFiniteAutomaton model = new DeterministicFiniteAutomaton(
+				new Random());
+		model.train(subsequences);
+		return model;
+	}
+
+	/**
+	 * <p>
+	 * Extracts the graph structure from the EFG. The result is a set of
+	 * sequences, where each sequence has length two and represents an edge in
+	 * the EFG.
+	 * </p>
+	 * 
+	 * @param efg
+	 *            EFG for which the edge sequence set is generated
+	 * @return edge sequence set
+	 */
+	private Collection<List<Event>> generateEdgeSequences(EFG efg) {
+		List<Event> events = createEvents(efg);
+		/*
+		 * getEventGraph returns an adjacency matrix, i.e., a square matrix of
+		 * efgEvents.size(), where a 1 in row i, column j means an edge
+		 * efgEvents.get(i)->efgEvents.get(j) exists.
+		 */
+		EventGraphType efgGraph = efg.getEventGraph();
+		Collection<List<Event>> subsequences = new LinkedList<List<Event>>();
+
+		int efgSize = events.size();
+		for (int row = 0; row < efgSize; row++) {
+			for (int col = 0; col < efgSize; col++) {
+				int relation = efgGraph.getRow().get(row).getE().get(col);
+				// otherEvent is followed by currentEvent
+				if (relation != GUITARConstants.NO_EDGE) {
+					List<Event> edge = new LinkedList<Event>();
+					edge.add(events.get(row));
+					edge.add(events.get(col));
+					subsequences.add(edge);
+				}
+			}
+		}
+		return subsequences;
+	}
+
+	/**
+	 * <p>
+	 * Extracts creates {@link EFGEvent} for every event contained in the EFG.
+	 * </p>
+	 * 
+	 * @param efg
+	 *            EFG for which the events are created
+	 * @return list of events
+	 */
+	private List<Event> createEvents(EFG efg) {
+		List<EventType> efgEvents = efg.getEvents().getEvent();
+		List<Event> myEvents = new ArrayList<Event>(efgEvents.size());
+		for (EventType event : efgEvents) {
+			/*
+			 * the widgetId and eventId are only hash values, the
+			 * "interpretation" is found in the GUI file.
+			 */
+		    GUITAREventType type = new GUITAREventType(event.getEventId());
+		    GUITAREventTarget target = new GUITAREventTarget(event.getWidgetId());
+		    Event myEvent = new Event(type, target);
+		    myEvent.addReplayable(new GUITARReplayable(event.getEventId()));
+		}
+		return myEvents;
+	}
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/EFGReplayDecorator.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/EFGReplayDecorator.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/EFGReplayDecorator.java	(revision 1309)
@@ -0,0 +1,109 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar;
+
+import de.ugoe.cs.autoquest.IReplayDecorator;
+import de.ugoe.cs.util.StringTools;
+
+/**
+ * <p>
+ * {@link IReplayDecorator} for replays generated for the GUITAR suite.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class EFGReplayDecorator implements IReplayDecorator {
+
+	/**
+	 * <p>
+	 * Id for object serialization.
+	 * </p>
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * <p>
+	 * The instance of the {@link EFGReplayDecorator} (implemented as
+	 * singleton).
+	 * </p>
+	 */
+	transient private static EFGReplayDecorator theInstance;
+
+	/**
+	 * <p>
+	 * Constructor. Private to guarantee that only one instance of the replay
+	 * generator exists.
+	 * </p>
+	 */
+	private EFGReplayDecorator() {
+	};
+
+	/**
+	 * <p>
+	 * Returns the instance of the MFCReplayDecorator.
+	 * </p>
+	 * 
+	 * @return instance of the MFCReplayDecorator.
+	 */
+	public static EFGReplayDecorator getInstance() {
+		if (theInstance == null) {
+			theInstance = new EFGReplayDecorator();
+		}
+		return theInstance;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.IReplayDecorator#getHeader()
+	 */
+	@Override
+	public String getHeader() {
+		return "<?xml version=\"1.0\" encoding=\"UTF-16\"?>"
+				+ StringTools.ENDLINE + "<TestCase>" + StringTools.ENDLINE;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.IReplayDecorator#getFooter()
+	 */
+	@Override
+	public String getFooter() {
+		return "</TestCase>";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.IReplayDecorator#getSessionHeader(int)
+	 */
+	@Override
+	public String getSessionHeader(int sessionId) {
+		return "";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.IReplayDecorator#getSessionFooter(int)
+	 */
+	@Override
+	public String getSessionFooter(int sessionId) {
+		return "";
+	}
+
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/GUITARPlugin.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/GUITARPlugin.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/GUITARPlugin.java	(revision 1309)
@@ -0,0 +1,60 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.plugin.AutoQUESTPlugin;
+
+/**
+ * <p>
+ * Identifier class for the AutoQUEST GUITAR plug-in.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class GUITARPlugin implements AutoQUESTPlugin {
+
+	/**
+	 * <p>
+	 * The command packages of this plug-in.
+	 * </p>
+	 */
+	private final static String[] commandPackages = new String[] { "de.ugoe.cs.autoquest.plugin.guitar.commands" };
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.plugin.AutoQUESTPlugin#getTitle()
+	 */
+	@Override
+	public String getTitle() {
+		return "GUITAR-Plugin";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.plugin.AutoQUESTPlugin#getCommandPackages()
+	 */
+	@Override
+	public List<String> getCommandPackages() {
+		return Collections.unmodifiableList(Arrays.asList(commandPackages));
+	}
+
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/GUITARTestCaseParser.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/GUITARTestCaseParser.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/GUITARTestCaseParser.java	(revision 1309)
@@ -0,0 +1,127 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar;
+
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.plugin.guitar.eventcore.GUITAREventTarget;
+import de.ugoe.cs.autoquest.plugin.guitar.eventcore.GUITAREventType;
+import de.ugoe.cs.autoquest.plugin.guitar.eventcore.GUITARReplayable;
+import edu.umd.cs.guitar.model.IO;
+import edu.umd.cs.guitar.model.data.EFG;
+import edu.umd.cs.guitar.model.data.EventType;
+import edu.umd.cs.guitar.model.data.StepType;
+import edu.umd.cs.guitar.model.data.TestCase;
+
+/**
+ * <p>
+ * Parser for GUITAR test case files.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class GUITARTestCaseParser {
+
+	/**
+	 * <p>
+	 * Name of the EFG file for the application the test cases that are parsed
+	 * are generated for.
+	 * </p>
+	 */
+	private String efgFileName = null;
+
+	/**
+	 * <p>
+	 * Internal handle to the parsed EFG.
+	 * </p>
+	 */
+	private EFG efg = null;
+
+	/**
+	 * <p>
+	 * Constructor. Creates a new GUITARTestCaseParser. No EFG file is
+	 * associated with this parser.
+	 * </p>
+	 */
+	public GUITARTestCaseParser() {
+
+	}
+
+	/**
+	 * <p>
+	 * Constructor. Creates a new GUITARTestCaseParser.
+	 * </p>
+	 * 
+	 * @param efgFileName
+	 *            EFG file associated with the test cases that are parsed.
+	 */
+	public GUITARTestCaseParser(String efgFileName) {
+		this.efgFileName = efgFileName;
+	}
+
+	/**
+	 * <p>
+	 * Parses a GUITAR test case file and returns its contents as an event
+	 * sequence.
+	 * </p>
+	 * 
+	 * @param testcaseFile
+	 *            file that is parsed
+	 * @return event sequence describing the test case
+	 */
+	public List<Event> parseTestCaseFile(File testcaseFile) {
+		TestCase testcase = (TestCase) IO.readObjFromFile(
+				testcaseFile.getAbsolutePath(), TestCase.class);
+		List<StepType> steps = testcase.getStep();
+		List<Event> sequence = new LinkedList<Event>();
+		for (StepType step : steps) {
+			String eventId = step.getEventId();
+			GUITAREventType type = new GUITAREventType(eventId);
+			GUITAREventTarget target = new GUITAREventTarget(getWidgetId(eventId));
+			Event event = new Event(type, target);
+			event.addReplayable(new GUITARReplayable(eventId));
+			sequence.add(event);
+		}
+		return sequence;
+	}
+
+	/**
+	 * <p>
+	 * If {@link #efgFileName} is specified, this function retrieves the
+	 * widgetId of the widget the event with id eventId belongs to from the EFG.
+	 * </p>
+	 * 
+	 * @param eventId
+	 * @return widgetId of the associated widget; null if {@link #efgFileName}
+	 *         ==null or no widgetId for the event is found in the EFG
+	 */
+	private String getWidgetId(String eventId) {
+		if (eventId != null && efgFileName != null) {
+			if (efg == null) {
+				efg = (EFG) IO.readObjFromFile(efgFileName, EFG.class);
+			}
+			for (EventType event : efg.getEvents().getEvent()) {
+				if (eventId.equals(event.getEventId())) {
+					return event.getWidgetId();
+				}
+			}
+		}
+		return null;
+	}
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgTestCasesToSequences.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgTestCasesToSequences.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgTestCasesToSequences.java	(revision 1309)
@@ -0,0 +1,97 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar.commands;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.logging.Level;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.plugin.guitar.GUITARTestCaseParser;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to load a set of sequences from a set of GUITAR test cases.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDefgTestCasesToSequences implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String foldername;
+		String sequencesName;
+		String efgFileName = null;
+		try {
+			foldername = (String) parameters.get(0);
+			sequencesName = (String) parameters.get(1);
+			if (parameters.size() >= 3) {
+				efgFileName = (String) parameters.get(2);
+			}
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		File folder = new File(foldername);
+		
+		File[] testcaseFiles = folder.listFiles( new FilenameFilter() {
+			@Override
+			public boolean accept(File dir, String name) {
+				return name.endsWith(".tst");
+			}
+		});
+		Collection<List<Event>> sequences = new LinkedList<List<Event>>();
+		GUITARTestCaseParser parser;
+		if (efgFileName == null) {
+			parser = new GUITARTestCaseParser();
+		} else {
+			parser = new GUITARTestCaseParser(efgFileName);
+		}
+		for (File testcaseFile : testcaseFiles) {
+			Console.traceln(Level.INFO, "Loading from file "
+					+ testcaseFile.getAbsolutePath());
+			sequences.add(parser.parseTestCaseFile(testcaseFile));
+		}
+		if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) {
+			CommandHelpers.dataOverwritten(sequencesName);
+		}
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "efgTestCasesToSequences <directory> <sequencesName> {<guiFileName>}";
+	}
+
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgToDFA.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgToDFA.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgToDFA.java	(revision 1309)
@@ -0,0 +1,67 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar.commands;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.plugin.guitar.EFGModelGenerator;
+import de.ugoe.cs.autoquest.usageprofiles.DeterministicFiniteAutomaton;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to that loads an EFG and creates Deterministic Finite Automaton (DFA)
+ * with the same structure.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDefgToDFA implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String filename;
+		String modelname;
+		try {
+			filename = (String) parameters.get(0);
+			modelname = (String) parameters.get(1);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		EFGModelGenerator modelGenerator = new EFGModelGenerator();
+		DeterministicFiniteAutomaton model = modelGenerator
+				.efgToDeterministicFiniteAutomaton(filename);
+		GlobalDataContainer.getInstance().addData(modelname, model);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "efgToDFA <filename> <modelname>";
+	}
+
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgToMM.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgToMM.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgToMM.java	(revision 1309)
@@ -0,0 +1,67 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar.commands;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.plugin.guitar.EFGModelGenerator;
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to that loads an EFG and creates a first-order Markov model with the
+ * same structure.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDefgToMM implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String filename;
+		String modelname;
+		try {
+			filename = (String) parameters.get(0);
+			modelname = (String) parameters.get(1);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		EFGModelGenerator modelGenerator = new EFGModelGenerator();
+		FirstOrderMarkovModel model = modelGenerator
+				.efgToFirstOrderMarkovModel(filename);
+		GlobalDataContainer.getInstance().addData(modelname, model);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "efgToMM <filename> <modelname>";
+	}
+
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITAREventTarget.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITAREventTarget.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITAREventTarget.java	(revision 1309)
@@ -0,0 +1,117 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar.eventcore;
+
+import de.ugoe.cs.autoquest.eventcore.IEventTarget;
+
+/**
+ * <p>
+ * Event target for GUITAR events. The targets are described by a widgetId.
+ * </p>
+ * 
+ * @version 1.0
+ * @author Steffen Herbold
+ */
+public class GUITAREventTarget implements IEventTarget {
+
+    /**
+     * <p>
+     * Id for object serialization.
+     * </p>
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * <p>
+     * Id of the widget, which can be looked up in a GUITAR .gui file.
+     * </p>
+     */
+    private String widgetId;
+
+    /**
+     * <p>
+     * Constructor. Creates a new {@link GUITAREventTarget}.
+     * </p>
+     * 
+     * @param widgetId
+     *            widget id of the target
+     */
+    public GUITAREventTarget(String widgetId) {
+        this.widgetId = widgetId;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.autoquest.eventcore.IEventTarget#getPlatform()
+     */
+    @Override
+    public String getPlatform() {
+        return "GUITAR";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.autoquest.eventcore.IEventTarget#getStringIdentifier()
+     */
+    @Override
+    public String getStringIdentifier() {
+        return this.toString();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return widgetId;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof GUITAREventTarget) {
+            if (widgetId != null) {
+                return widgetId.equals(((GUITAREventTarget) obj).widgetId);
+            }
+            else {
+                return ((GUITAREventTarget) obj).widgetId == null;
+            }
+        }
+        return false;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        int hash = 13;
+        if (widgetId != null) {
+            hash = widgetId.hashCode();
+        }
+        return hash;
+    }
+
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITAREventType.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITAREventType.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITAREventType.java	(revision 1309)
@@ -0,0 +1,107 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar.eventcore;
+
+import de.ugoe.cs.autoquest.eventcore.IEventType;
+
+/**
+ * <p>
+ * Event type of GUITAR events. The types are defined by eventIds.
+ * </p>
+ * 
+ * @version 1.0
+ * @author Steffen Herbold
+ */
+public class GUITAREventType implements IEventType {
+
+    /**
+     * <p>
+     * Id for object serialization.
+     * </p>
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * <p>
+     * GUITAR eventId of the event type.
+     * </p>
+     */
+    String guitarEventId;
+
+    /**
+     * <p>
+     * Constructor. Creates a new {@link GUITAREventType}.
+     * </p>
+     * 
+     * @param eventId
+     *            eventId of the event type
+     */
+    public GUITAREventType(String eventId) {
+        this.guitarEventId = eventId;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.autoquest.eventcore.IEventType#getName()
+     */
+    @Override
+    public String getName() {
+        return "GUITAREventType";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return guitarEventId;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof GUITAREventType) {
+            if (guitarEventId != null) {
+                return guitarEventId.equals(((GUITAREventType) obj).guitarEventId);
+            }
+            else {
+                return ((GUITAREventType) obj).guitarEventId == null;
+            }
+        }
+        return false;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        int hash = 37;
+        if (guitarEventId != null) {
+            hash = guitarEventId.hashCode();
+        }
+        return hash;
+    }
+
+}
Index: /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITARReplayable.java
===================================================================
--- /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITARReplayable.java	(revision 1309)
+++ /trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/eventcore/GUITARReplayable.java	(revision 1309)
@@ -0,0 +1,82 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.plugin.guitar.eventcore;
+
+import de.ugoe.cs.autoquest.IReplayDecorator;
+import de.ugoe.cs.autoquest.eventcore.IReplayable;
+import de.ugoe.cs.autoquest.plugin.guitar.EFGReplayDecorator;
+import de.ugoe.cs.util.StringTools;
+
+/**
+ * <p>
+ * {@link IReplayable} used to generate test cases for the GUITAR suite.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class GUITARReplayable implements IReplayable {
+
+    /**
+     * <p>
+     * EventId in the EFG and GUI files.
+     * </p>
+     */
+    String eventId;
+
+    /**
+     * <p>
+     * Id for object serialization.
+     * </p>
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * <p>
+     * Constructor. Creates a new {@link GUITARReplayable}.
+     * </p>
+     * 
+     * @param eventId
+     */
+    public GUITARReplayable(String eventId) {
+        this.eventId = eventId;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.autoquest.eventcore.IReplayable#getReplay()
+     */
+    @Override
+    public String getReplay() {
+        StringBuilder replay = new StringBuilder();
+        replay.append("<Step>" + StringTools.ENDLINE);
+        replay.append("<EventId>" + eventId + "</EventId>" + StringTools.ENDLINE);
+        replay.append("<ReachingStep>false</ReachingStep>" + StringTools.ENDLINE);
+        replay.append("</Step>" + StringTools.ENDLINE);
+        return replay.toString();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.autoquest.eventcore.IReplayable#getDecorator()
+     */
+    @Override
+    public IReplayDecorator getDecorator() {
+        return EFGReplayDecorator.getInstance();
+    }
+
+}
