Index: trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculator.java
===================================================================
--- trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculator.java	(revision 85)
+++ trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculator.java	(revision 93)
@@ -1,6 +1,4 @@
 package de.ugoe.cs.eventbench.coverage;
 
-import java.security.InvalidParameterException;
-import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -16,13 +14,13 @@
 	
 	private final IStochasticProcess process;
-	private final List<List<Event<?>>> sequences;
+	private final List<List<? extends Event<?>>> sequences;
 	private final int length;
 	
-	private Set<List<Event<?>>> containedSubSeqs = null;
-	private Set<List<Event<?>>> allPossibleSubSeqs = null;
-	private Map<List<Event<?>>, Double> subSeqWeights = null;
+	private Set<List<? extends Event<?>>> containedSubSeqs = null;
+	private Set<List<? extends Event<?>>> allPossibleSubSeqs = null;
+	private Map<List<? extends Event<?>>, Double> subSeqWeights = null;
 	
 	
-	public CoverageCalculator(IStochasticProcess process, List<List<Event<?>>> sequences, int length) {
+	public CoverageCalculator(IStochasticProcess process, List<List<? extends Event<?>>> sequences, int length) {
 		this.process = process;
 		this.sequences = sequences;
@@ -43,5 +41,5 @@
 		}
 		if( allPossibleSubSeqs==null ) {
-			allPossibleSubSeqs = generateSubSequences(process, length);
+			allPossibleSubSeqs = process.generateSequences(length);
 		}
 		return((double) containedSubSeqs.size())/allPossibleSubSeqs.size();
@@ -53,5 +51,5 @@
 		}
 		if( allPossibleSubSeqs==null ) {
-			allPossibleSubSeqs = generateSubSequences(process, length);
+			allPossibleSubSeqs = process.generateSequences(length);
 		}
 		if( subSeqWeights==null ) {
@@ -59,5 +57,5 @@
 		}
 		double weight = 0.0;
-		for( List<Event<?>> subSeq : containedSubSeqs ) {
+		for( List<? extends Event<?>> subSeq : containedSubSeqs ) {
 			weight += subSeqWeights.get(subSeq);
 		}
@@ -65,8 +63,8 @@
 	}
 	
-	private Map<List<Event<?>>, Double> generateWeights(IStochasticProcess process, Set<List<Event<?>>> sequences) {
-		Map<List<Event<?>>, Double> subSeqWeights = new LinkedHashMap<List<Event<?>>, Double>();
+	private Map<List<? extends Event<?>>, Double> generateWeights(IStochasticProcess process, Set<List<? extends Event<?>>> sequences) {
+		Map<List<? extends Event<?>>, Double> subSeqWeights = new LinkedHashMap<List<? extends Event<?>>, Double>();
 		double sum = 0.0;
-		for( List<Event<?>> sequence : sequences ) {
+		for( List<? extends Event<?>> sequence : sequences ) {
 			double prob = 1.0;
 			List<Event<?>> context = new LinkedList<Event<?>>();
@@ -79,5 +77,5 @@
 		}
 		if( sum<1.0 ) {
-			for( Map.Entry<List<Event<?>>, Double> entry : subSeqWeights.entrySet() ) {
+			for( Map.Entry<List<? extends Event<?>>, Double> entry : subSeqWeights.entrySet() ) {
 				entry.setValue(entry.getValue()/sum);
 			}
@@ -90,39 +88,10 @@
 	}
 	
-	// O(symbols^length)	
-	private Set<List<Event<?>>> generateSubSequences(IStochasticProcess process, int length) {
-		Set<List<Event<?>>> subSequenceSet = new LinkedHashSet<List<Event<?>>>();;
-		if( length<1 ) {
-			throw new InvalidParameterException("Length of generated subsequences must be at least 1.");
-		}
-		if( length==1 ) {
-			for( Event<?> event : process.getEvents() ) {
-				List<Event<?>> subSeq = new LinkedList<Event<?>>();
-				subSeq.add(event);
-				subSequenceSet.add(subSeq);
-			}
-			return subSequenceSet;
-		}
-		Set<Event<?>> events = process.getEvents();
-		Set<List<Event<?>>> subSeqsShorter = generateSubSequences(process, length-1);
-		for( Event<?> event : events ) {
-			for( List<Event<?>> subSequence : subSeqsShorter ) {
-				Event<?> lastEvent = event;
-				if( process.getProbability(subSequence, lastEvent)>0.0 ) {
-					List<Event<?>> subSeq = new ArrayList<Event<?>>(subSequence);
-					subSeq.add(lastEvent);
-					subSequenceSet.add(subSeq);
-				}
-			}
-		}
-		return subSequenceSet;
-	}
-
 	// O(numSeq*lenSeq)	
-	private Set<List<Event<?>>> containedSubSequences(List<List<Event<?>>> sequences, int length) {
-		Set<List<Event<?>>> containedSubSeqs = new LinkedHashSet<List<Event<?>>>();
+	private Set<List<? extends Event<?>>> containedSubSequences(List<List<? extends Event<?>>> sequences, int length) {
+		Set<List<? extends Event<?>>> containedSubSeqs = new LinkedHashSet<List<? extends Event<?>>>();
 		List<Event<?>> subSeq = new LinkedList<Event<?>>();
 		boolean minLengthReached = false;
-		for( List<Event<?>> sequence : sequences ) {
+		for( List<? extends Event<?>> sequence : sequences ) {
 			for( Event<?> event : sequence ) {
 				subSeq.add(event);
