Index: /branches/autoquest-ui-core-alignment/.classpath
===================================================================
--- /branches/autoquest-ui-core-alignment/.classpath	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/.classpath	(revision 1708)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry including="**/*.java" kind="src" path="src/main/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>
Index: /branches/autoquest-ui-core-alignment/.project
===================================================================
--- /branches/autoquest-ui-core-alignment/.project	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/.project	(revision 1708)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>autoquest-ui-core</name>
+	<comment></comment>
+	<projects>
+		<project>Build</project>
+		<project>EventBenchCore</project>
+		<project>JavaHelperLib</project>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>net.sourceforge.metrics.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>net.sourceforge.metrics.nature</nature>
+	</natures>
+</projectDescription>
Index: /branches/autoquest-ui-core-alignment/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /branches/autoquest-ui-core-alignment/.settings/org.eclipse.jdt.core.prefs	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/.settings/org.eclipse.jdt.core.prefs	(revision 1708)
@@ -0,0 +1,12 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.7
Index: /branches/autoquest-ui-core-alignment/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- /branches/autoquest-ui-core-alignment/.settings/org.eclipse.m2e.core.prefs	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/.settings/org.eclipse.m2e.core.prefs	(revision 1708)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Index: /branches/autoquest-ui-core-alignment/pom.xml
===================================================================
--- /branches/autoquest-ui-core-alignment/pom.xml	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/pom.xml	(revision 1708)
@@ -0,0 +1,78 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <groupId>de.ugoe.cs.autoquest</groupId>
+    <artifactId>autoquest</artifactId>
+    <version>0.1.1-SNAPSHOT</version>
+    <relativePath>../autoquest/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>autoquest-ui-core</artifactId>
+  <name>autoquest-ui-core</name>
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+    </license>
+  </licenses>
+  <scm>
+    <url>${autoquest-scm-trunk-dir}/${project.artifactId}</url>
+    <connection>scm:svn:${autoquest-scm-trunk-dir}/${project.artifactId}</connection>
+  </scm>
+  <dependencies>
+    <dependency>
+      <groupId>de.ugoe.cs</groupId>
+      <artifactId>java-utils</artifactId>
+      <version>0.1.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-misc</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-core-events</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-core-usageprofiles</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-core-coverage</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-core-assertions</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-core-testgeneration</artifactId>
+      <version>0.1.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-core-tasktrees</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-core-usability</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>net.sf.jung</groupId>
+      <artifactId>jung-visualization</artifactId>
+      <version>2.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>net.sf.jung</groupId>
+      <artifactId>jung-graph-impl</artifactId>
+      <version>2.0.1</version>
+    </dependency>
+  </dependencies>
+</project>
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDdeleteObject.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDdeleteObject.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDdeleteObject.java	(revision 1708)
@@ -0,0 +1,62 @@
+//   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.commands.misc;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to delete object from {@link GlobalDataContainer}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDdeleteObject implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "deleteObject <objectname>";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String objectName;
+		try {
+			objectName = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+		boolean deleted = GlobalDataContainer.getInstance().removeData(
+				objectName);
+		if (!deleted) {
+			CommandHelpers.objectNotFoundMessage(objectName);
+		}
+	}
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDload.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDload.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDload.java	(revision 1708)
@@ -0,0 +1,74 @@
+//   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.commands.misc;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.util.List;
+
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command that loads a previously serialized {@link GlobalDataContainer}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDload implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String filename;
+		try {
+			filename = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		FileInputStream fis = null;
+		ObjectInputStream in = null;
+		try {
+			fis = new FileInputStream(filename);
+			in = new ObjectInputStream(fis);
+			in.readObject();
+			in.close();
+		} catch (IOException ex) {
+			Console.logException(ex);
+		} catch (ClassNotFoundException ex) {
+			Console.logException(ex);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "load <filename>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDloadObject.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDloadObject.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDloadObject.java	(revision 1708)
@@ -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.commands.misc;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+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 previously serialized object and store it in the
+ * {@link GlobalDataContainer}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDloadObject 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 objectName;
+		try {
+			filename = (String) parameters.get(0);
+			objectName = (String) parameters.get(1);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object data = null;
+		FileInputStream fis = null;
+		ObjectInputStream in = null;
+		try {
+			fis = new FileInputStream(filename);
+			in = new ObjectInputStream(fis);
+			data = in.readObject();
+			in.close();
+		} catch (IOException ex) {
+			Console.logException(ex);
+		} catch (ClassNotFoundException ex) {
+			Console.logException(ex);
+		}
+		if (GlobalDataContainer.getInstance().addData(objectName, data)) {
+			CommandHelpers.dataOverwritten(objectName);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "loadObject <filename> <objectName>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDls.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDls.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDls.java	(revision 1708)
@@ -0,0 +1,76 @@
+//   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.commands.misc;
+
+import java.io.File;
+import java.util.List;
+
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command that lists the content of a directory {@link GlobalDataContainer}.
+ * </p>
+ * 
+ * @author Ralph Krimmel
+ * @version 1.0
+ */
+public class CMDls implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+
+		String path;
+
+		if (parameters.isEmpty()) {
+			path = ".";
+		} else {
+			path = (String) parameters.get(0);
+		}
+
+		File dir = new File(path);
+		if (dir.isDirectory()) {
+			
+			File[] filesList = dir.listFiles();
+			for (File file : filesList) {
+				if (file.isFile()) {
+					Console.println("       " + file.getName());
+				} else {
+					if (file.isDirectory()) {
+						Console.println("(d) " + file.getName());
+					}
+				}
+			}
+		}
+	}
+		
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "ls <directory>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDsave.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDsave.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDsave.java	(revision 1708)
@@ -0,0 +1,72 @@
+//   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.commands.misc;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.List;
+
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to save the {@link GlobalDataContainer} through serialization.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDsave implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String filename;
+		try {
+			filename = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		FileOutputStream fos = null;
+		ObjectOutputStream out = null;
+		try {
+			fos = new FileOutputStream(filename);
+			out = new ObjectOutputStream(fos);
+			out.writeObject(GlobalDataContainer.getInstance());
+			out.close();
+		} catch (IOException ex) {
+			Console.logException(ex);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "save <filename>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDsaveObject.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDsaveObject.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDsaveObject.java	(revision 1708)
@@ -0,0 +1,83 @@
+//   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.commands.misc;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command that saves an object contained in the {@link GlobalDataContainer}
+ * through serialization.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDsaveObject 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 objectName;
+		try {
+			filename = (String) parameters.get(0);
+			objectName = (String) parameters.get(1);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance().getData(
+				objectName);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(objectName);
+			return;
+		}
+
+		FileOutputStream fos = null;
+		ObjectOutputStream out = null;
+		try {
+			fos = new FileOutputStream(filename);
+			out = new ObjectOutputStream(fos);
+			out.writeObject(dataObject);
+			out.close();
+		} catch (IOException ex) {
+			Console.logException(ex);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "saveObject <filename> <objectName>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDshowTimer.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDshowTimer.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDshowTimer.java	(revision 1708)
@@ -0,0 +1,74 @@
+//   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.commands.misc;
+
+import java.util.List;
+import java.util.logging.Level;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to show the time elapsed since a timer has been started.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDshowTimer implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String timerName;
+		try {
+			timerName = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance().getData(timerName);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(timerName);
+			return;
+		}
+		if (!(dataObject instanceof Long)) {
+			CommandHelpers.objectNotType(timerName, "Long");
+			return;
+		}
+
+		long startTime = (Long) dataObject;
+		long currentTime = System.currentTimeMillis();
+		Console.traceln(Level.INFO, "" + (currentTime - startTime) + " milliseconds");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "showTimer <timerName>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstartFileListener.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstartFileListener.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstartFileListener.java	(revision 1708)
@@ -0,0 +1,65 @@
+//   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.commands.misc;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.FileOutputListener;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to start a {@link FileOutputListener}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDstartFileListener implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String filename;
+		try {
+			filename = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		FileOutputListener listener = new FileOutputListener(filename);
+		listener.start();
+		if (GlobalDataContainer.getInstance().addData(filename, listener)) {
+			CommandHelpers.dataOverwritten(filename);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "startFileListener <filename>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstartTimer.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstartTimer.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstartTimer.java	(revision 1708)
@@ -0,0 +1,62 @@
+//   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.commands.misc;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to start a time.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDstartTimer implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String timerName;
+		try {
+			timerName = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+		Long time = System.currentTimeMillis();
+		if (GlobalDataContainer.getInstance().addData(timerName, time)) {
+			CommandHelpers.dataOverwritten(timerName);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "startTimer <timerName>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstopFileListener.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstopFileListener.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/misc/CMDstopFileListener.java	(revision 1708)
@@ -0,0 +1,63 @@
+//   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.commands.misc;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.FileOutputListener;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to stop a {@link FileOutputListener}.
+ * </p>
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDstopFileListener implements Command {
+
+	@Override
+	public void run(List<Object> parameters) {
+		String filename;
+		try {
+			filename = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance().getData(filename);
+		if( dataObject==null ) {
+			CommandHelpers.objectNotFoundMessage(filename);
+			return;
+		}
+		if( !(dataObject instanceof FileOutputListener) ) {
+			CommandHelpers.objectNotType(filename, "FileOutputListener");
+			return;
+		}
+		
+		FileOutputListener listener = (FileOutputListener) dataObject;
+		listener.stop();
+		GlobalDataContainer.getInstance().removeData(filename);
+	}
+
+	@Override
+	public String help() {
+		return "stopFileListener <filename>";
+
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcheckEventTimestamps.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcheckEventTimestamps.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcheckEventTimestamps.java	(revision 1708)
@@ -0,0 +1,217 @@
+//   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.commands.sequences;
+
+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.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to check all sequences of a collection of sequences for correct timestamps and event
+ * order. It supports counting the number of invalid sequences, listing details about invalid
+ * sequences and timestamps, as well as deleting invalid sequences.
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDcheckEventTimestamps implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String command;
+        String sequencesName;
+        String newSequencesName;
+        try {
+            command = (String) parameters.get(0);
+            sequencesName = (String) parameters.get(1);
+            if (parameters.size() > 2) {
+                newSequencesName = (String) parameters.get(2);
+            }
+            else {
+                newSequencesName = sequencesName;
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide a command and a sequences name");
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+        
+        if ("count".equals(command)) {
+            countSequencesWithInvalidTimestamps(sequences);
+        }
+        else if ("list".equals(command)) {
+            listSequencesWithInvalidTimestamps(sequences);
+            Console.println("sequences with timestamp issues listed");
+        }
+        else if ("delete".equals(command)) {
+            deleteSequencesWithInvalidTimestamps(sequences, newSequencesName);
+        }
+    }
+
+    /**
+     * <p>
+     * counts the number of invalid sequences in the provided collections of invalid sequences
+     * </p>
+     *
+     * @param sequences collection of sequences to check for invalid ones
+     */
+    private void countSequencesWithInvalidTimestamps(Collection<List<Event>> sequences) {
+        int sequenceCount = 0;
+        for (List<Event> sequence : sequences) {
+            Event previous = null;
+            
+            for (int i = 0; i < sequence.size(); i++) {
+                Event currentEvent = sequence.get(i);
+                
+                if ((previous != null) && (previous.getTimestamp() > currentEvent.getTimestamp())) {
+                    sequenceCount++;
+                    break;
+                }
+                
+                previous = currentEvent;
+            }
+            
+        }
+        
+        if (sequenceCount == 0) {
+            Console.println("no sequences have issues");
+        }
+        else {
+            Console.traceln(Level.WARNING, sequenceCount + " sequences have timestamp issues");
+        }
+    }
+
+    /**
+     * <p>
+     * lists details about invalid timestamp orders of events in the provided collection of 
+     * sequences
+     * </p>
+     *
+     * @param sequences the collection of sequences to check
+     */
+    private void listSequencesWithInvalidTimestamps(Collection<List<Event>> sequences) {
+        int sequenceCount = 0;
+        for (List<Event> sequence : sequences) {
+            sequenceCount++;
+            Event previous = null;
+            List<String> issues = new LinkedList<String>();
+            
+            for (int i = 0; i < sequence.size(); i++) {
+                Event currentEvent = sequence.get(i);
+                
+                if ((previous != null) && (previous.getTimestamp() > currentEvent.getTimestamp())) {
+                    issues.add(currentEvent + " has an earlier timestamp than the preceeding " +
+                               previous);
+                }
+                
+                previous = currentEvent;
+            }
+            
+            if (issues.size() > 0) {
+                Console.traceln(Level.WARNING, "sequence " + sequenceCount +
+                                " has the following issues:");
+                
+                for (String issue : issues) {
+                    Console.traceln(Level.WARNING, "  " + issue);
+                }
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * deletes sequences with invalid timestamps from the provided collection of sequences and
+     * stores them under new name
+     * </p>
+     *
+     * @param sequences        the collection of sequences to check for invalid sequences
+     * @param newSequencesName the name for the new corrected collection of sequences
+     */
+    private void deleteSequencesWithInvalidTimestamps(Collection<List<Event>> sequences,
+                                                      String                  newSequencesName)
+    {
+        Collection<List<Event>> newSequences = new LinkedList<List<Event>>();
+        for (List<Event> sequence : sequences) {
+            Event previous = null;
+            boolean allFine = true;
+            
+            for (int i = 0; i < sequence.size(); i++) {
+                Event currentEvent = sequence.get(i);
+                
+                if ((previous != null) && (previous.getTimestamp() > currentEvent.getTimestamp())) {
+                    allFine = false;
+                    break;
+                }
+                
+                previous = currentEvent;
+            }
+            
+            if (allFine) {
+                newSequences.add(sequence);
+            }
+        }
+        
+        if (newSequences.size() == sequences.size()) {
+            Console.println("no sequences with issues deleted");
+        }
+        else {
+            Console.traceln(Level.WARNING, (sequences.size() - newSequences.size()) +
+                            " sequences with timestamp issues deleted");
+            
+            if (GlobalDataContainer.getInstance().addData(newSequencesName, newSequences)) {
+                CommandHelpers.dataOverwritten(newSequencesName);
+            }
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "checkEventTimestamps <command> <sequencesName> {<newSequences>}";
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcondenseGuiModel.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcondenseGuiModel.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcondenseGuiModel.java	(revision 1708)
@@ -0,0 +1,72 @@
+//   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.commands.sequences;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to condense the GUI model of a sequence, i.e., merge duplicate nodes.
+ * </p>
+ * 
+ * @version 1.0
+ * @author Steffen Herbold
+ */
+public class CMDcondenseGuiModel implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName = "sequences";
+
+        if (parameters.size() > 0) {
+            sequencesName = (String) parameters.get(0);
+        }
+
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName + "_targets");
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName + "_targets");
+            return;
+        }
+        if (!(dataObject instanceof GUIModel)) {
+            CommandHelpers.objectNotType(sequencesName, "GUIModel");
+            return;
+        }
+
+        GUIModel model = (GUIModel) dataObject;
+
+        model.condenseModel();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "condenseGuiModel {<sequencesName>}";
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcondenseMouseClicks.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcondenseMouseClicks.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcondenseMouseClicks.java	(revision 1708)
@@ -0,0 +1,99 @@
+//   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.commands.sequences;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.gui.MouseClickCondenser;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * This command condenses mouse clicks, i.e. it reduces a sequence of mouse button down,
+ * mouse button up and mouse click with the same button on the same event target to a single
+ * mouse click with that button on that target. The mouse button down and mouse button up events
+ * are discarded.
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDcondenseMouseClicks implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "condenseMouseClicks <sequences> {<new sequences>}";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        String newSequencesName;
+        try {
+            sequencesName = (String) parameters.get(0);
+            if (parameters.size() > 1) {
+                newSequencesName = (String) parameters.get(1);
+            }
+            else {
+                newSequencesName = sequencesName;
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide a sequences name");
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+
+        Collection<List<Event>> newSequences = new LinkedList<List<Event>>();
+        
+        for (List<Event> sequence : sequences) {
+            newSequences.add(new MouseClickCondenser().condenseMouseClicks(sequence));
+        }
+
+        if (GlobalDataContainer.getInstance().addData(newSequencesName, newSequences)) {
+            CommandHelpers.dataOverwritten(newSequencesName);
+        }
+        
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcorrectKeyInteractionTargets.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcorrectKeyInteractionTargets.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcorrectKeyInteractionTargets.java	(revision 1708)
@@ -0,0 +1,100 @@
+//   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.commands.sequences;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyInteractionTargetCorrector;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * This command iterates the provided sequences and sets the target of all key interaction events
+ * to the GUI element having the current keyboard focus. The current keyboard focus is determined
+ * either by keyboard focus events or by using the target of the first key interaction in a
+ * sequence. Events changing the keyboard focus are discarded herewith.
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDcorrectKeyInteractionTargets implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "correctKeyInteractionTargets <sequences> {<new sequences>}";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        String newSequencesName;
+        try {
+            sequencesName = (String) parameters.get(0);
+            if (parameters.size() > 1) {
+                newSequencesName = (String) parameters.get(1);
+            }
+            else {
+                newSequencesName = sequencesName;
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide a sequences name");
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+
+        Collection<List<Event>> newSequences = new LinkedList<List<Event>>();
+        
+        for (List<Event> sequence : sequences) {
+            newSequences.add
+                (new KeyInteractionTargetCorrector().correctKeyInteractionTargets(sequence));
+        }
+
+        if (GlobalDataContainer.getInstance().addData(newSequencesName, newSequences)) {
+            CommandHelpers.dataOverwritten(newSequencesName);
+        }
+        
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcorrectTabKeyNavigationOrder.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcorrectTabKeyNavigationOrder.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDcorrectTabKeyNavigationOrder.java	(revision 1708)
@@ -0,0 +1,180 @@
+//   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.commands.sequences;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.IEventTarget;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyInteraction;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyPressed;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyTyped;
+import de.ugoe.cs.autoquest.eventcore.gui.TextInput;
+import de.ugoe.cs.autoquest.eventcore.guimodel.ITextArea;
+import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField;
+import de.ugoe.cs.autoquest.keyboardmaps.VirtualKey;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * This command iterates the provided sequences and corrects the order of events in case of tab
+ * key navigation. This is required, as from time to time the event of pressing the tab key for
+ * navigation in formulars comes before the text input event in a text input field out of which
+ * the tab key navigates.
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDcorrectTabKeyNavigationOrder implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "correctTabKeyNavigationOrder <sequences> {<new sequences>}";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        String newSequencesName;
+        try {
+            sequencesName = (String) parameters.get(0);
+            if (parameters.size() > 1) {
+                newSequencesName = (String) parameters.get(1);
+            }
+            else {
+                newSequencesName = sequencesName;
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide a sequences name");
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+
+        Collection<List<Event>> newSequences = new LinkedList<List<Event>>();
+        
+        for (List<Event> sequence : sequences) {
+            newSequences.add(correctTabKeyNavigationOrder(sequence));
+        }
+
+        if (GlobalDataContainer.getInstance().addData(newSequencesName, newSequences)) {
+            CommandHelpers.dataOverwritten(newSequencesName);
+        }
+        
+    }
+
+    /**
+     * <p>
+     * convenience method that corrects the order of tab key navigation events, if required
+     * </p>
+     *
+     * @param sequence the sequence, in which the tab key navigation events shall be corrected.
+     * 
+     * @return a new sequence with a corrected order of tab key navigation events
+     */
+    private List<Event> correctTabKeyNavigationOrder(List<Event> sequence) {
+        List<Event> result = new LinkedList<Event>();
+        
+        int index = 0;
+        while (index < sequence.size()) {
+            if (mustCorrectTabKeyNavigationOrder(sequence, index)) {
+                Event event1 = sequence.get(index);
+                Event event2 = sequence.get(index + 1);
+                
+                // switch timestamps
+                long timestamp1 = event1.getTimestamp();
+                event1.setTimestamp(event2.getTimestamp());
+                event2.setTimestamp(timestamp1);
+                
+                // change order of events
+                result.add(event2);
+                result.add(event1);
+                
+                index += 2;
+            }
+            else {
+                result.add(sequence.get(index++));
+            }
+        }
+        
+        return result;
+    }
+
+    /**
+     * <p>
+     * convenience method that checks if at the given position in the sequence is a tab key event
+     * followed by a text input event. If this is the case, both events have the wrong order and
+     * this method returns true. Otherwise it returns false.
+     * </p>
+     *
+     * @param sequence the sequence to check for the occurrence of a correctable tab key navigation
+     * @param index    the index in the sequence to check
+     * 
+     * @return as described
+     */
+    private boolean mustCorrectTabKeyNavigationOrder(List<Event> sequence, int index) {
+        boolean result = false;
+        
+        Event event1 = sequence.get(index);
+        
+        if ((index < (sequence.size() - 1)) &&
+            ((event1.getType() instanceof KeyPressed) || (event1.getType() instanceof KeyTyped)))
+        {
+            VirtualKey key = ((KeyInteraction) event1.getType()).getKey();
+            if (key == VirtualKey.TAB) {
+                IEventTarget target1 = event1.getTarget();
+                Event event2 = sequence.get(index + 1);
+                
+                if (((target1 instanceof ITextArea) || (target1 instanceof ITextField)) &&
+                    (target1.equals(event2.getTarget())) &&
+                    (event2.getType() instanceof TextInput))
+                {
+                    result = true;
+                }
+            }
+        }
+        
+        return result;
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDdetectTextInputEvents.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDdetectTextInputEvents.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDdetectTextInputEvents.java	(revision 1708)
@@ -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.commands.sequences;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyPressed;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyReleased;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyTyped;
+import de.ugoe.cs.autoquest.eventcore.gui.TextInput;
+import de.ugoe.cs.autoquest.eventcore.gui.TextInputDetector;
+import de.ugoe.cs.autoquest.eventcore.gui.TextInput.TextEquality;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command that converts {@link KeyPressed}, {@link KeyReleased}, and {@link KeyTyped} sequences
+ * into {@link TextInput} events if possible.
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDdetectTextInputEvents implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "detectTextInputEvents <sequences> {<new sequences>} {<textEqualityType>}";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        String newSequencesName;
+        String textEqualityTypeString = "LEXICAL";
+        try {
+            sequencesName = (String) parameters.get(0);
+            if (parameters.size() > 1) {
+                newSequencesName = (String) parameters.get(1);
+            }
+            else {
+                newSequencesName = sequencesName;
+            }
+            if (parameters.size() > 2) {
+                textEqualityTypeString = (String) parameters.get(2);
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide a sequences name");
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        TextEquality textEqualityType = null;
+        try {
+            textEqualityType = TextEquality.valueOf(textEqualityTypeString);
+        }
+        catch (IllegalArgumentException e) {
+            Console
+                .printerrln("Invalid mode. Only LEXICAL, SYNTACTICAL, and SEMANTICAL are allowed values!");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+
+        Collection<List<Event>> newSequences = new LinkedList<List<Event>>();
+
+        for (List<Event> sequence : sequences) {
+            newSequences.add(new TextInputDetector(textEqualityType).detectTextInputs(sequence));
+        }
+
+        if (GlobalDataContainer.getInstance().addData(newSequencesName, newSequences)) {
+            CommandHelpers.dataOverwritten(newSequencesName);
+        }
+
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDgenerateReplayfile.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDgenerateReplayfile.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDgenerateReplayfile.java	(revision 1708)
@@ -0,0 +1,214 @@
+//   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.commands.sequences;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.IReplayDecorator;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.IReplayable;
+import de.ugoe.cs.util.StringTools;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to create a replay file from stored sessions.
+ * </p>
+ * 
+ * TODO: Add appropriate checks if Events are replayable
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDgenerateReplayfile implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "generateReplayfile <filename> <sequences>";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String filename;
+        String sequencesName;
+        try {
+            filename = (String) parameters.get(0);
+            sequencesName = (String) parameters.get(1);
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException();
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+        createLogfileMultipleSessions(sequences, filename);
+    }
+
+    /**
+     * <p>
+     * {@link IReplayDecorator} to be used. If this field is {@code null}, no decorator is used.
+     * Default: {@code null}
+     * </p>
+     */
+    private IReplayDecorator decorator = null;
+
+    /**
+     * <p>
+     * Id of the current session. The starting id is 1.
+     * </p>
+     */
+    int sessionId = 1;
+
+    /**
+     * <p>
+     * Creates a replay file that contains multiple event sequences.
+     * </p>
+     * 
+     * @param sequences
+     *            collection of event sequences from which the sessions are generated
+     * @param filename
+     *            name and path of the replay file
+     */
+    private void createLogfileMultipleSessions(Collection<List<Event>> sequences, String filename) {
+        OutputStreamWriter writer = openReplayFile(filename);
+        if (writer != null) {
+            try {
+                try {
+                    decorator =
+                        sequences.iterator().next().get(0).getReplayables().get(0).getDecorator();
+                }
+                catch (Exception e) {
+                    // in the above line, many things can go wrong: emtpy sequences, null
+                    // references, etc. However, all failures just indicate that no replay decorator
+                    // should be used, hence, we ignore the exception
+                    Console.traceln(Level.FINEST, "no decorator used for " + filename);
+                }
+                if (decorator != null) {
+                    writer.write(decorator.getHeader());
+                }
+                for (List<Event> actions : sequences) {
+                    writeSession(actions, writer);
+                }
+                if (decorator != null) {
+                    writer.write(decorator.getFooter());
+                }
+                decorator = null;
+                writer.close();
+            }
+            catch (IOException e) {
+                Console.printerrln("Unable to write replay file " + filename);
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * Helper function that opens the replay file for writing.
+     * </p>
+     * 
+     * @param filename
+     *            name and path of the replay file
+     * @param encoding
+     *            file encoding, empty string for platform default
+     * @return {@link OutputStreamWriter} that writes to the replay file
+     */
+    private OutputStreamWriter openReplayFile(String filename) {
+        File file = new File(filename);
+        boolean fileCreated;
+        try {
+            fileCreated = file.createNewFile();
+            if (!fileCreated) {
+                Console.traceln(Level.INFO, "Created logfile " + filename);
+            }
+            else {
+                Console.traceln(Level.INFO, "Overwrote existing logfile " + filename);
+            }
+        }
+        catch (IOException e) {
+            Console.printerrln("Unable to create file " + filename);
+            Console.logException(e);
+        }
+        OutputStreamWriter writer = null;
+        try {
+            writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-16");
+        }
+        catch (IOException e) {
+            Console.printerrln("Unable to open file for writing (read-only file):" + filename);
+            Console.logException(e);
+        }
+        return writer;
+    }
+
+    /**
+     * <p>
+     * Helper function that adds an event sequence to the replay.
+     * </p>
+     * 
+     * @param actions
+     *            event sequences to be added
+     * @param writer
+     *            {@link OutputStreamWriter} to which the replay is added
+     * @throws IOException
+     *             thrown if there is a problem writing to writer
+     */
+    private void writeSession(List<Event> actions, OutputStreamWriter writer) throws IOException {
+        if (decorator != null) {
+            writer.write(decorator.getSessionHeader(sessionId));
+        }
+        for (Event currentAction : actions) {
+
+            List<? extends IReplayable> replayables = currentAction.getReplayables();
+            for (IReplayable replayble : replayables) {
+                writer.write(replayble.getReplay() + StringTools.ENDLINE);
+                writer.flush();
+            }
+        }
+        if (decorator != null) {
+            writer.write(decorator.getSessionFooter(sessionId));
+        }
+        sessionId++;
+    }
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDmergeSequences.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDmergeSequences.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDmergeSequences.java	(revision 1708)
@@ -0,0 +1,132 @@
+//   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.commands.sequences;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to merge all sequences of a collection of sequences into one long sequence depending on
+ * the timestamps of the events
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDmergeSequences implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        String newSequencesName;
+        try {
+            sequencesName = (String) parameters.get(0);
+            if (parameters.size() > 1) {
+                newSequencesName = (String) parameters.get(1);
+            }
+            else {
+                newSequencesName = sequencesName;
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide a sequences name");
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+        
+        List<Event> resultingSequence = new LinkedList<Event>();
+        long first = 0;
+        long last = 0;
+        
+        Console.println("merging " + sequences.size() + " sequences");
+        for (List<Event> sequence : sequences) {
+            for (Event event : sequence) {
+                if (event.getTimestamp() < 0) {
+                    Console.printerrln("at least one of the events does not have a correct " +
+                                       "timestamp required for the merging of sequences and " +
+                                       "sorting of events");
+                }
+                
+                if (resultingSequence.isEmpty()) {
+                    resultingSequence.add(event);
+                    first = event.getTimestamp();
+                    last = event.getTimestamp();
+                }
+                else if (event.getTimestamp() < first) {
+                    resultingSequence.add(0, event);
+                    first = event.getTimestamp();
+                }
+                else if (event.getTimestamp() > last) {
+                    resultingSequence.add(event);
+                    last = event.getTimestamp();
+                }
+                else {
+                    for (int i = 0; i < resultingSequence.size(); i++) {
+                        if (event.getTimestamp() <= resultingSequence.get(i).getTimestamp()) {
+                            resultingSequence.add(i, event);
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+        
+        Collection<List<Event>> newSequences = new LinkedList<List<Event>>();
+        newSequences.add(resultingSequence);
+        
+        if (GlobalDataContainer.getInstance().addData(newSequencesName, newSequences)) {
+            CommandHelpers.dataOverwritten(newSequencesName);
+        }
+        
+        Console.println("sequences merged");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "mergeSequences <sequencesName> {<new sequences>}";
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDremoveScrolls.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDremoveScrolls.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDremoveScrolls.java	(revision 1708)
@@ -0,0 +1,85 @@
+//   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.commands.sequences;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.gui.Scroll;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to remove all scroll events form a sequence.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDremoveScrolls implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "removeScrolls <sequences>";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        try {
+            sequencesName = (String) parameters.get(0);
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException();
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+        for (List<Event> sequence : sequences) {
+            for (Iterator<Event> eventIter = sequence.iterator(); eventIter.hasNext();) {
+                Event event = eventIter.next();
+                if (event.getType() instanceof Scroll) {
+                    eventIter.remove();
+                }
+            }
+        }
+    }
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDremoveStartEndSymbols.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDremoveStartEndSymbols.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDremoveStartEndSymbols.java	(revision 1708)
@@ -0,0 +1,88 @@
+//   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.commands.sequences;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to remove the {@link Event#STARTEVENT} and {@link Event#ENDEVENT} from a sequence.
+ * </p>
+ * 
+ * @version 1.0
+ * @author Steffen Herbold
+ */
+public class CMDremoveStartEndSymbols implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        try {
+            sequencesName = (String) parameters.get(0);
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException();
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+
+        for (List<Event> sequence : sequences) {
+            Iterator<Event> iter = sequence.iterator();
+            while (iter.hasNext()) {
+                Event event = iter.next();
+                if (Event.ENDEVENT.equals(event) || Event.STARTEVENT.equals(event)) {
+                    iter.remove();
+                }
+            }
+        }
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "removeStartEndSymbols <sequences>";
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsequenceStatistics.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsequenceStatistics.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsequenceStatistics.java	(revision 1708)
@@ -0,0 +1,118 @@
+//   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.commands.sequences;
+
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to print basic statistical information about stored sequences, e.g., how many there are
+ * of which length.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDsequenceStatistics implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        try {
+            sequencesName = (String) parameters.get(0);
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException();
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+        Console.println("Number of Sequences: " + sequences.size());
+
+        long smallestTimeStamp = Long.MAX_VALUE;
+        long largestTimeStamp = 0;
+        int noOfEvents = 0;
+
+        SortedMap<Integer, Integer> lengthMap = new TreeMap<Integer, Integer>();
+        for (List<Event> sequence : sequences) {
+            Integer currentSize = sequence.size();
+            noOfEvents += currentSize;
+            
+            if (lengthMap.containsKey(currentSize)) {
+                lengthMap.put(currentSize, lengthMap.get(currentSize) + 1);
+            }
+            else {
+                lengthMap.put(currentSize, 1);
+            }
+            
+            for (Event event : sequence) {
+                if (event.getTimestamp() > 0) {
+                    smallestTimeStamp = Math.min(smallestTimeStamp, event.getTimestamp());
+                    largestTimeStamp = Math.max(largestTimeStamp, event.getTimestamp());
+                }
+            }
+        }
+
+        Console.println("Number of Events: " + noOfEvents);
+        Console.println("First Event Recorded At: " +
+                        SimpleDateFormat.getDateTimeInstance().format(new Date(smallestTimeStamp)));
+        Console.println("Last Event Recorded At: " +
+                        SimpleDateFormat.getDateTimeInstance().format(new Date(largestTimeStamp)));
+        
+        for (Entry<Integer, Integer> entry : lengthMap.entrySet()) {
+            Console.println("Sequences of Length " + entry.getKey() + ": " + entry.getValue());
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "sequenceStatistics <sequencesName>";
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsortKeyInteractions.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsortKeyInteractions.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsortKeyInteractions.java	(revision 1708)
@@ -0,0 +1,134 @@
+//   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.commands.sequences;
+
+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.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyInteractionCorrector;
+import de.ugoe.cs.autoquest.eventcore.gui.KeyInteractionCorrector.CleanupMode;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to sort the key interactions in a sequence of events. An example, the sequence to write
+ * the upper case D
+ * <ul>
+ * <li>press shift key</li>
+ * <li>press D key</li>
+ * <li>release shift key</li>
+ * <li>release D key</li>
+ * </ul>
+ * 
+ * is transformed to the sequence
+ * 
+ * <ul>
+ * <li>press shift key</li>
+ * <li>press D key</li>
+ * <li>release D key</li>
+ * <li>release shift key</li>
+ * </ul>
+ * 
+ * in which the first pressed key (shift in this case) is always released last. The same is done for
+ * the alt and the ctrl keys.
+ * 
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDsortKeyInteractions implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "sortKeyInteractions <sequences> {<new sequences>}";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        String newSequencesName;
+        String modeString = "ADDITION";
+        try {
+            sequencesName = (String) parameters.get(0);
+            if (parameters.size() > 1) {
+                newSequencesName = (String) parameters.get(1);
+            }
+            else {
+                newSequencesName = sequencesName;
+            }
+            if (parameters.size() > 2) {
+                modeString = (String) parameters.get(2);
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide a sequences name");
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        CleanupMode mode = null;
+        try {
+            mode = CleanupMode.valueOf(modeString);
+        }
+        catch (IllegalArgumentException e) {
+            Console.printerrln("Invalid mode. Only REMOVAL and ADDITION are allowed values!");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+
+        Collection<List<Event>> newSequences = new LinkedList<List<Event>>();
+
+        int i = 1;
+        for (List<Event> sequence : sequences) {
+            Console.traceln(Level.INFO, "Processing sequence " + i++);
+            newSequences.add(new KeyInteractionCorrector(mode).sortKeyInteractions(sequence));
+        }
+
+        if (GlobalDataContainer.getInstance().addData(newSequencesName, newSequences)) {
+            CommandHelpers.dataOverwritten(newSequencesName);
+        }
+
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsplitSequences.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsplitSequences.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/sequences/CMDsplitSequences.java	(revision 1708)
@@ -0,0 +1,124 @@
+//   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.commands.sequences;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to split all sequences of a collection of sequences into subsequences depending on
+ * the timestamps of the events. If the difference of the timestamps of two subsequent events is
+ * larger than the provided number of milliseconds, the sequence to which the events belong is
+ * split up into two subsequences between the two events. 
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDsplitSequences implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void run(List<Object> parameters) {
+        long diff;
+        String sequencesName;
+        String newSequencesName;
+        try {
+            diff = Long.parseLong((String) parameters.get(0));
+            sequencesName = (String) parameters.get(1);
+            if (parameters.size() > 2) {
+                newSequencesName = (String) parameters.get(2);
+            }
+            else {
+                newSequencesName = sequencesName;
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide an integer for the maximum " +
+                                               "timestamp difference and a sequences name");
+        }
+
+        Collection<List<Event>> sequences = null;
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+        
+        Collection<List<Event>> newSequences = new LinkedList<List<Event>>();
+        
+        Console.println("splitting " + sequences.size() + " sequences");
+        for (List<Event> sequence : sequences) {
+            Event previous = null;
+            List<Event> resultingSequence = new LinkedList<Event>();
+            for (Event currentEvent : sequence) {
+                if (currentEvent.getTimestamp() < 0) {
+                    Console.printerrln("at least one of the events does not have a correct " +
+                                       "timestamp required for the merging of sequences and " +
+                                       "sorting of events");
+                }
+                
+                if ((previous != null) &&
+                    (Math.abs(previous.getTimestamp() - currentEvent.getTimestamp()) > diff))
+                {
+                    newSequences.add(resultingSequence);
+                    resultingSequence = new LinkedList<Event>();
+                }
+                
+                resultingSequence.add(currentEvent);
+                previous = currentEvent;
+            }
+            
+            newSequences.add(resultingSequence);
+        }
+        
+        if (GlobalDataContainer.getInstance().addData(newSequencesName, newSequences)) {
+            CommandHelpers.dataOverwritten(newSequencesName);
+        }
+        
+        Console.println("sequences splitted");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "splitSequences <maximumTimestampDifference> <sequencesName> {<newSequences>}";
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usability/CMDevaluateUsability.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usability/CMDevaluateUsability.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usability/CMDevaluateUsability.java	(revision 1708)
@@ -0,0 +1,91 @@
+//   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.commands.usability;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
+import de.ugoe.cs.autoquest.usability.UsabilityEvaluationManager;
+import de.ugoe.cs.autoquest.usability.UsabilityEvaluationResult;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * This command performs a usability evaluation based on a task tree. It uses the
+ * {@link UsabilityEvaluationManager} for this purpose. Please consult the documentation of the
+ * usability evaluation manager for more details.
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDevaluateUsability implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "evaluateUsability <tasktree> {<evaluationResult>}";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @Override
+    public void run(List<Object> parameters) {
+        String tasktreeName;
+        String evaluationResult;
+        try {
+            tasktreeName = (String) parameters.get(0);
+            if (parameters.size() > 1) {
+                evaluationResult = (String) parameters.get(1);
+            }
+            else {
+                evaluationResult = "usabilityEvaluationResult";
+            }
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("must provide a task tree name");
+        }
+
+        Object dataObject = GlobalDataContainer.getInstance().getData(tasktreeName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(tasktreeName);
+            return;
+        }
+        if (!(dataObject instanceof ITaskModel)) {
+            CommandHelpers.objectNotType(tasktreeName, "ITaskTree");
+            return;
+        }
+
+        ITaskModel taskTree = (ITaskModel) dataObject;
+        
+        UsabilityEvaluationResult result =
+            new UsabilityEvaluationManager().evaluateUsability(taskTree);
+        
+        if (GlobalDataContainer.getInstance().addData(evaluationResult, result)) {
+            CommandHelpers.dataOverwritten(evaluationResult);
+        }
+        
+    }
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usability/CMDgenerateTaskTree.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usability/CMDgenerateTaskTree.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usability/CMDgenerateTaskTree.java	(revision 1708)
@@ -0,0 +1,114 @@
+//   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.commands.usability;
+
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.tasktrees.manager.TaskTreeManager;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * This command generates a task tree based on the provided sequences. It uses
+ * the {@link TaskTreeManager} for this purpose. Please consult the
+ * documentation of the task tree manager for more details.
+ * </p>
+ * 
+ * @author Patrick Harms
+ * @version 1.0
+ */
+public class CMDgenerateTaskTree implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "generateTaskTree <sequences> {<tasktree>} {<boolean: harmonize sequences or not (true or false)>} {<integer: number of threads>}";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public void run(List<Object> parameters) {
+		String sequencesName;
+		String tasktreeName;
+		try {
+			sequencesName = (String) parameters.get(0);
+			if (parameters.size() > 1) {
+				tasktreeName = (String) parameters.get(1);
+			} else {
+				tasktreeName = "tasktree";
+			}
+		} catch (Exception e) {
+			throw new IllegalArgumentException("must provide a sequences name");
+		}
+		if (parameters.size() > 2) {
+			String harmonize = (String) parameters.get(2);
+			de.ugoe.cs.autoquest.tasktrees.temporalrelation.SequenceForTaskDetectionRuleAlignment.harmonizeSequences = true;
+			System.out.println(harmonize);
+			if (harmonize.equals("false")) {
+				System.out.println("Not harmonizing");
+				de.ugoe.cs.autoquest.tasktrees.temporalrelation.SequenceForTaskDetectionRuleAlignment.harmonizeSequences = false;
+			}
+		}
+		if (parameters.size() > 3) {
+			String threadCount = (String) parameters.get(3);
+			de.ugoe.cs.autoquest.tasktrees.temporalrelation.SequenceForTaskDetectionRuleAlignment.nThreads = 1;
+			try {
+				int tmp = Integer.parseInt(threadCount);
+				de.ugoe.cs.autoquest.tasktrees.temporalrelation.SequenceForTaskDetectionRuleAlignment.nThreads = tmp;
+			} catch (Exception e) {
+				throw new IllegalArgumentException(
+						"The fourth parameter must be an integer. Did you forget to name the tasktree?");
+			}
+		}
+
+		Collection<List<Event>> sequences = null;
+		Object dataObject = GlobalDataContainer.getInstance().getData(
+				sequencesName);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(sequencesName);
+			return;
+		}
+		if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+			CommandHelpers.objectNotType(sequencesName,
+					"Collection<List<Event<?>>>");
+			return;
+		}
+
+		sequences = (Collection<List<Event>>) dataObject;
+
+		ITaskModel taskModel = new TaskTreeManager().createTaskModel(sequences);
+
+		if (GlobalDataContainer.getInstance().addData(tasktreeName, taskModel)) {
+			CommandHelpers.dataOverwritten(sequencesName);
+		}
+
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/AbstractTrainCommand.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/AbstractTrainCommand.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/AbstractTrainCommand.java	(revision 1708)
@@ -0,0 +1,106 @@
+//   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.commands.usage;
+
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.usageprofiles.TrieBasedModel;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Abstract class for commands to train {@link TrieBasedModel}s.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public abstract class AbstractTrainCommand implements Command {
+
+	/**
+	 * <p>
+	 * Handling of additional parameters.
+	 * </p>
+	 * 
+	 * @param parameters
+	 *            same as the parameters passed to {@link #run(List)}.
+	 * @throws Exception
+	 *             thrown, if there is an error parsing the parameters
+	 */
+	abstract void handleAdditionalParameters(List<Object> parameters)
+			throws Exception;
+
+	/**
+	 * <p>
+	 * Returns a concrete instance of {@link TrieBasedModel} to be trained. This
+	 * is a factory method.
+	 * </p>
+	 * 
+	 * @return instance of {@link TrieBasedModel}
+	 */
+	abstract TrieBasedModel createModel();
+
+	/**
+	 * <p>
+	 * The command is implemented as a template method. The general structure of
+	 * the command is always the same, only the parameters of the command and
+	 * the creation of the {@link TrieBasedModel} instance. The former is
+	 * handled by {@link #handleAdditionalParameters(List)}, the latter by
+	 * {@link #createModel()}.
+	 * </p>
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		String sequencesName;
+
+		try {
+			modelname = (String) parameters.get(0);
+			sequencesName = (String) parameters.get(1);
+			handleAdditionalParameters(parameters);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance().getData(
+				sequencesName);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(sequencesName);
+			return;
+		}
+		if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+			CommandHelpers.objectNotType(sequencesName,
+					"Collection<List<Event<?>>>");
+			return;
+		}
+		Collection<List<Event>> sequences = (Collection<List<Event>>) dataObject;
+
+		TrieBasedModel model = createModel();
+		model.train(sequences);
+		if (GlobalDataContainer.getInstance().addData(modelname, model)) {
+			CommandHelpers.dataOverwritten(modelname);
+		}
+
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDcalcCoverage.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDcalcCoverage.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDcalcCoverage.java	(revision 1708)
@@ -0,0 +1,154 @@
+//   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.commands.usage;
+
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.coverage.CoverageCalculatorObserved;
+import de.ugoe.cs.autoquest.coverage.CoverageCalculatorProcess;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to calculate the coverage of a test suite.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDcalcCoverage implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		String observedName;
+		String[] sequenceNames;
+		int minLength;
+		int maxLength;
+		try {
+			modelname = (String) parameters.get(0);
+			observedName = (String) parameters.get(1);
+			sequenceNames = (String[]) parameters.get(2);
+			minLength = Integer.parseInt((String) parameters.get(3));
+			maxLength = Integer.parseInt((String) parameters.get(4));
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		IStochasticProcess process = null;
+		Collection<List<Event>> observedSequences = null;
+		Collection<List<Event>> sequences = null;
+		Object dataObjectProcess = GlobalDataContainer.getInstance().getData(
+				modelname);
+		Object dataObjectObserved = GlobalDataContainer.getInstance().getData(
+				observedName);
+		if (dataObjectProcess == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObjectProcess instanceof IStochasticProcess)) {
+			CommandHelpers.objectNotType(modelname, "IStochasticProcess");
+			return;
+		}
+		if (dataObjectObserved == null) {
+			CommandHelpers.objectNotFoundMessage(observedName);
+			return;
+		}
+		if (!SequenceInstanceOf.isCollectionOfSequences(dataObjectObserved)) {
+			CommandHelpers.objectNotType(observedName,
+					"Collection<List<Event<?>>>");
+			return;
+		}
+		process = (IStochasticProcess) dataObjectProcess;
+		observedSequences = (Collection<List<Event>>) dataObjectObserved;
+
+		Console.print("seqName");
+		for (int length = minLength; length <= maxLength; length++) {
+			Console.print(";numObs_" + length);
+			Console.print(";numCov_" + length);
+			Console.print(";numNew_" + length);
+			Console.print(";numPos_" + length);
+			Console.print(";all_" + length);
+			Console.print(";pos_" + length);
+			Console.print(";poswei_" + length);
+			Console.print(";obs_" + length);
+			Console.print(";obswei_" + length);
+			Console.print(";new_" + length);
+			Console.print(";newpos_" + length);
+			Console.print(";newposwei_" + length);
+		}
+		Console.println("");
+		for (String sequenceName : sequenceNames) {
+			Object dataObjectSequences = GlobalDataContainer.getInstance()
+					.getData(sequenceName);
+			if (dataObjectSequences == null) {
+				CommandHelpers.objectNotFoundMessage(sequenceName);
+				return;
+			} else if (!SequenceInstanceOf
+					.isCollectionOfSequences(dataObjectSequences)) {
+				CommandHelpers.objectNotType(sequenceName,
+						"Collection<List<Event<?>>>");
+				return;
+			}
+			sequences = (Collection<List<Event>>) dataObjectSequences;
+			Console.print(sequenceName);
+			for (int length = minLength; length <= maxLength; length++) {
+				CoverageCalculatorProcess covCalcProc = new CoverageCalculatorProcess(
+						process, sequences, length);
+				CoverageCalculatorObserved covCalcObs = new CoverageCalculatorObserved(
+						observedSequences, sequences, length);
+				Console.print(";" + covCalcObs.getNumObserved());
+				Console.print(";" + covCalcObs.getNumCovered());
+				Console.print(";" + covCalcObs.getNumNew());
+				Console.print(";" + covCalcProc.getNumPossible());
+				Console.print(";" + covCalcProc.getCoverageAllNoWeight());
+				Console.print(";" + covCalcProc.getCoveragePossibleNoWeight());
+				Console.print(";" + covCalcProc.getCoveragePossibleWeight());
+				Console.print(";" + covCalcObs.getCoverageObserved());
+				Console.print(";"
+						+ covCalcObs.getCoverageObservedWeigth(process));
+				Console.print(";" + covCalcObs.getNewPercentage());
+				Console.print(";" + covCalcObs.getCoveragePossibleNew(process));
+				Console.print(";"
+						+ covCalcObs.getCoveragePossibleNewWeight(process));
+			}
+			Console.println("");
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "calcCoverage <modelname> <observedSequences> [<sequenceNames>] <minCovLength> <maxCovLength>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDcalcEntropy.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDcalcEntropy.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDcalcEntropy.java	(revision 1708)
@@ -0,0 +1,77 @@
+//   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.commands.usage;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to calculate the entropy of first-order Markov models.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDcalcEntropy implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "calcEntropy <modelname>";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname = "";
+		try {
+			modelname = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		FirstOrderMarkovModel model = null;
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof FirstOrderMarkovModel)) {
+			CommandHelpers.objectNotType(modelname, "FirstOrderMarkovModel");
+			return;
+		}
+		model = (FirstOrderMarkovModel) dataObject;
+		double entropy = model.calcEntropy();
+		if (!Double.isNaN(entropy)) {
+			Console.println("entropy: " + entropy);
+		}
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDflattenModel.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDflattenModel.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDflattenModel.java	(revision 1708)
@@ -0,0 +1,84 @@
+//   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.commands.usage;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.autoquest.usageprofiles.HighOrderMarkovModel;
+import de.ugoe.cs.autoquest.usageprofiles.ModelFlattener;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to flatten high-order models and create first-order markov models
+ * with the same stochastic properties.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDflattenModel implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		String modelnameFOM;
+
+		try {
+			modelname = (String) parameters.get(0);
+			modelnameFOM = (String) parameters.get(1);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof HighOrderMarkovModel)) {
+			CommandHelpers.objectNotType(modelname, "HighOrderMarkovModel");
+			return;
+		}
+
+		HighOrderMarkovModel model = (HighOrderMarkovModel) dataObject;
+		ModelFlattener flattener = new ModelFlattener();
+		FirstOrderMarkovModel modelFOM = flattener
+				.flattenHighOrderMarkovModel(model);
+
+		if (GlobalDataContainer.getInstance().addData(modelnameFOM, modelFOM)) {
+			CommandHelpers.dataOverwritten(modelnameFOM);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "flattenModel <modelname> <modelname_flattened>";
+	}
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateFixedLengthSequences.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateFixedLengthSequences.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateFixedLengthSequences.java	(revision 1708)
@@ -0,0 +1,102 @@
+//   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.commands.usage;
+
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.testgeneration.DrawFromAllSequencesGenerator;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to generate all sequences of a given length.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDgenerateFixedLengthSequences implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		String sequencesName;
+		int minLength;
+		int maxLength;
+		boolean all = true;
+		int numSequences = -1;
+		boolean validEnd = true;
+		try {
+			modelname = (String) parameters.get(0);
+			sequencesName = (String) parameters.get(1);
+			minLength = Integer.parseInt((String) parameters.get(2));
+			maxLength = Integer.parseInt((String) parameters.get(3));
+			if (parameters.size() >= 5) {
+				all = Boolean.parseBoolean((String) parameters.get(4));
+			}
+			if (parameters.size() >= 6) {
+				numSequences = Integer.parseInt((String) parameters.get(5));
+			}
+			if (parameters.size() >= 7) {
+				validEnd = Boolean.parseBoolean((String) parameters.get(6));
+			}
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		IStochasticProcess model = null;
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		} else if (!(dataObject instanceof IStochasticProcess)) {
+			CommandHelpers.objectNotType(modelname, "IStochasticProcess");
+			return;
+		}
+		model = (IStochasticProcess) dataObject;
+		DrawFromAllSequencesGenerator generator = new DrawFromAllSequencesGenerator(
+				numSequences, minLength, maxLength, validEnd, all);
+		Collection<List<Event>> sequences = generator
+				.generateTestSuite(model);
+
+		if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) {
+			CommandHelpers.dataOverwritten(sequencesName);
+		}
+		Console.println("" + sequences.size() + " sequences generated");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "generateFixedLengthSequences <modelname> <sequencesName> <minlenght> <maxlength> {<all>} {<numSequences>} {<validEnd>}";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateGreedy.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateGreedy.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateGreedy.java	(revision 1708)
@@ -0,0 +1,193 @@
+//   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.commands.usage;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.coverage.SequenceTools;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.util.ArrayTools;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to generate test suite with a greedy strategy to achieve a desired
+ * coverage.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDgenerateGreedy implements Command {
+
+	/**
+	 * <p>
+	 * Tolerance for double comparisons
+	 * </p>
+	 */
+	final static double eps = 0.000000000001;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		String sequencesName;
+		int minLength;
+		int maxLength;
+		int coverageDepth;
+		float desiredCoverage;
+		boolean validEnd = true;
+		try {
+			modelname = (String) parameters.get(0);
+			sequencesName = (String) parameters.get(1);
+			minLength = Integer.parseInt((String) parameters.get(2));
+			maxLength = Integer.parseInt((String) parameters.get(3));
+			coverageDepth = Integer.parseInt((String) parameters.get(4));
+			desiredCoverage = Float.parseFloat((String) parameters.get(5));
+			if (parameters.size() >= 7) {
+				validEnd = Boolean.parseBoolean((String) parameters.get(6));
+			}
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		IStochasticProcess model = null;
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		} else if (!(dataObject instanceof IStochasticProcess)) {
+			CommandHelpers.objectNotType(modelname, "IStochasticProcess");
+			return;
+		}
+		model = (IStochasticProcess) dataObject;
+
+		// set up everything
+		List<List<Event>> allSequences = new LinkedList<List<Event>>();
+		for (int length = minLength; length <= maxLength; length++) {
+			if (validEnd) {
+				allSequences.addAll(model.generateValidSequences(length + 2));
+			} else {
+				allSequences.addAll(model.generateSequences(length + 1, true));
+			}
+		}
+		Console.traceln(Level.INFO, "" + allSequences.size() + " possible");
+
+		Collection<List<Event>> allSubSeqs = model
+				.generateSequences(coverageDepth);
+		Map<List<Event>, Double> weightMap = SequenceTools
+				.generateWeights(model, allSubSeqs);
+		Set<List<Event>> coveredSubSeqs = new LinkedHashSet<List<Event>>();
+
+		List<Set<List<Event>>> containedSubSeqs = new LinkedList<Set<List<Event>>>();
+		for (List<Event> sequence : allSequences) {
+			List<List<Event>> wrapper = new LinkedList<List<Event>>();
+			wrapper.add(sequence);
+			Set<List<Event>> currentSubSeqs = SequenceTools
+					.containedSubSequences(wrapper, coverageDepth);
+			containedSubSeqs.add(currentSubSeqs);
+		}
+
+		List<List<Event>> testSuite = new LinkedList<List<Event>>();
+		double currentCoverage = 0.0d;
+
+		// Build test suite
+		double prevGain = 1.0d;
+		boolean gainEqual = false;
+		while (currentCoverage < desiredCoverage) {
+			Double[] sequenceGain = new Double[allSequences.size()];
+			int i = 0;
+			for (Set<List<Event>> containedSubSeq : containedSubSeqs) {
+				double gain = 0.0d;
+				Iterator<List<Event>> subSeqIter = containedSubSeq
+						.iterator();
+				while (subSeqIter.hasNext()) {
+					List<Event> subSeq = subSeqIter.next();
+					if (!coveredSubSeqs.contains(subSeq)) {
+						gain += weightMap.get(subSeq);
+					} else {
+						subSeqIter.remove();
+					}
+				}
+				sequenceGain[i] = gain;
+				// optimization using that the gain is monotonically decreasing
+				if (Math.abs(gain - prevGain) <= eps) {
+					gainEqual = true;
+					break;
+				}
+				i++;
+			}
+			int maxIndex;
+			if (gainEqual) {
+				maxIndex = i;
+			} else {
+				maxIndex = ArrayTools.findMax(sequenceGain);
+			}
+			if (maxIndex < 0 || sequenceGain[maxIndex] <= 0.0 + eps) {
+				Console.traceln(Level.WARNING, "No gain anymore! Desired coverage cannot be satisfied!");
+				break;
+			}
+			prevGain = sequenceGain[maxIndex];
+			testSuite.add(allSequences.get(maxIndex));
+			coveredSubSeqs.addAll(containedSubSeqs.get(maxIndex));
+			currentCoverage += sequenceGain[maxIndex];
+			if (gainEqual) {
+				allSequences.remove(maxIndex);
+				containedSubSeqs.remove(maxIndex);
+				gainEqual = false;
+			} else {
+				for (int j = sequenceGain.length - 1; j >= 0; j--) {
+					if (j == maxIndex || sequenceGain[j] <= 0.0 + eps) {
+						allSequences.remove(j);
+						containedSubSeqs.remove(j);
+					}
+				}
+			}
+		}
+
+		if (GlobalDataContainer.getInstance().addData(sequencesName, testSuite)) {
+			CommandHelpers.dataOverwritten(sequencesName);
+		}
+		Console.println("" + testSuite.size() + " sequences generated");
+		Console.println("" + currentCoverage + " coverage achieved");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "generateGreedy <modelname> <sequencesName> <minLength> <maxLength> <coverageDepth> <desiredCoverage> {<validEnd>}";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateHybrid.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateHybrid.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateHybrid.java	(revision 1708)
@@ -0,0 +1,111 @@
+//   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.commands.usage;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.testgeneration.HybridGenerator;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to generate sequences of a given length.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDgenerateHybrid implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		String sequencesName;
+		int length;
+		int maxLengthAll;
+		int numSequences;
+		boolean validEnd = true;
+		try {
+			modelname = (String) parameters.get(0);
+			sequencesName = (String) parameters.get(1);
+			length = Integer.parseInt((String) parameters.get(2));
+			maxLengthAll = Integer.parseInt((String) parameters.get(3));
+			numSequences = Integer.parseInt((String) parameters.get(4));
+			if (parameters.size() >= 6) {
+				validEnd = Boolean.parseBoolean((String) parameters.get(5));
+			}
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		if (length <= maxLengthAll) {
+			// indirectly call command generateFixedLengthSequences
+			List<Object> parameters2 = new LinkedList<Object>();
+			parameters2.add(modelname);
+			parameters2.add(sequencesName);
+			parameters2.add(Integer.toString(length));
+			parameters2.add(Integer.toString(length));
+			parameters2.add(Boolean.toString(false));
+			parameters2.add(Integer.toString(numSequences));
+			parameters2.add(Boolean.toString(validEnd));
+			CMDgenerateFixedLengthSequences cmd = new CMDgenerateFixedLengthSequences();
+			cmd.run(parameters2);
+			return;
+		}
+
+		IStochasticProcess model = null;
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		} else if (!(dataObject instanceof IStochasticProcess)) {
+			CommandHelpers.objectNotType(modelname, "IStochasticProcess");
+			return;
+		}
+		model = (IStochasticProcess) dataObject;
+		
+		HybridGenerator generator = new HybridGenerator(numSequences, length, maxLengthAll, validEnd);
+		Collection<List<Event>> sequences = generator.generateTestSuite(model);
+		
+		if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) {
+			CommandHelpers.dataOverwritten(sequencesName);
+		}
+		Console.println("" + sequences.size() + " sequences generated");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "generateHybrid <modelname> <sequencesName> <lenght> <maxlengthAll> <numSequences> {<validEnd>}";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateRandomSequences.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateRandomSequences.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDgenerateRandomSequences.java	(revision 1708)
@@ -0,0 +1,108 @@
+//   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.commands.usage;
+
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.testgeneration.RandomWalkGenerator;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to generate random sessions.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDgenerateRandomSequences implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		String sequencesName;
+		int numSessions;
+		int minLength = 0;
+		int maxLength = Integer.MAX_VALUE;
+		long maxIter;
+		boolean validEnd = true;
+		try {
+			modelname = (String) parameters.get(0);
+			sequencesName = (String) parameters.get(1);
+			numSessions = Integer.parseInt((String) parameters.get(2));
+			minLength = Integer.parseInt((String) parameters.get(3));
+			maxLength = Integer.parseInt((String) parameters.get(4));
+			maxIter = numSessions * 10;
+			if (parameters.size() >= 5) {
+				maxIter = Long.parseLong((String) parameters.get(5));
+			}
+			if (parameters.size() >= 6) {
+				validEnd = Boolean.parseBoolean((String) parameters.get(6));
+			}
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		IStochasticProcess model = null;
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof IStochasticProcess)) {
+			CommandHelpers.objectNotType(modelname, "IStochasticProcess");
+			return;
+		}
+		model = (IStochasticProcess) dataObject;
+
+		RandomWalkGenerator generator = new RandomWalkGenerator(numSessions,
+				minLength, maxLength, validEnd, maxIter);
+		Collection<List<Event>> sequences = generator
+				.generateTestSuite(model);
+
+		if (sequences.size() < numSessions) {
+			Console.println("Only " + sequences.size()
+					+ " unique sessions generated after " + maxIter
+					+ " iterations");
+		}
+
+		if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) {
+			CommandHelpers.dataOverwritten(sequencesName);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "generateRandomSequenecs <modelname> <sequencesName> <numSequences> <minlength> <maxlength> {<maxIter>} {<validEnd>}";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDlistSymbols.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDlistSymbols.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDlistSymbols.java	(revision 1708)
@@ -0,0 +1,86 @@
+//   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.commands.usage;
+
+import java.util.Arrays;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to list all events (symbols) known to a usage profile (stochastic
+ * process).
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDlistSymbols implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname = "";
+		boolean sort = false;
+		try {
+			modelname = (String) parameters.get(0);
+			if (parameters.size() == 2) {
+				sort = Boolean.parseBoolean((String) parameters.get(1));
+			}
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		IStochasticProcess model = null;
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof IStochasticProcess)) {
+			CommandHelpers.objectNotType(modelname, "IStochasticProcess");
+			return;
+		}
+		model = (IStochasticProcess) dataObject;
+		String[] stateStrings = model.getSymbolStrings();
+		if (sort) {
+			Arrays.sort(stateStrings);
+		}
+		for (String stateString : stateStrings) {
+			Console.println(stateString);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "listSymbols <modelname> {<sort>}";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDmodelSize.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDmodelSize.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDmodelSize.java	(revision 1708)
@@ -0,0 +1,76 @@
+//   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.commands.usage;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command that prints the size of a stochastic process to the console.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDmodelSize implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		try {
+			modelname = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof IStochasticProcess)) {
+			CommandHelpers.objectNotType(modelname, "IStochasticProcess");
+			return;
+		}
+
+		IStochasticProcess process = (IStochasticProcess) dataObject;
+		Console.println("#symbols: " + process.getNumSymbols()
+				+ " ; #FOMstates " + process.getNumFOMStates()
+				+ " ; #transitions: " + process.getNumTransitions());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "modelSize <modelname>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDprintDot.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDprintDot.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDprintDot.java	(revision 1708)
@@ -0,0 +1,76 @@
+//   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.commands.usage;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.usageprofiles.IDotCompatible;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command that prints a dot representation of a model (if supported) to the
+ * console.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDprintDot implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "printDot <modelname>";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname = "";
+		try {
+			modelname = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		IDotCompatible model = null;
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof IDotCompatible)) {
+			CommandHelpers.objectNotType(modelname, "IDotCompatible");
+			return;
+		}
+
+		model = (IDotCompatible) dataObject;
+		Console.println(model.getDotRepresentation());
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDprintTrieDot.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDprintTrieDot.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDprintTrieDot.java	(revision 1708)
@@ -0,0 +1,77 @@
+//   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.commands.usage;
+
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.usageprofiles.Trie;
+import de.ugoe.cs.autoquest.usageprofiles.TrieBasedModel;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command that prints the {@link Trie} of a {@link TrieBasedModel} as dot to
+ * the console.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDprintTrieDot implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "printTreeDot <modelname>";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname = "";
+		try {
+			modelname = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		TrieBasedModel model = null;
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof TrieBasedModel)) {
+			CommandHelpers.objectNotType(modelname, "TrieBasedModel");
+			return;
+		}
+
+		model = (TrieBasedModel) dataObject;
+		Console.println(model.getTrieDotRepresentation());
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDshowMarkovModel.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDshowMarkovModel.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDshowMarkovModel.java	(revision 1708)
@@ -0,0 +1,126 @@
+//   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.commands.usage;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.util.List;
+
+import javax.swing.JFrame;
+
+import org.apache.commons.collections15.Transformer;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel.MarkovEdge;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+import edu.uci.ics.jung.algorithms.layout.ISOMLayout;
+import edu.uci.ics.jung.algorithms.layout.Layout;
+import edu.uci.ics.jung.graph.Graph;
+import edu.uci.ics.jung.visualization.BasicVisualizationServer;
+import edu.uci.ics.jung.visualization.decorators.ToStringLabeller;
+import edu.uci.ics.jung.visualization.renderers.Renderer.VertexLabel.Position;
+
+/**
+ * <p>
+ * Command that visualizes first-order Markov models.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDshowMarkovModel implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "showMarkovModel <modelname> {<showNodeNames>}";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		boolean showNodeNames = false;
+		try {
+			modelname = (String) parameters.get(0);
+			if (parameters.size() == 2) {
+				showNodeNames = Boolean
+						.parseBoolean((String) parameters.get(1));
+			}
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof FirstOrderMarkovModel)) {
+			CommandHelpers.objectNotType(modelname, "FirstOrderMarkovModel");
+			return;
+		}
+		FirstOrderMarkovModel mm = (FirstOrderMarkovModel) dataObject;
+
+		Graph<String, MarkovEdge> graph = mm.getGraph();
+		Layout<String, MarkovEdge> layout = new ISOMLayout<String, MarkovEdge>(
+				graph);
+		layout.setSize(new Dimension(1000, 800)); // sets the initial size
+													// of the space
+		// The BasicVisualizationServer<V,E> is parameterized by the edge
+		// types
+		BasicVisualizationServer<String, MarkovEdge> vv = new BasicVisualizationServer<String, MarkovEdge>(
+				layout);
+		vv.setPreferredSize(new Dimension(1100, 850)); // Sets the viewing
+														// area size
+
+		if (showNodeNames) {
+			final Rectangle rect = new Rectangle(240, 20);
+
+			Transformer<String, Shape> vertexShapeTransformer = new Transformer<String, Shape>() {
+				public Shape transform(String s) {
+					return rect;
+				}
+			};
+			vv.getRenderer().getVertexLabelRenderer()
+					.setPosition(Position.CNTR);
+			vv.getRenderContext().setVertexShapeTransformer(
+					vertexShapeTransformer);
+			vv.getRenderContext().setVertexLabelTransformer(
+					new ToStringLabeller<String>());
+		}
+
+		vv.getRenderContext().setEdgeLabelTransformer(
+				new ToStringLabeller<MarkovEdge>());
+
+		JFrame frame = new JFrame("Markov Model");
+		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+		frame.getContentPane().add(vv);
+		frame.pack();
+		frame.setVisible(true);
+	}
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDshowTrie.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDshowTrie.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDshowTrie.java	(revision 1708)
@@ -0,0 +1,113 @@
+//   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.commands.usage;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.util.List;
+
+import javax.swing.JFrame;
+
+import org.apache.commons.collections15.Transformer;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.usageprofiles.Trie;
+import de.ugoe.cs.autoquest.usageprofiles.TrieBasedModel;
+import de.ugoe.cs.autoquest.usageprofiles.Trie.Edge;
+import de.ugoe.cs.autoquest.usageprofiles.Trie.TrieVertex;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+import edu.uci.ics.jung.algorithms.layout.Layout;
+import edu.uci.ics.jung.algorithms.layout.TreeLayout;
+import edu.uci.ics.jung.graph.Tree;
+import edu.uci.ics.jung.visualization.BasicVisualizationServer;
+import edu.uci.ics.jung.visualization.decorators.ToStringLabeller;
+import edu.uci.ics.jung.visualization.renderers.Renderer.VertexLabel.Position;
+
+/**
+ * <p>
+ * Command that visualizes the {@link Trie} of a {@link TrieBasedModel}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDshowTrie implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "showTrie <modelname>";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		try {
+			modelname = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance()
+				.getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof TrieBasedModel)) {
+			CommandHelpers.objectNotType(modelname, "TrieBasedModel");
+		}
+		TrieBasedModel model = (TrieBasedModel) dataObject;
+		Tree<TrieVertex, Edge> graph = model.getTrieGraph();
+		Layout<TrieVertex, Edge> layout = new TreeLayout<TrieVertex, Edge>(
+				graph, 60);
+		// The BasicVisualizationServer<V,E> is parameterized by the edge
+		// types
+		BasicVisualizationServer<TrieVertex, Edge> vv = new BasicVisualizationServer<TrieVertex, Edge>(
+				layout);
+		vv.setPreferredSize(new Dimension(1100, 850)); // Sets the viewing
+														// area size
+
+		final Rectangle rect = new Rectangle(40, 20);
+
+		Transformer<TrieVertex, Shape> vertexShapeTransformer = new Transformer<TrieVertex, Shape>() {
+			public Shape transform(TrieVertex s) {
+				return rect;
+			}
+		};
+		vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);
+		vv.getRenderContext().setVertexShapeTransformer(vertexShapeTransformer);
+		vv.getRenderContext().setVertexLabelTransformer(
+				new ToStringLabeller<TrieVertex>());
+
+		JFrame frame = new JFrame("Trie");
+		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+		frame.getContentPane().add(vv);
+		frame.pack();
+		frame.setVisible(true);
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainDFA.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainDFA.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainDFA.java	(revision 1708)
@@ -0,0 +1,65 @@
+//   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.commands.usage;
+
+import java.util.List;
+import java.util.Random;
+
+import de.ugoe.cs.autoquest.usageprofiles.DeterministicFiniteAutomaton;
+import de.ugoe.cs.autoquest.usageprofiles.TrieBasedModel;
+
+/**
+ * <p>
+ * Command to train a Deterministic Finite Automaton (DFA).
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 2.0
+ */
+public class CMDtrainDFA extends AbstractTrainCommand {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "trainDFA <modelname> <sequencesName>";
+	}
+
+	/**
+	 * <p>
+	 * No additional parameters.
+	 * </p>
+	 * 
+	 * @see de.ugoe.cs.autoquest.commands.usage.AbstractTrainCommand#handleAdditionalParameters(java.util.List)
+	 */
+	@Override
+	void handleAdditionalParameters(List<Object> parameters) throws Exception {
+		// no additional parameters.
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.ui.commands.AbstractTrainCommand#createModel()
+	 */
+	@Override
+	TrieBasedModel createModel() {
+		return new DeterministicFiniteAutomaton(new Random());
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainMarkovModel.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainMarkovModel.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainMarkovModel.java	(revision 1708)
@@ -0,0 +1,81 @@
+//   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.commands.usage;
+
+import java.util.List;
+import java.util.Random;
+
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.autoquest.usageprofiles.HighOrderMarkovModel;
+import de.ugoe.cs.autoquest.usageprofiles.TrieBasedModel;
+
+/**
+ * <p>
+ * Command to train first-order and high-order Markov models.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 2.0
+ */
+public class CMDtrainMarkovModel extends AbstractTrainCommand {
+
+	/**
+	 * <p>
+	 * Order of the Markov model.
+	 * </p>
+	 */
+	int order;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "trainMarkovModel <modelname> <sequencesName> {<order>}";
+	}
+
+	/**
+	 * <p>
+	 * Handles the parameter order.
+	 * </p>
+	 * 
+	 * @see de.ugoe.cs.autoquest.commands.usage.AbstractTrainCommand#handleOptionalParameters(java.util.List)
+	 */
+	@Override
+	void handleAdditionalParameters(List<Object> parameters) throws Exception {
+		if (parameters.size() >= 3) {
+			order = Integer.parseInt((String) parameters.get(2));
+		} else {
+			order = 1;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.ui.commands.AbstractTrainCommand#createModel()
+	 */
+	@Override
+	TrieBasedModel createModel() {
+		if (order == 1) {
+			return new FirstOrderMarkovModel(new Random());
+		} else {
+			return new HighOrderMarkovModel(order, new Random());
+		}
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainPPM.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainPPM.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDtrainPPM.java	(revision 1708)
@@ -0,0 +1,91 @@
+//   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.commands.usage;
+
+import java.util.List;
+import java.util.Random;
+
+import de.ugoe.cs.autoquest.usageprofiles.PredictionByPartialMatch;
+import de.ugoe.cs.autoquest.usageprofiles.TrieBasedModel;
+
+/**
+ * <p>
+ * Command that trains Prediction by Partial Match (PPM) models.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 2.0
+ */
+public class CMDtrainPPM extends AbstractTrainCommand {
+
+	/**
+	 * <p>
+	 * Escape probability of the PPM model.
+	 * </p>
+	 */
+	double probEscape;
+
+	/**
+	 * <p>
+	 * Maximal Markov order of the PPM model.
+	 * </p>
+	 */
+	int maxOrder;
+
+	/**
+	 * <p>
+	 * Minimal Markov order of the PPM model. Default: 0
+	 * </p>
+	 */
+	int minOrder = 0;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "trainPPM <modelname> <sequencesName> <probEscape> <maxOrder> {<minOrder>}";
+	}
+
+	/**
+	 * <p>
+	 * Handles the parameters probEscape, maxOrder, and minOrder.
+	 * </p>
+	 * 
+	 * @see de.ugoe.cs.autoquest.commands.usage.AbstractTrainCommand#handleOptionalParameters(java.util.List)
+	 */
+	@Override
+	void handleAdditionalParameters(List<Object> parameters) throws Exception {
+		probEscape = Double.parseDouble((String) parameters.get(2));
+		maxOrder = Integer.parseInt((String) parameters.get(3));
+		if (parameters.size() == 5) {
+			minOrder = Integer.parseInt((String) parameters.get(4));
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.autoquest.ui.commands.AbstractTrainCommand#createModel()
+	 */
+	@Override
+	TrieBasedModel createModel() {
+		return new PredictionByPartialMatch(maxOrder, minOrder, new Random(),
+				probEscape);
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDupdateModel.java
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDupdateModel.java	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/java/de/ugoe/cs/autoquest/commands/usage/CMDupdateModel.java	(revision 1708)
@@ -0,0 +1,92 @@
+//   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.commands.usage;
+
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.usageprofiles.TrieBasedModel;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to update a {@link TrieBasedModel}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDupdateModel implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public void run(List<Object> parameters) {
+		String modelname;
+		String sequencesName;
+
+		try {
+			modelname = (String) parameters.get(0);
+			sequencesName = (String) parameters.get(1);
+		} catch (Exception e) {
+			throw new IllegalArgumentException();
+		}
+
+		Object dataObject = GlobalDataContainer.getInstance().getData(
+				sequencesName);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(sequencesName);
+			return;
+		}
+		if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+			CommandHelpers.objectNotType(sequencesName,
+					"Collection<List<Event<?>>>");
+			return;
+		}
+		Collection<List<Event>> sequences = (Collection<List<Event>>) dataObject;
+
+		dataObject = GlobalDataContainer.getInstance().getData(modelname);
+		if (dataObject == null) {
+			CommandHelpers.objectNotFoundMessage(modelname);
+			return;
+		}
+		if (!(dataObject instanceof TrieBasedModel)) {
+			CommandHelpers.objectNotType(modelname, "TrieBasedModel");
+			return;
+		}
+
+		TrieBasedModel model = (TrieBasedModel) dataObject;
+		model.update(sequences);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#help()
+	 */
+	@Override
+	public String help() {
+		return "updateModel <modelname> <sequencesName>";
+	}
+
+}
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/calcCoverage
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/calcCoverage	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/calcCoverage	(revision 1708)
@@ -0,0 +1,26 @@
+Calculates various event coverage values for a test suite and prints them as a tables of the following form to the console. The coverage values are calculate in relation to both a collection of sequences and a usage profile. 
+
+The coverages for a given depth d are:
+ * numObs: number of d-tuples that are observed in the related sequences
+ * numCov: number of covered d-tuples by the test suite
+ * numNew: number of d-tuples that are part of the test suite but not observed in the related sequences
+ * numPos: number of possible d-tuples
+ * all: coverage in relation to a all d-tuples, regardless whether they are possible according to the usage profile or not
+ * pos: coverage in relation to the d-tuples possible according to the usage profile
+ * poswei: coverage in relation to the d-tuples possible according to the usage profile, weighted by the probability of the d-tuples ("usage-based coverage")
+ * obs: coverage in relation to the d-tuples that are observed in the related sequences
+ * obswei: coverage in relation to the d-tuples that are observed in the related sequences, weighted by the probability according to the usage profile
+ * new: coverage in relation to the number of possible new sequences, i.e., sequences that are possible according to the usage profile or not but not part of the related sequences
+ * newpos: coverage in relation to the number of possible new sequences, i.e., sequences that are possible according to the usage profile but not part of the related sequences
+ * newposwei: same as above, but weighted by the probability according to the usage profile
+
+$USAGE$
+<modelName> name of the usage profile in relation to which the coverages will be calculated
+<observedSequences> name of the related sequences
+[<sequenceNames>] array of sequences for which the coverage will be calculated
+<minCovLength> minimal coverage depth to be used
+<maxCovLength> maximal coverage depth to be used
+
+Example(s):
+calcCoverage markovModel trainingSequences [generatedSequences] 2 2
+calcCoverage markovModel trainingSequences [generatedSequences1 generatedSequences2] 2 4
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/calcEntropy
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/calcEntropy	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/calcEntropy	(revision 1708)
@@ -0,0 +1,7 @@
+Calculates the Shannon entropy of a usage profile. The command only supports first-order Markov models and fails for all other usage profile types.
+
+$USAGE$
+<modelname> name of the first-order Markov model
+
+Example(s):
+calcEntropy firstOrderMarkovModel
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/checkEventTimestamps
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/checkEventTimestamps	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/checkEventTimestamps	(revision 1708)
@@ -0,0 +1,11 @@
+checks all sequences of a collection of sequences for correct timestamps and event order. It supports counting the number of invalid sequences, listing details about invalid sequences and timestamps, as well as deleting invalid sequences.
+
+$USAGE$
+<command> one of "count", "list", and "delete"
+<sequencesName> the name of the collection of sequences that shall be checked
+<newSequences> optional; the name of the collection of sequences into which the resulting sequences shall be stored in case the delete command is selected; if left out, the result is stored in the collection identified by <sequencesName>
+
+Example(s):
+checkEventTimestamps count someSequences
+checkEventTimestamps list someSequences
+checkEventTimestamps delete someSequences someNewSequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/condenseGuiModel
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/condenseGuiModel	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/condenseGuiModel	(revision 1708)
@@ -0,0 +1,8 @@
+Merges equal nodes in a GUI model. It is highly recommended to call this command after sequences have been parsed.
+
+$USAGE$
+<sequencesName> optional; the name of the sequences, of which the related GUI model is condensed; default: sequences
+
+Example(s):
+condenseGuiModel
+condenseGuiModel someSequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/condenseMouseClicks
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/condenseMouseClicks	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/condenseMouseClicks	(revision 1708)
@@ -0,0 +1,9 @@
+condenses mouse clicks, i.e. it reduces a sequence of mouse button down, mouse button up and mouse click with the same button on the same event target to a single mouse click with that button on that target. The mouse button down and mouse button up events are discarded.
+
+$USAGE$
+<sequences> the name of the collection of sequences, of which the mouse clicks shall be condensed
+<new sequences> optional; the name of the collection of sequences into which the resulting sequences shall be stored; if left out, the result is stored in the collection identified by <sequences>
+
+Example(s):
+condenseMouseClicks someSequences
+condenseMouseClicks someSequences someNewSequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/correctKeyInteractionTargets
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/correctKeyInteractionTargets	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/correctKeyInteractionTargets	(revision 1708)
@@ -0,0 +1,9 @@
+iterates the provided sequences and sets the target of all key interaction events to the GUI element having the current keyboard focus. The current keyboard focus is determined either by keyboard focus events or by using the target of the first key interaction in a sequence. Events changing the keyboard focus are discarded herewith.
+
+$USAGE$
+<sequences> the name of the collection of sequences, of which the key interaction targets shall be corrected
+<new sequences> optional; the name of the collection of sequences into which the resulting sequences shall be stored; if left out, the result is stored in the collection identified by <sequences>
+
+Example(s):
+correctKeyInteractionTargets someSequences
+correctKeyInteractionTargets someSequences someNewSequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/correctTabKeyNavigationOrder
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/correctTabKeyNavigationOrder	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/correctTabKeyNavigationOrder	(revision 1708)
@@ -0,0 +1,9 @@
+iterates the provided sequences and corrects the order of events in case of tab key navigation. This is required, as from time to time the event of pressing the tab key for navigation in formulars comes before the text input event in a text input field out of which the tab key navigates.
+
+$USAGE$
+<sequences> the name of the collection of sequences, of which the tab key navigation events shall be ordered correctly
+<new sequences> optional; the name of the collection of sequences into which the resulting sequences shall be stored; if left out, the result is stored in the collection identified by <sequences>
+
+Example(s):
+correctTabKeyNavigationOrder someSequences
+correctTabKeyNavigationOrder someSequences someNewSequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/deleteObject
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/deleteObject	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/deleteObject	(revision 1708)
@@ -0,0 +1,8 @@
+Deletes an object, e.g., a selection of sequences, from the global data storage.
+
+$USAGE$
+<objectname> name of the object to be deleted
+
+Example(s):
+deleteObject sequences
+deleteObject markovModel
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/flattenModel
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/flattenModel	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/flattenModel	(revision 1708)
@@ -0,0 +1,10 @@
+Takes a high-order Markov model as input and creates an equivalent first-order Markov model through state splitting.
+
+Note: command probably broken because of the refactoring of the event core!
+
+$USAGE$
+<modelname> name of the high-order Markov model
+<modelname_flattened> name of the equivalent first-order Markov model that is created
+
+Example(s):
+flattenModel 5thOrderMarkovModel 5thOrderMarkovModel_flattend
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateFixedLengthSequences
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateFixedLengthSequences	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateFixedLengthSequences	(revision 1708)
@@ -0,0 +1,17 @@
+Generates sequences of a fixed length from a usage profile. This command first generates all sequences of the desired lengths and then draws from them according to the probability each sequence has in the usage profile.
+
+Generating all possible sequences is exponential in the length of the sequences, therefore, this command does not scale well in the parameter <maxlength>!
+
+$USAGE$
+<modelname> name of the usage profile from which the sequences are generated
+<sequencesName> name of the sequences that are generated
+<minlenght> minimal length of a sequence
+<maxlength> maximal length of a sequence
+<all> optional; if true, all possible sequences are generated and the <numSequences> parameter is ignored; default: true
+<numSequences> optional; number of sequences to be generated; no default, has to be defined if <all> is false
+<validEnd> optional; if true, only sequences that finish in the global END state are allowed; default: true
+
+Example(s):
+generateFixedLengthSequences markovModel generated_sequences 5 7
+generateFixedLengthSequences markovModel generated_sequences 5 7 false 500
+generateFixedLengthSequences markovModel generated_sequences 5 7 false 500 false
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateGreedy
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateGreedy	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateGreedy	(revision 1708)
@@ -0,0 +1,14 @@
+Generates sequences from a usage profile with a greedy strategy to fulfill a desired usage-based coverage value.
+
+$USAGE$
+<modelname> name of the usage profile from which the sequences are generated
+<sequencesName> name of the sequences that are generated
+<minlenght> minimal length of a sequence
+<maxlength> maximal length of a sequence
+<coverageDepth> depth of the desired coverage
+<desiredCoverage> desired coverage percentage
+<validEnd> optional; if true, only sequences that finish in the global END state are allowed; default: true
+
+Example(s)
+generateHybrid markovModel generated_sequences 5 7 3 0.9
+generateHybrid markovModel generated_sequences 5 7 3 0.9 false
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateHybrid
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateHybrid	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateHybrid	(revision 1708)
@@ -0,0 +1,13 @@
+Generates sequences with a hybrid strategy that is a mixture of random walks and drawing from all possible sequences. Up to <maxLengthAll>, the command draws from all possible sequences. Then, the sequences are finished through random walks. 
+
+$USAGE$
+<modelname> name of the usage profile from which the sequences are generated
+<sequencesName> name of the sequences that are generated
+<lenght> length of a sequence
+<maxlengthAll> maximal length where the command draws from all possible sequences
+<numSequences> number of sequences to be generated
+<validEnd> optional; if true, only sequences that finish in the global END state are allowed; default: true
+
+Example(s):
+generateHybrid markovModel generated_sequences 6 4 500
+generateHybrid markovModel generated_sequences 6 4 500 false
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateRandomSequences
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateRandomSequences	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateRandomSequences	(revision 1708)
@@ -0,0 +1,15 @@
+Generates sequences by randomly walking a usage profile. 
+
+$USAGE$
+<modelname> name of the usage profile from which the sequences are generated
+<sequencesName> name of the sequences that are generated
+<numSequences> number of sequences to be generated
+<minlenght> minimal length of a sequence
+<maxlength> maximal length of a sequence
+<maxIter> optional; defines the maximal number of random walks performed before aborting and returning with less than <numSequences> generated sequences; default: <numSequences>*10
+<validEnd> optional; if true, only sequences that finish in the global END state are allowed; default: true
+
+Example(s):
+generateRandomSequences markovModel generated_sequences 500 4 6
+generateRandomSequences markovModel generated_sequences 500 4 6 100000
+generateRandomSequences markovModel generated_sequences 500 4 6 100000 false
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateReplayfile
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateReplayfile	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/generateReplayfile	(revision 1708)
@@ -0,0 +1,8 @@
+Generates a replay file from a  collection of sequences.
+
+$USAGE$
+<filename> name of the replay file
+<sequences> name of the sequences
+
+Example(s):
+generateReplayfile replay.xml replaySequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/listSymbols
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/listSymbols	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/listSymbols	(revision 1708)
@@ -0,0 +1,9 @@
+Lists all symbols that are contained in a usage profile.
+
+$USAGE$
+<modelname> name of the usage profile
+<sort> optional; if true, the symbols are sorted alphabetically; default: false
+
+Example(s):
+listSymbols markovModel
+listSymbols markovModel true
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/load
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/load	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/load	(revision 1708)
@@ -0,0 +1,9 @@
+Loads a new global data container from a file. All data currently present is discarded. 
+
+This command is the counterpart of the save command.
+
+$USAGE$
+<filename> name of the data container file
+
+Example(s):
+load container.dat
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/loadObject
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/loadObject	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/loadObject	(revision 1708)
@@ -0,0 +1,11 @@
+Loads a single object (e.g., a collection of sequences or a usage profile) from a file.
+
+This command is the counterpart of the saveObject command.
+
+$USAGE$
+<filename> name of the file in which the object is stored
+<objectName> name under which the object is added to the storage
+
+Example(s)
+loadObject object.dat objectName
+loadObject sequences.dat sequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/mergeSequences
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/mergeSequences	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/mergeSequences	(revision 1708)
@@ -0,0 +1,9 @@
+merges all sequences of a collection of sequences into one long sequence depending on the timestamps of the contained events. If one of the events does not have a timestamp, the command quits with an error leaving the collection of sequences untouched.
+
+$USAGE$
+<sequences> the name of the collection of sequences that shall be merged into one sequence
+<new sequences> optional; the name of the collection of sequences into which the resulting sequence shall be stored; if left out, the result is stored in the collection identified by <sequences>
+
+Example(s):
+mergeSequences someSequences
+mergeSequences someSequences someNewSequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/modelSize
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/modelSize	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/modelSize	(revision 1708)
@@ -0,0 +1,7 @@
+Prints the size of of a usage profile to the console.
+
+$USAGE$
+<modelname> name of the usage profile
+
+Example(s):
+modelSize markovModel
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/printDot
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/printDot	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/printDot	(revision 1708)
@@ -0,0 +1,7 @@
+Outputs the DOT (see: http://en.wikipedia.org/wiki/DOT_language) representation of a usage profile to the console. Note, that not all usage profile types have a DOT representation.
+
+$USAGE$
+<modelname> name of the usage profile
+
+Example(s):
+printDot markovModel
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/printTrieDot
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/printTrieDot	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/printTrieDot	(revision 1708)
@@ -0,0 +1,7 @@
+Outputs the DOT (see: http://en.wikipedia.org/wiki/DOT_language) representation of the trie on which a usage profile is build to the console. Note, that not all usage profiles have to be built upon tries.
+
+$USAGE$
+<modelname> name of the usage profile
+
+Example(s):
+printTrieDot markovModel
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/removeScrolls
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/removeScrolls	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/removeScrolls	(revision 1708)
@@ -0,0 +1,7 @@
+Removes all scroll events from a sequence.
+
+$USAGE$
+<sequences> name of the usage profile
+
+Example(s):
+removeScrolls sequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/save
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/save	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/save	(revision 1708)
@@ -0,0 +1,9 @@
+Saves the global data container to a file. 
+
+This command is the counterpart of the load command.
+
+$USAGE$
+<filename> name of the data container file
+
+Example(s):
+save container.dat
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/saveObject
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/saveObject	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/saveObject	(revision 1708)
@@ -0,0 +1,11 @@
+Saves a single object (e.g., a collection of sequences or a usage profile) to a file.
+
+This command is the counterpart of the loadObject command.
+
+$USAGE$
+<filename> name of the file in which the object will be stored
+<objectName> name of the object to be saved
+
+Example(s)
+saveObject object.dat objectName
+saveObject sequences.dat sequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/sequenceStatistics
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/sequenceStatistics	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/sequenceStatistics	(revision 1708)
@@ -0,0 +1,7 @@
+Prints basic statistical information about stored sequences, e.g., how many there are of which length.
+
+$USAGE$
+<sequencesName> name of the sequences
+
+Example(s):
+sequenceStatistics sequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showMarkovModel
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showMarkovModel	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showMarkovModel	(revision 1708)
@@ -0,0 +1,9 @@
+Visualizes usage profiles based on first-order Markov models.
+
+$USAGE$
+<modelname> name of the usage profile
+<showNodeNames> optional; if true, the names of the states of the Markov model are part of the visualization; otherwise only the structure and the probabilities are shown ;default: false
+
+Example(s):
+showMarkovModel firstOrderMarkovModel
+showMarkovModel firstOrderMarkovModel true
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showTimer
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showTimer	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showTimer	(revision 1708)
@@ -0,0 +1,7 @@
+Traces the current value of a timer. 
+
+$USAGE$
+<timerName> name of the timer
+
+Example(s):
+showTimer timer
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showTrie
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showTrie	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/showTrie	(revision 1708)
@@ -0,0 +1,7 @@
+Visualizes the trie underlying a usage profile. Note, that not all usage profiles have to be built upon tries.
+
+$USAGE$
+<modelname> name of the usage profile
+
+Example(s):
+showTrie markovModel
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/splitSequences
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/splitSequences	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/splitSequences	(revision 1708)
@@ -0,0 +1,10 @@
+splits all sequences of a collection of sequences into subsequences depending on the timestamps of the events. If the difference of the timestamps of two subsequent events is larger than the provided number of milliseconds, the sequence to which the events belong is split up into two subsequences between the two events.
+
+$USAGE$
+<maximumTimestampDifference> the maximum number of milliseconds between two subsequent events
+<sequencesName> the name of the collection of sequences that shall be split
+<newSequences> optional; the name of the collection of sequences into which the resulting sequences shall be stored; if left out, the result is stored in the collection identified by <sequencesName>
+
+Example(s):
+splitSequences 100000 someSequences
+splitSequences 100000 someSequences someNewSequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/startFileListener
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/startFileListener	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/startFileListener	(revision 1708)
@@ -0,0 +1,7 @@
+Starts a file listener, i.e., a listener that writes all outputs to the console to a file.
+
+$USAGE$
+<filename> name of the file
+
+Example(s)
+startFileListener output.log
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/startTimer
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/startTimer	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/startTimer	(revision 1708)
@@ -0,0 +1,7 @@
+Starts a new timer that measures the time elapsed since the call of startTimer in milliseconds. 
+
+$USAGE$
+<timerName> name of the timer
+
+Example(s):
+startTimer timer
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/stopFileListener
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/stopFileListener	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/stopFileListener	(revision 1708)
@@ -0,0 +1,7 @@
+Stops a file listener from writing output to a log. 
+
+$USAGE$
+<filename> name of the file
+
+Example(s):
+stopFileListener output.log
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainDFA
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainDFA	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainDFA	(revision 1708)
@@ -0,0 +1,8 @@
+Trains a Deterministic Finite Automaton (DFA) from a collection of sequences.
+
+$USAGE$
+<modelname> the name of the DFA
+<sequences> the name of the sequences from which the model is trained 
+
+Example(s):
+trainDFA dfa sequences
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainMarkovModel
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainMarkovModel	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainMarkovModel	(revision 1708)
@@ -0,0 +1,10 @@
+Trains a Markov model from a collection of sequences. 
+
+$USAGE$
+<modelname> the name of the Markov model
+<sequences> the name of the sequences from which the model is trained
+<markovOrder> optional; defines the memory length of the trained Markov model; default: 1
+
+Examples:
+trainMarkovModel mm sequences
+trainMarkovModel mm sequences 3
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainPPM
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainPPM	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/trainPPM	(revision 1708)
@@ -0,0 +1,12 @@
+Trains a Prediction by Partial Match (PPM) model from a collection of sequences. 
+
+$USAGE$
+<modelname> the name of the PPM model
+<sequences> the name of the sequences from which the model is trained
+<probEscape> defines the probability to use a lower order Markov model
+<maxOrder> defines the Markov order of the PPM model
+<minOrder> optional; defines the minimal Markov order of the PPM model; default: 0
+
+Examples:
+trainPPM ppm sequences 0.1 3
+trainPPM ppm sequences 0.1 3 1
Index: /branches/autoquest-ui-core-alignment/src/main/resources/manuals/updateModel
===================================================================
--- /branches/autoquest-ui-core-alignment/src/main/resources/manuals/updateModel	(revision 1708)
+++ /branches/autoquest-ui-core-alignment/src/main/resources/manuals/updateModel	(revision 1708)
@@ -0,0 +1,8 @@
+Updates the training a usage profile with an additional collection of sequences. The original training is not lost, but reinforced by the new sequences.
+
+$USAGE$
+<modelname> name of the usage profile 
+<sequencesName> name of the sequences
+
+Example(s):
+updateModel markovModel newSequences
