Index: trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/CoverageCalculatorObserved.java
===================================================================
--- trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/CoverageCalculatorObserved.java	(revision 548)
+++ trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/CoverageCalculatorObserved.java	(revision 559)
@@ -1,2 +1,3 @@
+
 package de.ugoe.cs.quest.coverage;
 
@@ -12,6 +13,6 @@
 /**
  * <p>
- * This class calculates various types of sequence coverage in relation to a
- * collection of observed sequences.
+ * This class calculates various types of sequence coverage in relation to a collection of observed
+ * sequences.
  * </p>
  * 
@@ -21,252 +22,239 @@
 public class CoverageCalculatorObserved {
 
-	/**
-	 * <p>
-	 * Sequences for which the coverage is calculated.
-	 * </p>
-	 */
-	private final Collection<List<Event>> sequences;
-
-	/**
-	 * <p>
-	 * Observed sequences that are baseline for the coverage calculation.
-	 * </p>
-	 */
-	private final Collection<List<Event>> observedSequences;
-
-	/**
-	 * <p>
-	 * Length of the subsequences in relation to which the covarage is
-	 * calculated.
-	 * </p>
-	 */
-	private final int length;
-
-	/**
-	 * <p>
-	 * All subsequences of {@link #length} of {@link #sequences}.
-	 * </p>
-	 */
-	private Collection<List<Event>> subSeqsGenerated = null;
-
-	/**
-	 * <p>
-	 * All subsequences of {@link #length} of {@link #observedSequences}.
-	 * </p>
-	 */
-	private Collection<List<Event>> subSeqsObserved = null;
-
-	/**
-	 * <p>
-	 * Constructor. Creates a new CoverageCalculatorObserved for given
-	 * collections of observed sequences and generated sequences.
-	 * </p>
-	 * 
-	 * @param observedSequences
-	 *            observed sequences in relation to which the coverage is
-	 *            calculated; must not be null
-	 * @param sequences
-	 *            sequences for which the coverage is calculated; must not be
-	 *            null
-	 * @param length
-	 *            length of the subsequences for which the coverage is analyzed;
-	 *            must be >0
-	 * @throws InvalidParameterException
-	 *             thrown if observedSequences or sequences is null or length
-	 *             less than or equal to 0
-	 */
-	public CoverageCalculatorObserved(
-			Collection<List<Event>> observedSequences,
-			Collection<List<Event>> sequences, int length) {
-		if (observedSequences == null) {
-			throw new InvalidParameterException(
-					"observed sequences must not be null");
-		}
-		if (sequences == null) {
-			throw new InvalidParameterException("sequences must not be null");
-		}
-		if (length <= 0) {
-			throw new InvalidParameterException(
-					"length must be >0; actual value: " + length);
-		}
-		this.observedSequences = observedSequences;
-		this.sequences = sequences;
-		this.length = length;
-	}
-
-	/**
-	 * <p>
-	 * Calculates the percentage of subsequences of length k that occur, with
-	 * reference to those that were observed.
-	 * </p>
-	 * 
-	 * @return coverage percentage
-	 */
-	public double getCoverageObserved() {
-		createSubSeqs();
-		Collection<List<Event>> subSeqsObservedCopy = new LinkedHashSet<List<Event>>(
-				subSeqsObserved);
-		subSeqsObservedCopy.retainAll(subSeqsGenerated);
-		return ((double) subSeqsObservedCopy.size()) / subSeqsObserved.size();
-	}
-
-	/**
-	 * <p>
-	 * Calculates the weight of subsequences of length k that occur, with
-	 * reference to those that were observed.
-	 * </p>
-	 * 
-	 * @param process
-	 *            stochastic process in reference to which the weight is
-	 *            calculated
-	 * @return coverage percentage
-	 */
-
-	public double getCoverageObservedWeigth(IStochasticProcess process) {
-		createSubSeqs();
-		Map<List<Event>, Double> weightMap = SequenceTools
-				.generateWeights(process, subSeqsObserved);
-
-		Collection<List<Event>> subSeqsObservedCopy = new LinkedHashSet<List<Event>>(
-				subSeqsObserved);
-		subSeqsObservedCopy.retainAll(subSeqsGenerated);
-		double weight = 0.0d;
-		for (List<Event> subSeq : subSeqsObservedCopy) {
-			weight += weightMap.get(subSeq);
-		}
-		return weight;
-	}
-
-	/**
-	 * <p>
-	 * Calculates the percentage of generated subsequences of length k that
-	 * occur and have not been observed, with reference to all generated
-	 * subsequences.
-	 * </p>
-	 * 
-	 * @return coverage percentage
-	 */
-	public double getNewPercentage() {
-		createSubSeqs();
-		Collection<List<Event>> subSeqsGeneratedCopy = new LinkedHashSet<List<Event>>(
-				subSeqsGenerated);
-		subSeqsGeneratedCopy.removeAll(subSeqsObserved);
-		return ((double) subSeqsGeneratedCopy.size()) / subSeqsGenerated.size();
-	}
-
-	/**
-	 * <p>
-	 * Calculates the percentage of generated subsequences of length k that
-	 * occur and have not been observed, with references to all possible new
-	 * subsequences.
-	 * </p>
-	 * 
-	 * @param process
-	 *            stochastic process which is used to determine which
-	 *            subsequences are possible
-	 * @return coverage percentage
-	 * @throws InvalidParameterException
-	 *             thrown if process is null
-	 */
-	public double getCoveragePossibleNew(IStochasticProcess process) {
-		if (process == null) {
-			throw new InvalidParameterException("process must not be null");
-		}
-		createSubSeqs();
-		Collection<List<Event>> subSeqsGeneratedCopy = new LinkedHashSet<List<Event>>(
-				subSeqsGenerated);
-		Collection<List<Event>> subSeqsPossible = process
-				.generateSequences(length);
-		subSeqsGeneratedCopy.removeAll(subSeqsObserved);
-		subSeqsPossible.removeAll(subSeqsObserved);
-		int possibleSize = subSeqsPossible.size();
-		subSeqsPossible.retainAll(subSeqsGeneratedCopy);
-		return ((double) subSeqsPossible.size()) / possibleSize;
-	}
-
-	/**
-	 * <p>
-	 * Calculates the weight of generated subsequences of length k that occur
-	 * and have not been observed, with references to all possible new
-	 * subsequences.
-	 * </p>
-	 * 
-	 * @param process
-	 *            stochastic process which is used to determine the weights and
-	 *            which subsequences are possible
-	 * @return coverage percentage
-	 * @throws InvalidParameterException
-	 *             thrown if process is null
-	 */
-	public double getCoveragePossibleNewWeight(IStochasticProcess process) {
-		if (process == null) {
-			throw new InvalidParameterException("process must not be null");
-		}
-		createSubSeqs();
-		Collection<List<Event>> subSeqsGeneratedCopy = new LinkedHashSet<List<Event>>(
-				subSeqsGenerated);
-		Collection<List<Event>> subSeqsPossible = process
-				.generateSequences(length);
-		subSeqsGeneratedCopy.removeAll(subSeqsObserved);
-		subSeqsPossible.removeAll(subSeqsObserved);
-		Map<List<Event>, Double> weightMap = SequenceTools
-				.generateWeights(process, subSeqsPossible);
-		double weight = 0.0d;
-		for (List<Event> subSeq : subSeqsGeneratedCopy) {
-			Double currentWeight = weightMap.get(subSeq);
-			if( currentWeight!=null ) {
-				weight += currentWeight;
-			}
-		}
-		return weight;
-	}
-
-	/**
-	 * <p>
-	 * Returns the number of covered subsequences of length k.
-	 * </p>
-	 * 
-	 * @return number of covered subsequences
-	 */
-	public int getNumObserved() {
-		createSubSeqs();
-		return subSeqsObserved.size();
-	}
-
-	/**
-	 * <p>
-	 * Returns the number of covered subsequences of length k.
-	 * </p>
-	 * 
-	 * @return number of covered subsequences
-	 */
-	public int getNumCovered() {
-		createSubSeqs();
-		return subSeqsGenerated.size();
-	}
-
-	public int getNumNew() {
-		createSubSeqs();
-		Collection<List<Event>> subSeqsGeneratedCopy = new LinkedHashSet<List<Event>>(
-				subSeqsGenerated);
-		subSeqsGeneratedCopy.removeAll(subSeqsObserved);
-		return subSeqsGeneratedCopy.size();
-	}
-
-	/**
-	 * <p>
-	 * Helper function that calcuates the subsequences of length k that have
-	 * been observed and generated.
-	 * </p>
-	 */
-	private void createSubSeqs() {
-		if (subSeqsObserved == null) {
-			subSeqsObserved = SequenceTools.containedSubSequences(
-					observedSequences, length);
-		}
-		if (subSeqsGenerated == null) {
-			subSeqsGenerated = SequenceTools.containedSubSequences(sequences,
-					length);
-		}
-	}
+    /**
+     * <p>
+     * Sequences for which the coverage is calculated.
+     * </p>
+     */
+    private final Collection<List<Event>> sequences;
+
+    /**
+     * <p>
+     * Observed sequences that are baseline for the coverage calculation.
+     * </p>
+     */
+    private final Collection<List<Event>> observedSequences;
+
+    /**
+     * <p>
+     * Length of the subsequences in relation to which the covarage is calculated.
+     * </p>
+     */
+    private final int length;
+
+    /**
+     * <p>
+     * All subsequences of {@link #length} of {@link #sequences}.
+     * </p>
+     */
+    private Collection<List<Event>> subSeqsGenerated = null;
+
+    /**
+     * <p>
+     * All subsequences of {@link #length} of {@link #observedSequences}.
+     * </p>
+     */
+    private Collection<List<Event>> subSeqsObserved = null;
+
+    /**
+     * <p>
+     * Constructor. Creates a new CoverageCalculatorObserved for given collections of observed
+     * sequences and generated sequences.
+     * </p>
+     * 
+     * @param observedSequences
+     *            observed sequences in relation to which the coverage is calculated; must not be
+     *            null
+     * @param sequences
+     *            sequences for which the coverage is calculated; must not be null
+     * @param length
+     *            length of the subsequences for which the coverage is analyzed; must be >0
+     * @throws InvalidParameterException
+     *             thrown if observedSequences or sequences is null or length less than or equal to
+     *             0
+     */
+    public CoverageCalculatorObserved(Collection<List<Event>> observedSequences,
+                                      Collection<List<Event>> sequences,
+                                      int length)
+    {
+        if (observedSequences == null) {
+            throw new InvalidParameterException("observed sequences must not be null");
+        }
+        if (sequences == null) {
+            throw new InvalidParameterException("sequences must not be null");
+        }
+        if (length <= 0) {
+            throw new InvalidParameterException("length must be >0; actual value: " + length);
+        }
+        this.observedSequences = observedSequences;
+        this.sequences = sequences;
+        this.length = length;
+    }
+
+    /**
+     * <p>
+     * Calculates the percentage of subsequences of length k that occur, with reference to those
+     * that were observed.
+     * </p>
+     * 
+     * @return coverage percentage
+     */
+    public double getCoverageObserved() {
+        createSubSeqs();
+        Collection<List<Event>> subSeqsObservedCopy =
+            new LinkedHashSet<List<Event>>(subSeqsObserved);
+        subSeqsObservedCopy.retainAll(subSeqsGenerated);
+        return ((double) subSeqsObservedCopy.size()) / subSeqsObserved.size();
+    }
+
+    /**
+     * <p>
+     * Calculates the weight of subsequences of length k that occur, with reference to those that
+     * were observed.
+     * </p>
+     * 
+     * @param process
+     *            stochastic process in reference to which the weight is calculated
+     * @return coverage percentage
+     */
+
+    public double getCoverageObservedWeigth(IStochasticProcess process) {
+        createSubSeqs();
+        Map<List<Event>, Double> weightMap =
+            SequenceTools.generateWeights(process, subSeqsObserved);
+
+        Collection<List<Event>> subSeqsObservedCopy =
+            new LinkedHashSet<List<Event>>(subSeqsObserved);
+        subSeqsObservedCopy.retainAll(subSeqsGenerated);
+        double weight = 0.0d;
+        for (List<Event> subSeq : subSeqsObservedCopy) {
+            weight += weightMap.get(subSeq);
+        }
+        return weight;
+    }
+
+    /**
+     * <p>
+     * Calculates the percentage of generated subsequences of length k that occur and have not been
+     * observed, with reference to all generated subsequences.
+     * </p>
+     * 
+     * @return coverage percentage
+     */
+    public double getNewPercentage() {
+        createSubSeqs();
+        Collection<List<Event>> subSeqsGeneratedCopy =
+            new LinkedHashSet<List<Event>>(subSeqsGenerated);
+        subSeqsGeneratedCopy.removeAll(subSeqsObserved);
+        return ((double) subSeqsGeneratedCopy.size()) / subSeqsGenerated.size();
+    }
+
+    /**
+     * <p>
+     * Calculates the percentage of generated subsequences of length k that occur and have not been
+     * observed, with references to all possible new subsequences.
+     * </p>
+     * 
+     * @param process
+     *            stochastic process which is used to determine which subsequences are possible
+     * @return coverage percentage
+     * @throws InvalidParameterException
+     *             thrown if process is null
+     */
+    public double getCoveragePossibleNew(IStochasticProcess process) {
+        if (process == null) {
+            throw new InvalidParameterException("process must not be null");
+        }
+        createSubSeqs();
+        Collection<List<Event>> subSeqsGeneratedCopy =
+            new LinkedHashSet<List<Event>>(subSeqsGenerated);
+        Collection<List<Event>> subSeqsPossible = process.generateSequences(length);
+        subSeqsGeneratedCopy.removeAll(subSeqsObserved);
+        subSeqsPossible.removeAll(subSeqsObserved);
+        int possibleSize = subSeqsPossible.size();
+        subSeqsPossible.retainAll(subSeqsGeneratedCopy);
+        return ((double) subSeqsPossible.size()) / possibleSize;
+    }
+
+    /**
+     * <p>
+     * Calculates the weight of generated subsequences of length k that occur and have not been
+     * observed, with references to all possible new subsequences.
+     * </p>
+     * 
+     * @param process
+     *            stochastic process which is used to determine the weights and which subsequences
+     *            are possible
+     * @return coverage percentage
+     * @throws InvalidParameterException
+     *             thrown if process is null
+     */
+    public double getCoveragePossibleNewWeight(IStochasticProcess process) {
+        if (process == null) {
+            throw new InvalidParameterException("process must not be null");
+        }
+        createSubSeqs();
+        Collection<List<Event>> subSeqsGeneratedCopy =
+            new LinkedHashSet<List<Event>>(subSeqsGenerated);
+        Collection<List<Event>> subSeqsPossible = process.generateSequences(length);
+        subSeqsGeneratedCopy.removeAll(subSeqsObserved);
+        subSeqsPossible.removeAll(subSeqsObserved);
+        Map<List<Event>, Double> weightMap =
+            SequenceTools.generateWeights(process, subSeqsPossible);
+        double weight = 0.0d;
+        for (List<Event> subSeq : subSeqsGeneratedCopy) {
+            Double currentWeight = weightMap.get(subSeq);
+            if (currentWeight != null) {
+                weight += currentWeight;
+            }
+        }
+        return weight;
+    }
+
+    /**
+     * <p>
+     * Returns the number of covered subsequences of length k.
+     * </p>
+     * 
+     * @return number of covered subsequences
+     */
+    public int getNumObserved() {
+        createSubSeqs();
+        return subSeqsObserved.size();
+    }
+
+    /**
+     * <p>
+     * Returns the number of covered subsequences of length k.
+     * </p>
+     * 
+     * @return number of covered subsequences
+     */
+    public int getNumCovered() {
+        createSubSeqs();
+        return subSeqsGenerated.size();
+    }
+
+    public int getNumNew() {
+        createSubSeqs();
+        Collection<List<Event>> subSeqsGeneratedCopy =
+            new LinkedHashSet<List<Event>>(subSeqsGenerated);
+        subSeqsGeneratedCopy.removeAll(subSeqsObserved);
+        return subSeqsGeneratedCopy.size();
+    }
+
+    /**
+     * <p>
+     * Helper function that calcuates the subsequences of length k that have been observed and
+     * generated.
+     * </p>
+     */
+    private void createSubSeqs() {
+        if (subSeqsObserved == null) {
+            subSeqsObserved = SequenceTools.containedSubSequences(observedSequences, length);
+        }
+        if (subSeqsGenerated == null) {
+            subSeqsGenerated = SequenceTools.containedSubSequences(sequences, length);
+        }
+    }
 }
Index: trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/CoverageCalculatorProcess.java
===================================================================
--- trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/CoverageCalculatorProcess.java	(revision 548)
+++ trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/CoverageCalculatorProcess.java	(revision 559)
@@ -1,2 +1,3 @@
+
 package de.ugoe.cs.quest.coverage;
 
@@ -11,6 +12,5 @@
 /**
  * <p>
- * This class calculates various types of sequence coverage in relation to a
- * stochastic process.
+ * This class calculates various types of sequence coverage in relation to a stochastic process.
  * </p>
  * 
@@ -20,199 +20,186 @@
 public class CoverageCalculatorProcess {
 
-	/**
-	 * <p>
-	 * Stochastic process that is the foundation for probabilistic coverages and
-	 * coverages with reference to all possible sequences.
-	 * </p>
-	 */
-	private final IStochasticProcess process;
-
-	/**
-	 * <p>
-	 * Sequences for which the coverage is calculated.
-	 * </p>
-	 */
-	private Collection<List<Event>> sequences;
-
-	/**
-	 * <p>
-	 * Length of the subsequences in relation to which the coverage is
-	 * calculated.
-	 * </p>
-	 */
-	private final int length;
-
-	/**
-	 * <p>
-	 * All subsequences of {@link #length} of {@link #sequences}.
-	 * </p>
-	 */
-	private Collection<List<Event>> containedSubSeqs = null;
-
-	/**
-	 * <p>
-	 * All subsequences of {@link #length} that can be generated by
-	 * {@link #process}.
-	 * </p>
-	 */
-	private Collection<List<Event>> allPossibleSubSeqs = null;
-
-	/**
-	 * <p>
-	 * The probabilities of all subsequences of {@link #length} according to
-	 * {@link #process}.
-	 * </p>
-	 */
-	private Map<List<Event>, Double> subSeqWeights = null;
-
-	/**
-	 * <p>
-	 * Constructor. Creates a new CoverageCalculatorProcess for a given
-	 * stochastic process and generated sequences.
-	 * </p>
-	 * 
-	 * @param process
-	 *            stochastic process used for coverage calculations; must not be
-	 *            null
-	 * @param sequences
-	 *            sequences for which the coverage is calculated; must not be
-	 *            null
-	 * @param length
-	 *            length of the subsequences for which the coverage is analyzed;
-	 *            must be >0
-	 * @throws InvalidParameterException
-	 *             thrown if process or sequences is null or length less than or equal to 0
-	 */
-	public CoverageCalculatorProcess(IStochasticProcess process,
-			Collection<List<Event>> sequences, int length) {
-		if (process == null) {
-			throw new InvalidParameterException("process must not be null");
-		}
-		if (sequences == null) {
-			throw new InvalidParameterException("sequences must not be null");
-		}
-		if (length <= 0) {
-			throw new InvalidParameterException(
-					"length must be >0; actual value: " + length);
-		}
-		this.process = process;
-		this.sequences = sequences;
-		this.length = length;
-	}
-
-	/**
-	 * <p>
-	 * Calculates the percentage of subsequences of length k that occur,
-	 * including those that cannot be generated by {@link #process}.
-	 * </p>
-	 * 
-	 * @return coverage percentage
-	 */
-	public double getCoverageAllNoWeight() {
-		if (containedSubSeqs == null) {
-			containedSubSeqs = SequenceTools.containedSubSequences(sequences,
-					length);
-		}
-		return ((double) containedSubSeqs.size())
-				/ SequenceTools.numSequences(process, length);
-	}
-
-	/**
-	 * <p>
-	 * Calculates the percentage of subsequences of length k that occur and can
-	 * generated by {@link #process}.
-	 * </p>
-	 * 
-	 * @return coverage percentage
-	 */
-	public double getCoveragePossibleNoWeight() {
-		if (containedSubSeqs == null) {
-			containedSubSeqs = SequenceTools.containedSubSequences(sequences,
-					length);
-		}
-		if (allPossibleSubSeqs == null) {
-			allPossibleSubSeqs = process.generateSequences(length);
-		}
-		return ((double) containedSubSeqs.size()) / allPossibleSubSeqs.size();
-	}
-
-	/**
-	 * <p>
-	 * Calculates the weight of the subsequences that occur with relation to
-	 * {@link #process}, i.e., the mass of the subsequence probability covered
-	 * by the subsequences.
-	 * </p>
-	 * 
-	 * @return coverage weight
-	 */
-	public double getCoveragePossibleWeight() {
-		if (containedSubSeqs == null) {
-			containedSubSeqs = SequenceTools.containedSubSequences(sequences,
-					length);
-		}
-		if (allPossibleSubSeqs == null) {
-			allPossibleSubSeqs = process.generateSequences(length);
-		}
-		if (subSeqWeights == null) {
-			subSeqWeights = SequenceTools.generateWeights(process,
-					allPossibleSubSeqs);
-		}
-		double weight = 0.0;
-		for (List<Event> subSeq : containedSubSeqs) {
-			Double curWeight = subSeqWeights.get(subSeq);
-			if( curWeight!=null ) {
-				weight += curWeight;
-			}
-		}
-		return weight;
-	}
-
-	/**
-	 * <p>
-	 * Returns the number of covered subsequences of length k.
-	 * </p>
-	 * 
-	 * @return number of covered subsequences
-	 */
-	public int getNumCovered() {
-		if (containedSubSeqs == null) {
-			containedSubSeqs = SequenceTools.containedSubSequences(sequences,
-					length);
-		}
-		return containedSubSeqs.size();
-	}
-
-	/**
-	 * <p>
-	 * Returns the number of possible subsequences of length k according to the
-	 * stochastic process.
-	 * </p>
-	 * 
-	 * @return number of possible subsequences
-	 */
-	public int getNumPossible() {
-		if (allPossibleSubSeqs == null) {
-			allPossibleSubSeqs = process.generateSequences(length);
-		}
-		return allPossibleSubSeqs.size();
-	}
-
-	/**
-	 * <p>
-	 * Sets a new collection of sequences for which the coverage is analyzed.
-	 * </p>
-	 * 
-	 * @param newSequences
-	 *            new collection of sequences
-	 * @throws InvalidParameterException
-	 *             thrown is newSequences is null
-	 */
-	public void setSequences(Collection<List<Event>> newSequences) {
-		if (newSequences == null) {
-			throw new InvalidParameterException("sequences must not be null");
-		}
-		this.sequences = newSequences;
-		containedSubSeqs = null;
-	}
+    /**
+     * <p>
+     * Stochastic process that is the foundation for probabilistic coverages and coverages with
+     * reference to all possible sequences.
+     * </p>
+     */
+    private final IStochasticProcess process;
+
+    /**
+     * <p>
+     * Sequences for which the coverage is calculated.
+     * </p>
+     */
+    private Collection<List<Event>> sequences;
+
+    /**
+     * <p>
+     * Length of the subsequences in relation to which the coverage is calculated.
+     * </p>
+     */
+    private final int length;
+
+    /**
+     * <p>
+     * All subsequences of {@link #length} of {@link #sequences}.
+     * </p>
+     */
+    private Collection<List<Event>> containedSubSeqs = null;
+
+    /**
+     * <p>
+     * All subsequences of {@link #length} that can be generated by {@link #process}.
+     * </p>
+     */
+    private Collection<List<Event>> allPossibleSubSeqs = null;
+
+    /**
+     * <p>
+     * The probabilities of all subsequences of {@link #length} according to {@link #process}.
+     * </p>
+     */
+    private Map<List<Event>, Double> subSeqWeights = null;
+
+    /**
+     * <p>
+     * Constructor. Creates a new CoverageCalculatorProcess for a given stochastic process and
+     * generated sequences.
+     * </p>
+     * 
+     * @param process
+     *            stochastic process used for coverage calculations; must not be null
+     * @param sequences
+     *            sequences for which the coverage is calculated; must not be null
+     * @param length
+     *            length of the subsequences for which the coverage is analyzed; must be >0
+     * @throws InvalidParameterException
+     *             thrown if process or sequences is null or length less than or equal to 0
+     */
+    public CoverageCalculatorProcess(IStochasticProcess process,
+                                     Collection<List<Event>> sequences,
+                                     int length)
+    {
+        if (process == null) {
+            throw new InvalidParameterException("process must not be null");
+        }
+        if (sequences == null) {
+            throw new InvalidParameterException("sequences must not be null");
+        }
+        if (length <= 0) {
+            throw new InvalidParameterException("length must be >0; actual value: " + length);
+        }
+        this.process = process;
+        this.sequences = sequences;
+        this.length = length;
+    }
+
+    /**
+     * <p>
+     * Calculates the percentage of subsequences of length k that occur, including those that cannot
+     * be generated by {@link #process}.
+     * </p>
+     * 
+     * @return coverage percentage
+     */
+    public double getCoverageAllNoWeight() {
+        if (containedSubSeqs == null) {
+            containedSubSeqs = SequenceTools.containedSubSequences(sequences, length);
+        }
+        return ((double) containedSubSeqs.size()) / SequenceTools.numSequences(process, length);
+    }
+
+    /**
+     * <p>
+     * Calculates the percentage of subsequences of length k that occur and can generated by
+     * {@link #process}.
+     * </p>
+     * 
+     * @return coverage percentage
+     */
+    public double getCoveragePossibleNoWeight() {
+        if (containedSubSeqs == null) {
+            containedSubSeqs = SequenceTools.containedSubSequences(sequences, length);
+        }
+        if (allPossibleSubSeqs == null) {
+            allPossibleSubSeqs = process.generateSequences(length);
+        }
+        return ((double) containedSubSeqs.size()) / allPossibleSubSeqs.size();
+    }
+
+    /**
+     * <p>
+     * Calculates the weight of the subsequences that occur with relation to {@link #process}, i.e.,
+     * the mass of the subsequence probability covered by the subsequences.
+     * </p>
+     * 
+     * @return coverage weight
+     */
+    public double getCoveragePossibleWeight() {
+        if (containedSubSeqs == null) {
+            containedSubSeqs = SequenceTools.containedSubSequences(sequences, length);
+        }
+        if (allPossibleSubSeqs == null) {
+            allPossibleSubSeqs = process.generateSequences(length);
+        }
+        if (subSeqWeights == null) {
+            subSeqWeights = SequenceTools.generateWeights(process, allPossibleSubSeqs);
+        }
+        double weight = 0.0;
+        for (List<Event> subSeq : containedSubSeqs) {
+            Double curWeight = subSeqWeights.get(subSeq);
+            if (curWeight != null) {
+                weight += curWeight;
+            }
+        }
+        return weight;
+    }
+
+    /**
+     * <p>
+     * Returns the number of covered subsequences of length k.
+     * </p>
+     * 
+     * @return number of covered subsequences
+     */
+    public int getNumCovered() {
+        if (containedSubSeqs == null) {
+            containedSubSeqs = SequenceTools.containedSubSequences(sequences, length);
+        }
+        return containedSubSeqs.size();
+    }
+
+    /**
+     * <p>
+     * Returns the number of possible subsequences of length k according to the stochastic process.
+     * </p>
+     * 
+     * @return number of possible subsequences
+     */
+    public int getNumPossible() {
+        if (allPossibleSubSeqs == null) {
+            allPossibleSubSeqs = process.generateSequences(length);
+        }
+        return allPossibleSubSeqs.size();
+    }
+
+    /**
+     * <p>
+     * Sets a new collection of sequences for which the coverage is analyzed.
+     * </p>
+     * 
+     * @param newSequences
+     *            new collection of sequences
+     * @throws InvalidParameterException
+     *             thrown is newSequences is null
+     */
+    public void setSequences(Collection<List<Event>> newSequences) {
+        if (newSequences == null) {
+            throw new InvalidParameterException("sequences must not be null");
+        }
+        this.sequences = newSequences;
+        containedSubSeqs = null;
+    }
 
 }
Index: trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/SequenceTools.java
===================================================================
--- trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/SequenceTools.java	(revision 548)
+++ trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/SequenceTools.java	(revision 559)
@@ -1,2 +1,3 @@
+
 package de.ugoe.cs.quest.coverage;
 
@@ -22,126 +23,123 @@
  */
 public class SequenceTools {
-	
-	/**
-	 * <p>
-	 * Private constructor to prevent initializing of the class.
-	 * </p>
-	 */
-	private SequenceTools() {
-		
-	}
 
-	/**
-	 * <p>
-	 * Calculates the weights for all sequences passed to this function as
-	 * defined by the stochastic process and stores them in a {@link Map}. The
-	 * weights are normalized, i.e., the sum of all weights contained in this
-	 * map is 1.
-	 * </p>
-	 * 
-	 * @param process
-	 *            process used for weight calculation
-	 * @param sequences
-	 *            sequences for which the weights are calculated
-	 * @return {@link Map} of weights
-	 */
-	public static Map<List<Event>, Double> generateWeights(
-			IStochasticProcess process,
-			Collection<List<Event>> sequences) {
-		Map<List<Event>, Double> subSeqWeights = new LinkedHashMap<List<Event>, Double>();
-		if (sequences != null && !sequences.isEmpty()) {
-			if (process != null) {
-				double sum = 0.0;
-				for (List<Event> sequence : sequences) {
-					double prob = process.getProbability(sequence);
-					subSeqWeights.put(sequence, prob);
-					sum += prob;
-				}
-				if (sum < 1.0) {
-					for (Map.Entry<List<Event>, Double> entry : subSeqWeights
-							.entrySet()) {
-						entry.setValue(entry.getValue() / sum);
-					}
-				}
-			} else {
-				for( List<Event> sequence : sequences ) {
-					subSeqWeights.put(sequence, 0.0d);
-				}
-			}
-		}
-		return subSeqWeights;
-	}
+    /**
+     * <p>
+     * Private constructor to prevent initializing of the class.
+     * </p>
+     */
+    private SequenceTools() {
 
-	/**
-	 * <p>
-	 * Calculates the number of all existing sequences of a given length,
-	 * regardless whether they are possible or not.
-	 * </p>
-	 * 
-	 * @param process
-	 *            stochastic process whose symbols are the basis for this
-	 *            calculation
-	 * @param length
-	 *            lenght of the sequences
-	 * @return numStates^length
-	 * @throws InvalidParameterException
-	 *             thrown if length less or equal to 0
-	 */
-	public static long numSequences(IStochasticProcess process, int length) {
-		if (length <= 0) {
-			throw new InvalidParameterException(
-					"length must be a positive integer");
-		}
-		long result = 0;
-		if (process != null) {
-			result = (long) Math.pow(process.getNumSymbols(), length);
-		}
-		return result;
-	}
+    }
 
-	/**
-	 * <p>
-	 * Creates a {@link Set} of all subsequences of a given length that are
-	 * contained in a sequence collection.
-	 * </p>
-	 * 
-	 * @param sequences
-	 *            sequences from which the subsequences are extracted
-	 * @param length
-	 *            length of the subsequences
-	 * @return {@link Set} of all subsequences
-	 * @throws InvalidParameterException
-	 *             thrown if length less or equal to 0
-	 */
-	public static Set<List<Event>> containedSubSequences(
-			Collection<List<Event>> sequences, int length) {
-		if (length <= 0) {
-			throw new InvalidParameterException(
-					"length must be a positive integer");
-		}
-		Set<List<Event>> containedSubSeqs = new LinkedHashSet<List<Event>>();
-		if (sequences != null) {
-			for (List<Event> sequence : sequences) {
-				List<Event> subSeq = new LinkedList<Event>();
-				boolean minLengthReached = false;
-				for (Event event : sequence) {
-					subSeq.add(event);
-					if (!minLengthReached) {
-						if (subSeq.size() == length) {
-							minLengthReached = true;
-						}
-					} else {
-						subSeq.remove(0);
-					}
-					if (minLengthReached) {
-						if (!containedSubSeqs.contains(subSeq)) {
-							containedSubSeqs.add(new LinkedList<Event>(
-									subSeq));
-						}
-					}
-				}
-			}
-		}
-		return containedSubSeqs;
-	}
+    /**
+     * <p>
+     * Calculates the weights for all sequences passed to this function as defined by the stochastic
+     * process and stores them in a {@link Map}. The weights are normalized, i.e., the sum of all
+     * weights contained in this map is 1.
+     * </p>
+     * 
+     * @param process
+     *            process used for weight calculation
+     * @param sequences
+     *            sequences for which the weights are calculated
+     * @return {@link Map} of weights
+     */
+    public static Map<List<Event>, Double> generateWeights(IStochasticProcess process,
+                                                           Collection<List<Event>> sequences)
+    {
+        Map<List<Event>, Double> subSeqWeights = new LinkedHashMap<List<Event>, Double>();
+        if (sequences != null && !sequences.isEmpty()) {
+            if (process != null) {
+                double sum = 0.0;
+                for (List<Event> sequence : sequences) {
+                    double prob = process.getProbability(sequence);
+                    subSeqWeights.put(sequence, prob);
+                    sum += prob;
+                }
+                if (sum < 1.0) {
+                    for (Map.Entry<List<Event>, Double> entry : subSeqWeights.entrySet()) {
+                        entry.setValue(entry.getValue() / sum);
+                    }
+                }
+            }
+            else {
+                for (List<Event> sequence : sequences) {
+                    subSeqWeights.put(sequence, 0.0d);
+                }
+            }
+        }
+        return subSeqWeights;
+    }
+
+    /**
+     * <p>
+     * Calculates the number of all existing sequences of a given length, regardless whether they
+     * are possible or not.
+     * </p>
+     * 
+     * @param process
+     *            stochastic process whose symbols are the basis for this calculation
+     * @param length
+     *            lenght of the sequences
+     * @return numStates^length
+     * @throws InvalidParameterException
+     *             thrown if length less or equal to 0
+     */
+    public static long numSequences(IStochasticProcess process, int length) {
+        if (length <= 0) {
+            throw new InvalidParameterException("length must be a positive integer");
+        }
+        long result = 0;
+        if (process != null) {
+            result = (long) Math.pow(process.getNumSymbols(), length);
+        }
+        return result;
+    }
+
+    /**
+     * <p>
+     * Creates a {@link Set} of all subsequences of a given length that are contained in a sequence
+     * collection.
+     * </p>
+     * 
+     * @param sequences
+     *            sequences from which the subsequences are extracted
+     * @param length
+     *            length of the subsequences
+     * @return {@link Set} of all subsequences
+     * @throws InvalidParameterException
+     *             thrown if length less or equal to 0
+     */
+    public static Set<List<Event>> containedSubSequences(Collection<List<Event>> sequences,
+                                                         int length)
+    {
+        if (length <= 0) {
+            throw new InvalidParameterException("length must be a positive integer");
+        }
+        Set<List<Event>> containedSubSeqs = new LinkedHashSet<List<Event>>();
+        if (sequences != null) {
+            for (List<Event> sequence : sequences) {
+                List<Event> subSeq = new LinkedList<Event>();
+                boolean minLengthReached = false;
+                for (Event event : sequence) {
+                    subSeq.add(event);
+                    if (!minLengthReached) {
+                        if (subSeq.size() == length) {
+                            minLengthReached = true;
+                        }
+                    }
+                    else {
+                        subSeq.remove(0);
+                    }
+                    if (minLengthReached) {
+                        if (!containedSubSeqs.contains(subSeq)) {
+                            containedSubSeqs.add(new LinkedList<Event>(subSeq));
+                        }
+                    }
+                }
+            }
+        }
+        return containedSubSeqs;
+    }
 }
