Changeset 547
- Timestamp:
- 08/16/12 12:34:24 (12 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/CoverageCalculatorObserved.java
r518 r547 26 26 * </p> 27 27 */ 28 private final Collection<List< ? extends Event<?>>> sequences;28 private final Collection<List<Event>> sequences; 29 29 30 30 /** … … 33 33 * </p> 34 34 */ 35 private final Collection<List< ? extends Event<?>>> observedSequences;35 private final Collection<List<Event>> observedSequences; 36 36 37 37 /** … … 48 48 * </p> 49 49 */ 50 private Collection<List< ? extends Event<?>>> subSeqsGenerated = null;50 private Collection<List<Event>> subSeqsGenerated = null; 51 51 52 52 /** … … 55 55 * </p> 56 56 */ 57 private Collection<List< ? extends Event<?>>> subSeqsObserved = null;57 private Collection<List<Event>> subSeqsObserved = null; 58 58 59 59 /** … … 77 77 */ 78 78 public CoverageCalculatorObserved( 79 Collection<List< ? extends Event<?>>> observedSequences,80 Collection<List< ? extends Event<?>>> sequences, int length) {79 Collection<List<Event>> observedSequences, 80 Collection<List<Event>> sequences, int length) { 81 81 if (observedSequences == null) { 82 82 throw new InvalidParameterException( … … 105 105 public double getCoverageObserved() { 106 106 createSubSeqs(); 107 Collection<List< ? extends Event<?>>> subSeqsObservedCopy = new LinkedHashSet<List<? extends Event<?>>>(107 Collection<List<Event>> subSeqsObservedCopy = new LinkedHashSet<List<Event>>( 108 108 subSeqsObserved); 109 109 subSeqsObservedCopy.retainAll(subSeqsGenerated); … … 125 125 public double getCoverageObservedWeigth(IStochasticProcess process) { 126 126 createSubSeqs(); 127 Map<List< ? extends Event<?>>, Double> weightMap = SequenceTools127 Map<List<Event>, Double> weightMap = SequenceTools 128 128 .generateWeights(process, subSeqsObserved); 129 129 130 Collection<List< ? extends Event<?>>> subSeqsObservedCopy = new LinkedHashSet<List<? extends Event<?>>>(130 Collection<List<Event>> subSeqsObservedCopy = new LinkedHashSet<List<Event>>( 131 131 subSeqsObserved); 132 132 subSeqsObservedCopy.retainAll(subSeqsGenerated); 133 133 double weight = 0.0d; 134 for (List< ? extends Event<?>> subSeq : subSeqsObservedCopy) {134 for (List<Event> subSeq : subSeqsObservedCopy) { 135 135 weight += weightMap.get(subSeq); 136 136 } … … 149 149 public double getNewPercentage() { 150 150 createSubSeqs(); 151 Collection<List< ? extends Event<?>>> subSeqsGeneratedCopy = new LinkedHashSet<List<? extends Event<?>>>(151 Collection<List<Event>> subSeqsGeneratedCopy = new LinkedHashSet<List<Event>>( 152 152 subSeqsGenerated); 153 153 subSeqsGeneratedCopy.removeAll(subSeqsObserved); … … 174 174 } 175 175 createSubSeqs(); 176 Collection<List< ? extends Event<?>>> subSeqsGeneratedCopy = new LinkedHashSet<List<? extends Event<?>>>(177 subSeqsGenerated); 178 Collection<List< ? extends Event<?>>> subSeqsPossible = process176 Collection<List<Event>> subSeqsGeneratedCopy = new LinkedHashSet<List<Event>>( 177 subSeqsGenerated); 178 Collection<List<Event>> subSeqsPossible = process 179 179 .generateSequences(length); 180 180 subSeqsGeneratedCopy.removeAll(subSeqsObserved); … … 204 204 } 205 205 createSubSeqs(); 206 Collection<List< ? extends Event<?>>> subSeqsGeneratedCopy = new LinkedHashSet<List<? extends Event<?>>>(207 subSeqsGenerated); 208 Collection<List< ? extends Event<?>>> subSeqsPossible = process206 Collection<List<Event>> subSeqsGeneratedCopy = new LinkedHashSet<List<Event>>( 207 subSeqsGenerated); 208 Collection<List<Event>> subSeqsPossible = process 209 209 .generateSequences(length); 210 210 subSeqsGeneratedCopy.removeAll(subSeqsObserved); 211 211 subSeqsPossible.removeAll(subSeqsObserved); 212 Map<List< ? extends Event<?>>, Double> weightMap = SequenceTools212 Map<List<Event>, Double> weightMap = SequenceTools 213 213 .generateWeights(process, subSeqsPossible); 214 214 double weight = 0.0d; 215 for (List< ? extends Event<?>> subSeq : subSeqsGeneratedCopy) {215 for (List<Event> subSeq : subSeqsGeneratedCopy) { 216 216 Double currentWeight = weightMap.get(subSeq); 217 217 if( currentWeight!=null ) { … … 248 248 public int getNumNew() { 249 249 createSubSeqs(); 250 Collection<List< ? extends Event<?>>> subSeqsGeneratedCopy = new LinkedHashSet<List<? extends Event<?>>>(250 Collection<List<Event>> subSeqsGeneratedCopy = new LinkedHashSet<List<Event>>( 251 251 subSeqsGenerated); 252 252 subSeqsGeneratedCopy.removeAll(subSeqsObserved); -
trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/CoverageCalculatorProcess.java
r518 r547 33 33 * </p> 34 34 */ 35 private Collection<List< ? extends Event<?>>> sequences;35 private Collection<List<Event>> sequences; 36 36 37 37 /** … … 48 48 * </p> 49 49 */ 50 private Collection<List< ? extends Event<?>>> containedSubSeqs = null;50 private Collection<List<Event>> containedSubSeqs = null; 51 51 52 52 /** … … 56 56 * </p> 57 57 */ 58 private Collection<List< ? extends Event<?>>> allPossibleSubSeqs = null;58 private Collection<List<Event>> allPossibleSubSeqs = null; 59 59 60 60 /** … … 64 64 * </p> 65 65 */ 66 private Map<List< ? extends Event<?>>, Double> subSeqWeights = null;66 private Map<List<Event>, Double> subSeqWeights = null; 67 67 68 68 /** … … 85 85 */ 86 86 public CoverageCalculatorProcess(IStochasticProcess process, 87 Collection<List< ? extends Event<?>>> sequences, int length) {87 Collection<List<Event>> sequences, int length) { 88 88 if (process == null) { 89 89 throw new InvalidParameterException("process must not be null"); … … 159 159 } 160 160 double weight = 0.0; 161 for (List< ? extends Event<?>> subSeq : containedSubSeqs) {161 for (List<Event> subSeq : containedSubSeqs) { 162 162 Double curWeight = subSeqWeights.get(subSeq); 163 163 if( curWeight!=null ) { … … 208 208 * thrown is newSequences is null 209 209 */ 210 public void setSequences(Collection<List< ? extends Event<?>>> newSequences) {210 public void setSequences(Collection<List<Event>> newSequences) { 211 211 if (newSequences == null) { 212 212 throw new InvalidParameterException("sequences must not be null"); -
trunk/quest-core-coverage/src/main/java/de/ugoe/cs/quest/coverage/SequenceTools.java
r518 r547 46 46 * @return {@link Map} of weights 47 47 */ 48 public static Map<List< ? extends Event<?>>, Double> generateWeights(48 public static Map<List<Event>, Double> generateWeights( 49 49 IStochasticProcess process, 50 Collection<List< ? extends Event<?>>> sequences) {51 Map<List< ? extends Event<?>>, Double> subSeqWeights = new LinkedHashMap<List<? extends Event<?>>, Double>();50 Collection<List<Event>> sequences) { 51 Map<List<Event>, Double> subSeqWeights = new LinkedHashMap<List<Event>, Double>(); 52 52 if (sequences != null && !sequences.isEmpty()) { 53 53 if (process != null) { 54 54 double sum = 0.0; 55 for (List< ? extends Event<?>> sequence : sequences) {55 for (List<Event> sequence : sequences) { 56 56 double prob = process.getProbability(sequence); 57 57 subSeqWeights.put(sequence, prob); … … 59 59 } 60 60 if (sum < 1.0) { 61 for (Map.Entry<List< ? extends Event<?>>, Double> entry : subSeqWeights61 for (Map.Entry<List<Event>, Double> entry : subSeqWeights 62 62 .entrySet()) { 63 63 entry.setValue(entry.getValue() / sum); … … 65 65 } 66 66 } else { 67 for( List< ? extends Event<?>> sequence : sequences ) {67 for( List<Event> sequence : sequences ) { 68 68 subSeqWeights.put(sequence, 0.0d); 69 69 } … … 114 114 * thrown if length less or equal to 0 115 115 */ 116 public static Set<List< ? extends Event<?>>> containedSubSequences(117 Collection<List< ? extends Event<?>>> sequences, int length) {116 public static Set<List<Event>> containedSubSequences( 117 Collection<List<Event>> sequences, int length) { 118 118 if (length <= 0) { 119 119 throw new InvalidParameterException( 120 120 "length must be a positive integer"); 121 121 } 122 Set<List< ? extends Event<?>>> containedSubSeqs = new LinkedHashSet<List<? extends Event<?>>>();122 Set<List<Event>> containedSubSeqs = new LinkedHashSet<List<Event>>(); 123 123 if (sequences != null) { 124 for (List< ? extends Event<?>> sequence : sequences) {125 List<Event <?>> subSeq = new LinkedList<Event<?>>();124 for (List<Event> sequence : sequences) { 125 List<Event> subSeq = new LinkedList<Event>(); 126 126 boolean minLengthReached = false; 127 for (Event <?>event : sequence) {127 for (Event event : sequence) { 128 128 subSeq.add(event); 129 129 if (!minLengthReached) { … … 136 136 if (minLengthReached) { 137 137 if (!containedSubSeqs.contains(subSeq)) { 138 containedSubSeqs.add(new LinkedList<Event <?>>(138 containedSubSeqs.add(new LinkedList<Event>( 139 139 subSeq)); 140 140 } -
trunk/quest-core-events-test/pom.xml
r506 r547 1 <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"> 2 <modelVersion>4.0.0</modelVersion> 3 <groupId>de.ugoe.cs.quest</groupId> 4 <artifactId>quest-core-events-test</artifactId> 5 <version>0.0.1-SNAPSHOT</version> 6 <name>quest-core-events-test</name> 7 <scm> 8 <url>https://quest.informatik.uni-goettingen.de/svn/quest/trunk/quest-core-events-test</url> 9 </scm> 10 <dependencies> 11 <dependency> 12 <groupId>de.ugoe.cs.quest</groupId> 13 <artifactId>quest-core-events</artifactId> 14 <version>0.0.1-SNAPSHOT</version> 15 <scope>test</scope> 16 </dependency> 17 <dependency> 18 <groupId>junit</groupId> 19 <artifactId>junit</artifactId> 20 <version>4.8.1</version> 21 <scope>test</scope> 22 </dependency> 23 <dependency> 24 <groupId>junit-addons</groupId> 25 <artifactId>junit-addons</artifactId> 26 <version>1.4</version> 27 </dependency> 28 <dependency> 29 <groupId>nl.jqno.equalsverifier</groupId> 30 <artifactId>equalsverifier</artifactId> 31 <version>1.1.3</version> 32 </dependency> 33 </dependencies> 34 <build> 35 <pluginManagement> 36 <plugins> 37 <plugin> 38 <groupId>org.eclipse.m2e</groupId> 39 <artifactId>lifecycle-mapping</artifactId> 40 <version>1.0.0</version> 41 <configuration> 42 <lifecycleMappingMetadata> 43 <pluginExecutions> 44 <pluginExecution> 45 <pluginExecutionFilter> 46 <groupId>org.apache.maven.plugins</groupId> 47 <artifactId>maven-dependency-plugin</artifactId> 48 <versionRange>[1.0.0,)</versionRange> 49 <goals> 50 <goal>unpack</goal> 51 </goals> 52 </pluginExecutionFilter> 53 <action> 54 <ignore/> 55 </action> 56 </pluginExecution> 57 <pluginExecution> 58 <pluginExecutionFilter> 59 <groupId>org.codehaus.mojo</groupId> 60 <artifactId>emma-maven-plugin</artifactId> 61 <versionRange>[1.0-alpha-3,)</versionRange> 62 <goals> 63 <goal>emma</goal> 64 </goals> 65 </pluginExecutionFilter> 66 <action> 67 <ignore/> 68 </action> 69 </pluginExecution> 70 </pluginExecutions> 71 </lifecycleMappingMetadata> 72 </configuration> 73 </plugin> 74 </plugins> 75 </pluginManagement> 76 <plugins> 77 <plugin> 78 <groupId>org.apache.maven.plugins</groupId> 79 <artifactId>maven-compiler-plugin</artifactId> 80 <version>2.3.2</version> 81 <configuration> 82 <source>1.6</source> 83 <target>1.6</target> 84 </configuration> 85 </plugin> 86 <plugin> 87 <groupId>org.apache.maven.plugins</groupId> 88 <artifactId>maven-dependency-plugin</artifactId> 89 <version>2.4</version> 90 <executions> 91 <execution> 92 <id>unpack</id> 93 <phase>process-classes</phase> 94 <goals> 95 <goal>unpack</goal> 96 </goals> 97 <configuration> 98 <artifactItems> 99 <artifactItem> 100 <groupId>de.ugoe.cs.quest</groupId> 101 <artifactId>quest-core-events</artifactId> 102 <version>0.0.1-SNAPSHOT</version> 103 <outputDirectory>${project.build.directory}/classes</outputDirectory> 104 </artifactItem> 105 </artifactItems> 106 </configuration> 107 </execution> 108 </executions> 109 </plugin> 110 <plugin> 111 <groupId>org.codehaus.mojo</groupId> 112 <artifactId>emma-maven-plugin</artifactId> 113 <version>1.0-alpha-3</version> 114 <inherited>true</inherited> 115 <executions> 116 <execution> 117 <phase>process-classes</phase> 118 <goals> 119 <goal>emma</goal> 120 </goals> 121 </execution> 122 </executions> 123 </plugin> 124 <plugin> 125 <groupId>org.apache.maven.plugins</groupId> 126 <artifactId>maven-jar-plugin</artifactId> 127 <version>2.3.2</version> 128 <executions> 129 <execution> 130 <goals> 131 <goal>test-jar</goal> 132 </goals> 133 </execution> 134 </executions> 135 </plugin> 136 </plugins> 137 </build> 1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 3 <modelVersion>4.0.0</modelVersion> 4 <groupId>de.ugoe.cs.quest</groupId> 5 <artifactId>quest-core-events-test</artifactId> 6 <version>0.0.1-SNAPSHOT</version> 7 <name>quest-core-events-test</name> 8 <scm> 9 <url>https://quest.informatik.uni-goettingen.de/svn/quest/trunk/quest-core-events-test</url> 10 </scm> 11 <dependencies> 12 <dependency> 13 <groupId>de.ugoe.cs.quest</groupId> 14 <artifactId>quest-core-events</artifactId> 15 <version>0.0.1-SNAPSHOT</version> 16 <scope>test</scope> 17 </dependency> 18 <dependency> 19 <groupId>junit</groupId> 20 <artifactId>junit</artifactId> 21 <version>4.8.1</version> 22 <scope>test</scope> 23 </dependency> 24 <dependency> 25 <groupId>junit-addons</groupId> 26 <artifactId>junit-addons</artifactId> 27 <version>1.4</version> 28 </dependency> 29 <dependency> 30 <groupId>nl.jqno.equalsverifier</groupId> 31 <artifactId>equalsverifier</artifactId> 32 <version>1.1.3</version> 33 </dependency> 34 <dependency> 35 <groupId>org.mockito</groupId> 36 <artifactId>mockito-core</artifactId> 37 <version>1.9.0</version> 38 <scope>test</scope> 39 </dependency> 40 </dependencies> 41 <build> 42 <pluginManagement> 43 <plugins> 44 <plugin> 45 <groupId>org.eclipse.m2e</groupId> 46 <artifactId>lifecycle-mapping</artifactId> 47 <version>1.0.0</version> 48 <configuration> 49 <lifecycleMappingMetadata> 50 <pluginExecutions> 51 <pluginExecution> 52 <pluginExecutionFilter> 53 <groupId>org.apache.maven.plugins</groupId> 54 <artifactId>maven-dependency-plugin</artifactId> 55 <versionRange>[1.0.0,)</versionRange> 56 <goals> 57 <goal>unpack</goal> 58 </goals> 59 </pluginExecutionFilter> 60 <action> 61 <ignore /> 62 </action> 63 </pluginExecution> 64 <pluginExecution> 65 <pluginExecutionFilter> 66 <groupId>org.codehaus.mojo</groupId> 67 <artifactId>emma-maven-plugin</artifactId> 68 <versionRange>[1.0-alpha-3,)</versionRange> 69 <goals> 70 <goal>emma</goal> 71 </goals> 72 </pluginExecutionFilter> 73 <action> 74 <ignore /> 75 </action> 76 </pluginExecution> 77 </pluginExecutions> 78 </lifecycleMappingMetadata> 79 </configuration> 80 </plugin> 81 </plugins> 82 </pluginManagement> 83 <plugins> 84 <plugin> 85 <groupId>org.apache.maven.plugins</groupId> 86 <artifactId>maven-compiler-plugin</artifactId> 87 <version>2.3.2</version> 88 <configuration> 89 <source>1.6</source> 90 <target>1.6</target> 91 </configuration> 92 </plugin> 93 <plugin> 94 <groupId>org.apache.maven.plugins</groupId> 95 <artifactId>maven-dependency-plugin</artifactId> 96 <version>2.4</version> 97 <executions> 98 <execution> 99 <id>unpack</id> 100 <phase>process-classes</phase> 101 <goals> 102 <goal>unpack</goal> 103 </goals> 104 <configuration> 105 <artifactItems> 106 <artifactItem> 107 <groupId>de.ugoe.cs.quest</groupId> 108 <artifactId>quest-core-events</artifactId> 109 <version>0.0.1-SNAPSHOT</version> 110 <outputDirectory>${project.build.directory}/classes</outputDirectory> 111 </artifactItem> 112 </artifactItems> 113 </configuration> 114 </execution> 115 </executions> 116 </plugin> 117 <plugin> 118 <groupId>org.codehaus.mojo</groupId> 119 <artifactId>emma-maven-plugin</artifactId> 120 <version>1.0-alpha-3</version> 121 <inherited>true</inherited> 122 <executions> 123 <execution> 124 <phase>process-classes</phase> 125 <goals> 126 <goal>emma</goal> 127 </goals> 128 </execution> 129 </executions> 130 </plugin> 131 <plugin> 132 <groupId>org.apache.maven.plugins</groupId> 133 <artifactId>maven-jar-plugin</artifactId> 134 <version>2.3.2</version> 135 <executions> 136 <execution> 137 <goals> 138 <goal>test-jar</goal> 139 </goals> 140 </execution> 141 </executions> 142 </plugin> 143 </plugins> 144 </build> 138 145 </project> -
trunk/quest-core-events-test/src/test/java/de/ugoe/cs/quest/SequenceInstanceOfTest.java
r481 r547 25 25 @Test 26 26 public void TestIsCollectionOfSequences_1() throws Exception { 27 Collection<List< ? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();28 List<Event <?>> sequence1 = new ArrayList<Event<?>>();27 Collection<List<Event>> sequences = new LinkedList<List<Event>>(); 28 List<Event> sequence1 = new ArrayList<Event>(); 29 29 sequence1.add(new Event<String>("a")); 30 30 sequences.add(sequence1); … … 36 36 @Test 37 37 public void TestIsCollectionOfSequences_2() throws Exception { 38 Collection<List< ? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();39 List<Event <?>> sequence1 = new ArrayList<Event<?>>();38 Collection<List<Event>> sequences = new LinkedList<List<Event>>(); 39 List<Event> sequence1 = new ArrayList<Event>(); 40 40 sequences.add(sequence1); 41 41 … … 46 46 @Test 47 47 public void TestIsCollectionOfSequences_3() throws Exception { 48 Collection<List< ? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();48 Collection<List<Event>> sequences = new LinkedList<List<Event>>(); 49 49 50 50 boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences); … … 66 66 @Test 67 67 public void TestIsEventSequence_1() throws Exception { 68 List<Event <?>> sequence = new ArrayList<Event<?>>();68 List<Event> sequence = new ArrayList<Event>(); 69 69 sequence.add(new Event<String>("a")); 70 70 … … 75 75 @Test 76 76 public void TestIsEventSequence_2() throws Exception { 77 List<Event <?>> sequence = new ArrayList<Event<?>>();77 List<Event> sequence = new ArrayList<Event>(); 78 78 79 79 boolean result = SequenceInstanceOf.isEventSequence(sequence); -
trunk/quest-core-events-test/src/test/java/de/ugoe/cs/quest/eventcore/EventTest.java
r481 r547 1 1 2 package de.ugoe.cs.quest.eventcore; 2 3 3 import nl.jqno.equalsverifier.EqualsVerifier;4 import nl.jqno.equalsverifier.Warning;5 4 6 5 import org.junit.*; 7 6 8 7 import de.ugoe.cs.quest.eventcore.Event; 9 import de.ugoe.cs.quest.eventcore.ReplayableEvent;10 8 11 9 import static org.junit.Assert.*; 10 import static org.mockito.Mockito.*; 12 11 13 12 /** 14 * The class <code>EventTest</code> contains tests for the class 15 * <code>{@link Event}</code>. 13 * The class <code>EventTest</code> contains tests for the class <code>{@link Event}</code>. 16 14 * 17 15 * @author Steffen Herbold … … 20 18 public class EventTest { 21 19 22 @Test 23 public void testEvent_1() throws Exception { 24 String type = "typeString"; 25 26 Event<String> result = new Event<String>(type); 27 28 assertNotNull(result); 29 assertEquals(type, result.type); 30 assertNull(result.target); 31 assertNull(result.targetShort); 32 assertEquals("", result.idInfo); 33 } 34 35 @Test(expected = java.security.InvalidParameterException.class) 36 public void testEvent_2() throws Exception { 37 new Event<String>(null); 38 } 39 40 @Test 41 public void testEquals_1() throws Exception { 42 String type1 = "typeString"; 43 String type2 = "typeString"; 44 Event<String> fixture = new Event<String>(type1); 45 Event<String> other = new Event<String>(type2); 46 47 boolean result = fixture.equals(other); 48 49 assertTrue(result); 50 } 51 52 @Test 53 public void testEquals_2() throws Exception { 54 String type1 = "typeString1"; 55 String type2 = "typeString2"; 56 Event<String> fixture = new Event<String>(type1); 57 Event<String> other = new Event<String>(type2); 58 59 boolean result = fixture.equals(other); 60 61 assertFalse(result); 62 } 63 64 @Test 65 public void testEquals_3() throws Exception { 66 String type1 = "typeString"; 67 String type2 = "typeString"; 68 String target1 = "target"; 69 String target2 = "target"; 70 Event<String> fixture = new Event<String>(type1); 71 fixture.target = target1; 72 Event<String> other = new Event<String>(type2); 73 other.target = target2; 74 75 boolean result = fixture.equals(other); 76 77 assertTrue(result); 78 } 79 80 @Test 81 public void testEquals_4() throws Exception { 82 String type1 = "typeString1"; 83 String type2 = "typeString2"; 84 String target1 = "target"; 85 String target2 = "target"; 86 Event<String> fixture = new Event<String>(type1); 87 fixture.target = target1; 88 Event<String> other = new Event<String>(type2); 89 other.target = target2; 90 91 boolean result = fixture.equals(other); 92 93 assertFalse(result); 94 } 95 96 @Test 97 public void testEquals_5() throws Exception { 98 String type1 = "typeString"; 99 String type2 = "typeString"; 100 String target1 = "target1"; 101 String target2 = "target2"; 102 Event<String> fixture = new Event<String>(type1); 103 fixture.target = target1; 104 Event<String> other = new Event<String>(type2); 105 other.target = target2; 106 107 boolean result = fixture.equals(other); 108 109 assertFalse(result); 110 } 111 112 @Test 113 public void testEquals_6() throws Exception { 114 String type = "typeString"; 115 Event<String> fixture = new Event<String>(type); 116 117 boolean result = fixture.equals(fixture); 118 119 assertTrue(result); 120 } 121 122 @Test 123 public void testEqualsContract() throws Exception { 124 EqualsVerifier.forClass(Event.class) 125 .suppress(Warning.NONFINAL_FIELDS).withRedefinedSubclass(ReplayableEvent.class) 126 .verify(); 127 } 128 129 @Test 130 public void testGetIdInfo_fixture_1() throws Exception { 131 String type = "typeString"; 132 String idInfo = "idInfoString"; 133 Event<String> fixture = new Event<String>(type); 134 fixture.idInfo = idInfo; 135 136 String result = fixture.getIdInfo(); 137 138 assertEquals(idInfo, result); 139 } 140 141 @Test 142 public void testGetShortId_1() throws Exception { 143 String type = "typeString"; 144 String targetShort = "targetShortString"; 145 Event<String> fixture = new Event<String>(type); 146 fixture.targetShort = targetShort; 147 148 String result = fixture.getShortId(); 149 150 assertEquals("targetShortString.typeString", result); 151 } 152 153 @Test 154 public void testGetShortId_2() throws Exception { 155 String type = "typeString"; 156 String targetShort = "targetShortString"; 157 String idInfo = "idInfoString"; 158 Event<String> fixture = new Event<String>(type); 159 fixture.targetShort = targetShort; 160 fixture.idInfo = idInfo; 161 162 String result = fixture.getShortId(); 163 164 assertEquals("targetShortString.typeString.idInfoString", result); 165 } 166 167 @Test 168 public void testGetShortId_3() throws Exception { 169 String type = "typeString"; 170 String target = "targetString"; 171 Event<String> fixture = new Event<String>(type); 172 fixture.target = target; 173 174 String result = fixture.getShortId(); 175 176 assertEquals("targetString.typeString", result); 177 } 178 179 @Test 180 public void testGetStandardId_1() throws Exception { 181 String type = "typeString"; 182 String target = "targetString"; 183 Event<String> fixture = new Event<String>(type); 184 fixture.target = target; 185 186 String result = fixture.getStandardId(); 187 188 assertEquals("targetString.typeString", result); 189 } 190 191 @Test 192 public void testGetStandardId_2() throws Exception { 193 String type = "typeString"; 194 String target = "targetString"; 195 String idInfo = "idInfoString"; 196 Event<String> fixture = new Event<String>(type); 197 fixture.target = target; 198 fixture.idInfo = idInfo; 199 200 String result = fixture.getStandardId(); 201 202 assertEquals("targetString.typeString.idInfoString", result); 203 } 204 205 @Test 206 public void testGetStandardId_3() throws Exception { 207 String type = "typeString"; 208 Event<String> fixture = new Event<String>(type); 209 210 String result = fixture.getStandardId(); 211 212 assertEquals("typeString", result); 213 } 214 215 @Test 216 public void testGetStandardId_4() throws Exception { 217 String type = "typeString"; 218 String idInfo = "idInfoString"; 219 Event<String> fixture = new Event<String>(type); 220 fixture.idInfo = idInfo; 221 222 String result = fixture.getStandardId(); 223 224 assertEquals("typeString.idInfoString", result); 225 } 226 227 @Test 228 public void testGetTarget_1() throws Exception { 229 String type = "typeString"; 230 String target = "targetString"; 231 Event<String> fixture = new Event<String>(type); 232 fixture.target = target; 233 234 String result = fixture.getTarget(); 235 236 assertEquals(target, result); 237 } 238 239 @Test 240 public void testGetTarget_2() throws Exception { 241 String type = "typeString"; 242 Event<String> fixture = new Event<String>(type); 243 244 String result = fixture.getTarget(); 245 246 assertNull(result); 247 } 248 249 @Test 250 public void testGetTargetShort_1() throws Exception { 251 String type = "typeString"; 252 String targetShort = "targetShort"; 253 Event<String> fixture = new Event<String>(type); 254 fixture.targetShort = targetShort; 255 256 String result = fixture.getTargetShort(); 257 258 assertEquals(targetShort, result); 259 } 260 261 @Test 262 public void testGetTargetShort_2() throws Exception { 263 String type = "typeString"; 264 Event<String> fixture = new Event<String>(type); 265 266 String result = fixture.getTargetShort(); 267 268 assertNull(result); 269 } 270 271 @Test 272 public void testGetType_1() throws Exception { 273 String type = "typeString"; 274 Event<String> fixture = new Event<String>(type); 275 276 String result = fixture.getType(); 277 278 assertEquals(type, result); 279 } 280 281 @Test 282 public void testSetIdInfo_fixture_1() throws Exception { 283 String type = "typeString"; 284 String idInfo = "idInfoString"; 285 Event<String> fixture = new Event<String>(type); 286 287 fixture.setIdInfo(idInfo); 288 289 assertEquals(idInfo, fixture.idInfo); 290 } 291 292 @Test 293 public void testSetIdInfo_2() throws Exception { 294 String type = "typeString"; 295 String idInfo = null; 296 Event<String> fixture = new Event<String>(type); 297 298 fixture.setIdInfo(idInfo); 299 300 assertEquals(idInfo, fixture.idInfo); 301 } 302 303 @Test 304 public void testSetTarget_1() throws Exception { 305 String type = "typeString"; 306 String target = "targetString"; 307 Event<String> fixture = new Event<String>(type); 308 309 boolean result = fixture.setTarget(target); 310 311 assertTrue(result); 312 assertEquals(target, fixture.target); 313 } 314 315 @Test 316 public void testSetTarget_2() throws Exception { 317 String type = "typeString"; 318 String target1 = "targetString1"; 319 String target2 = "targetString2"; 320 Event<String> fixture = new Event<String>(type); 321 fixture.target = target1; 322 323 boolean result = fixture.setTarget(target2); 324 325 assertFalse(result); 326 assertEquals(target1, fixture.target); 327 } 328 329 @Test 330 public void testSetTargetShort_1() throws Exception { 331 String type = "typeString"; 332 String targetShort = "targetShortString"; 333 Event<String> fixture = new Event<String>(type); 334 335 boolean result = fixture.setTargetShort(targetShort); 336 337 assertTrue(result); 338 assertEquals(targetShort, fixture.targetShort); 339 } 340 341 @Test 342 public void testSetTargetShort_2() throws Exception { 343 String type = "typeString"; 344 String targetShort1 = "targetShortString1"; 345 String targetShort2 = "targetShortString2"; 346 Event<String> fixture = new Event<String>(type); 347 fixture.targetShort = targetShort1; 348 349 boolean result = fixture.setTargetShort(targetShort2); 350 351 assertFalse(result); 352 assertEquals(targetShort1, fixture.targetShort); 353 } 354 355 @Test 356 public void testToString_1() throws Exception { 357 String type = "typeString"; 358 String target = "targetString"; 359 Event<String> fixture = new Event<String>(type); 360 fixture.target = target; 361 362 String result = fixture.toString(); 363 364 assertEquals("targetString.typeString", result); 365 } 366 367 @Test 368 public void testToString_2() throws Exception { 369 String type = "typeString"; 370 String target = "targetString"; 371 String idInfo = "idInfoString"; 372 Event<String> fixture = new Event<String>(type); 373 fixture.target = target; 374 fixture.idInfo = idInfo; 375 376 String result = fixture.toString(); 377 378 assertEquals("targetString.typeString.idInfoString", result); 379 } 380 381 @Test 382 public void testToString_3() throws Exception { 383 String type = "typeString"; 384 Event<String> fixture = new Event<String>(type); 385 386 String result = fixture.toString(); 387 388 assertEquals("typeString", result); 389 } 390 391 @Test 392 public void testToString_4() throws Exception { 393 String type = "typeString"; 394 String idInfo = "idInfoString"; 395 Event<String> fixture = new Event<String>(type); 396 fixture.idInfo = idInfo; 397 398 String result = fixture.toString(); 399 400 assertEquals("typeString.idInfoString", result); 401 } 402 403 public static void main(String[] args) { 404 new org.junit.runner.JUnitCore().run(EventTest.class); 405 } 20 @Test 21 public void testEvent_1() throws Exception { 22 Event result = new Event(mock(IEventType.class)); 23 24 assertNotNull(result); 25 } 26 27 @Test(expected = java.security.InvalidParameterException.class) 28 public void testEvent_2() throws Exception { 29 new Event(null); 30 } 31 32 /* 33 @Test 34 public void testEquals_1() throws Exception { 35 IEventType type1 = mock(IEventType.class); 36 IEventType type2 = mock(IEventType.class); 37 // when(type1.equals(type2)).thenReturn(true); 38 Event fixture = new Event(type1); 39 Event other = new Event(type2); 40 41 boolean result = fixture.equals(other); 42 43 assertTrue(result); 44 } 45 46 @Test 47 public void testEquals_2() throws Exception { 48 String type1 = "typeString1"; 49 String type2 = "typeString2"; 50 Event fixture = new Event(type1); 51 Event other = new Event(type2); 52 53 boolean result = fixture.equals(other); 54 55 assertFalse(result); 56 } 57 58 @Test 59 public void testEquals_3() throws Exception { 60 String type1 = "typeString"; 61 String type2 = "typeString"; 62 String target1 = "target"; 63 String target2 = "target"; 64 Event fixture = new Event(type1); 65 fixture.target = target1; 66 Event other = new Event(type2); 67 other.target = target2; 68 69 boolean result = fixture.equals(other); 70 71 assertTrue(result); 72 } 73 74 @Test 75 public void testEquals_4() throws Exception { 76 String type1 = "typeString1"; 77 String type2 = "typeString2"; 78 String target1 = "target"; 79 String target2 = "target"; 80 Event fixture = new Event(type1); 81 fixture.target = target1; 82 Event other = new Event(type2); 83 other.target = target2; 84 85 boolean result = fixture.equals(other); 86 87 assertFalse(result); 88 } 89 90 @Test 91 public void testEquals_5() throws Exception { 92 String type1 = "typeString"; 93 String type2 = "typeString"; 94 String target1 = "target1"; 95 String target2 = "target2"; 96 Event fixture = new Event(type1); 97 fixture.target = target1; 98 Event other = new Event(type2); 99 other.target = target2; 100 101 boolean result = fixture.equals(other); 102 103 assertFalse(result); 104 } 105 106 @Test 107 public void testEquals_6() throws Exception { 108 String type = "typeString"; 109 Event fixture = new Event(type); 110 111 boolean result = fixture.equals(fixture); 112 113 assertTrue(result); 114 } 115 116 @Test 117 public void testEqualsContract() throws Exception { 118 EqualsVerifier.forClass(Event.class).suppress(Warning.NONFINAL_FIELDS) 119 .withRedefinedSubclass(ReplayableEvent.class).verify(); 120 } 121 */ 122 123 @Test 124 public void testGetTarget_1() throws Exception { 125 IEventType type = mock(IEventType.class); 126 IEventTarget target = mock(IEventTarget.class); 127 128 Event fixture = new Event(type); 129 fixture.setTarget(target); 130 131 IEventTarget result = fixture.getTarget(); 132 133 assertSame(target, result); 134 } 135 136 137 138 @Test 139 public void testGetTarget_2() throws Exception { 140 IEventType type = mock(IEventType.class); 141 IEventTarget target = mock(IEventTarget.class); 142 143 Event fixture = new Event(type, target); 144 145 IEventTarget result = fixture.getTarget(); 146 147 assertSame(target, result); 148 } 149 150 @Test 151 public void testGetTarget_3() throws Exception { 152 IEventType type = mock(IEventType.class); 153 154 Event fixture = new Event(type); 155 156 IEventTarget result = fixture.getTarget(); 157 158 assertNull(result); 159 } 160 161 @Test 162 public void testGetType_1() throws Exception { 163 IEventType type = mock(IEventType.class); 164 165 Event fixture = new Event(type); 166 167 IEventType result = fixture.getType(); 168 169 assertEquals(type, result); 170 } 171 172 @Test 173 public void testSetTarget_1() throws Exception { 174 IEventType type = mock(IEventType.class); 175 IEventTarget target = mock(IEventTarget.class); 176 177 Event fixture = new Event(type); 178 179 boolean result = fixture.setTarget(target); 180 181 assertTrue(result); 182 assertEquals(target, fixture.getTarget()); 183 } 184 185 @Test 186 public void testSetTarget_2() throws Exception { 187 IEventType type = mock(IEventType.class); 188 IEventTarget target1 = mock(IEventTarget.class); 189 IEventTarget target2 = mock(IEventTarget.class); 190 191 Event fixture = new Event(type); 192 193 fixture.setTarget(target1); 194 boolean result = fixture.setTarget(target2); 195 196 assertFalse(result); 197 assertEquals(target1, fixture.target); 198 } 199 200 @Test 201 public void testSetTarget_3() throws Exception { 202 IEventType type = mock(IEventType.class); 203 IEventTarget target1 = mock(IEventTarget.class); 204 IEventTarget target2 = mock(IEventTarget.class); 205 206 Event fixture = new Event(type, target1); 207 208 boolean result = fixture.setTarget(target2); 209 210 assertFalse(result); 211 assertEquals(target1, fixture.target); 212 } 213 214 @Test 215 public void testToString_1() throws Exception { 216 IEventType type = mock(IEventType.class); 217 when(type.toString()).thenReturn("typeString"); 218 IEventTarget target = mock(IEventTarget.class); 219 when(target.toString()).thenReturn("targetString"); 220 221 Event fixture = new Event(type, target); 222 223 String result = fixture.toString(); 224 225 assertEquals("(typeString;targetString)", result); 226 } 227 228 public static void main(String[] args) { 229 new org.junit.runner.JUnitCore().run(EventTest.class); 230 } 406 231 } -
trunk/quest-core-testgeneration/src/main/java/de/ugoe/cs/quest/testgeneration/DrawFromAllSequencesGenerator.java
r523 r547 127 127 * @return the test suite 128 128 */ 129 public Collection<List< ? extends Event<?>>> generateTestSuite(129 public Collection<List<Event>> generateTestSuite( 130 130 IStochasticProcess model) { 131 131 if (model == null) { … … 133 133 } 134 134 135 Collection<List< ? extends Event<?>>> sequences = new LinkedHashSet<List<? extends Event<?>>>();135 Collection<List<Event>> sequences = new LinkedHashSet<List<Event>>(); 136 136 for (int length = minLength; length <= maxLength; length++) { 137 137 if (validEnd) { … … 145 145 List<Double> probabilities = new ArrayList<Double>(sequences.size()); 146 146 double probSum = 0.0; 147 for (List< ? extends Event<?>> sequence : sequences) {147 for (List<Event> sequence : sequences) { 148 148 double prob = model.getProbability(sequence); 149 149 probabilities.add(prob); … … 167 167 } 168 168 } 169 Collection<List< ? extends Event<?>>> retainedSequences = new LinkedList<List<? extends Event<?>>>();169 Collection<List<Event>> retainedSequences = new LinkedList<List<Event>>(); 170 170 int index = 0; 171 for (List< ? extends Event<?>> sequence : sequences) {171 for (List<Event> sequence : sequences) { 172 172 if (drawnSequences.contains(index)) { 173 173 retainedSequences.add(sequence); -
trunk/quest-core-testgeneration/src/main/java/de/ugoe/cs/quest/testgeneration/HybridGenerator.java
r523 r547 107 107 * @return the test suite 108 108 */ 109 public Collection<List< ? extends Event<?>>> generateTestSuite(109 public Collection<List<Event>> generateTestSuite( 110 110 IStochasticProcess model) { 111 111 if (model == null) { … … 113 113 } 114 114 115 Collection<List< ? extends Event<?>>> sequences = new LinkedHashSet<List<? extends Event<?>>>();116 117 List<List< ? extends Event<?>>> seqsTmp = new ArrayList<List<? extends Event<?>>>(115 Collection<List<Event>> sequences = new LinkedHashSet<List<Event>>(); 116 117 List<List<Event>> seqsTmp = new ArrayList<List<Event>>( 118 118 model.generateSequences(maxLengthAll + 1, true)); 119 119 … … 122 122 List<Double> probabilities = new ArrayList<Double>(seqsTmp.size()); 123 123 double probSum = 0.0; 124 for (List< ? extends Event<?>> sequence : seqsTmp) {124 for (List<Event> sequence : seqsTmp) { 125 125 double prob = model.getProbability(sequence); 126 126 probabilities.add(prob); … … 140 140 sum += currentProb; 141 141 } 142 List< ? extends Event<?>> seqTmp = seqsTmp.get(index);142 List<Event> seqTmp = seqsTmp.get(index); 143 143 if (!Event.ENDEVENT.equals(seqTmp.get(seqTmp.size() - 1))) { 144 List< ? extends Event<?>> sequence;144 List<Event> sequence; 145 145 if (validEnd) { 146 146 sequence = finishSequence(seqTmp, model, length + 2, … … 180 180 * @return finished sequence of the desired length 181 181 */ 182 private List< ? extends Event<?>> finishSequence(183 List< ? extends Event<?>> sequence, IStochasticProcess model,182 private List<Event> finishSequence( 183 List<Event> sequence, IStochasticProcess model, 184 184 int length, boolean validEnd) { 185 185 Random r = new Random(); 186 186 boolean endFound = false; 187 List<Event <?>> sequenceCopy = new LinkedList<Event<?>>(sequence);187 List<Event> sequenceCopy = new LinkedList<Event>(sequence); 188 188 final int maxIter = 30000; 189 189 int iter = 0; 190 190 while (!endFound && iter < maxIter) { 191 191 iter++; 192 sequenceCopy = new LinkedList<Event <?>>(sequence);192 sequenceCopy = new LinkedList<Event>(sequence); 193 193 while (!endFound && sequenceCopy.size() <= length) { 194 194 double randVal = r.nextDouble(); 195 195 double probSum = 0.0; 196 for (Event <?>symbol : model.getEvents()) {196 for (Event symbol : model.getEvents()) { 197 197 probSum += model.getProbability(sequenceCopy, symbol); 198 198 if (probSum >= randVal) { -
trunk/quest-core-testgeneration/src/main/java/de/ugoe/cs/quest/testgeneration/RandomWalkGenerator.java
r523 r547 138 138 * @return the test suite 139 139 */ 140 @SuppressWarnings("unchecked") 141 public Collection<List<? extends Event<?>>> generateTestSuite( 140 public Collection<List<Event>> generateTestSuite( 142 141 IStochasticProcess model) { 143 142 if (model == null) { … … 145 144 } 146 145 147 Set<List< ? extends Event<?>>> sequences = new HashSet<List<? extends Event<?>>>(146 Set<List<Event>> sequences = new HashSet<List<Event>>( 148 147 numSequences); 149 148 actualIter = 0; 150 149 while (sequences.size() < numSequences && actualIter < maxIter) { 151 List< ? extends Event<?>> generatedSequence = model.randomSequence(150 List<Event> generatedSequence = model.randomSequence( 152 151 maxLength, validEnd); 153 152 if (generatedSequence.size() >= minLength 154 153 && generatedSequence.size() <= maxLength) { 155 ((List<Event <?>>) generatedSequence).add(0, Event.STARTEVENT);154 ((List<Event>) generatedSequence).add(0, Event.STARTEVENT); 156 155 if (validEnd) { 157 ((List<Event <?>>) generatedSequence).add(Event.ENDEVENT);156 ((List<Event>) generatedSequence).add(Event.ENDEVENT); 158 157 } 159 158 sequences.add(generatedSequence); -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/DeterministicFiniteAutomaton.java
r518 r547 51 51 */ 52 52 @Override 53 public double getProbability(List< ? extends Event<?>> context,54 Event <?>symbol) {53 public double getProbability(List<Event> context, 54 Event symbol) { 55 55 if( context==null ) { 56 56 throw new InvalidParameterException("context must not be null"); … … 61 61 double result = 0.0d; 62 62 63 List<Event <?>> contextCopy;63 List<Event> contextCopy; 64 64 if (context.size() >= trieOrder) { 65 contextCopy = new LinkedList<Event <?>>(context.subList(65 contextCopy = new LinkedList<Event>(context.subList( 66 66 context.size() - trieOrder + 1, context.size())); 67 67 } else { 68 contextCopy = new LinkedList<Event <?>>(context);68 contextCopy = new LinkedList<Event>(context); 69 69 } 70 70 71 Collection<Event <?>> followers = trie.getFollowingSymbols(contextCopy);71 Collection<Event> followers = trie.getFollowingSymbols(contextCopy); 72 72 73 73 if (followers.size() != 0 && followers.contains(symbol)) { -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/FirstOrderMarkovModel.java
r518 r547 67 67 */ 68 68 private Matrix getTransmissionMatrix() { 69 List<Event <?>> knownSymbols = new ArrayList<Event<?>>(69 List<Event> knownSymbols = new ArrayList<Event>( 70 70 trie.getKnownSymbols()); 71 71 int numStates = knownSymbols.size(); … … 73 73 74 74 for (int i = 0; i < numStates; i++) { 75 Event <?>currentSymbol = knownSymbols.get(i);76 List<Event <?>> context = new ArrayList<Event<?>>();75 Event currentSymbol = knownSymbols.get(i); 76 List<Event> context = new ArrayList<Event>(); 77 77 context.add(currentSymbol); 78 78 for (int j = 0; j < numStates; j++) { 79 Event <?>follower = knownSymbols.get(j);79 Event follower = knownSymbols.get(j); 80 80 double prob = getProbability(context, follower); 81 81 transmissionMatrix.set(i, j, prob); … … 96 96 public double calcEntropy() { 97 97 Matrix transmissionMatrix = getTransmissionMatrix(); 98 List<Event <?>> knownSymbols = new ArrayList<Event<?>>(98 List<Event> knownSymbols = new ArrayList<Event>( 99 99 trie.getKnownSymbols()); 100 100 int numStates = knownSymbols.size(); … … 173 173 stringBuilder.append("digraph model {" + StringTools.ENDLINE); 174 174 175 List<Event <?>> knownSymbols = new ArrayList<Event<?>>(176 trie.getKnownSymbols()); 177 for (Event <?>symbol : knownSymbols) {175 List<Event> knownSymbols = new ArrayList<Event>( 176 trie.getKnownSymbols()); 177 for (Event symbol : knownSymbols) { 178 178 final String thisSaneId = symbol.getShortId().replace("\"", "\\\"") 179 179 .replaceAll("[\r\n]", ""); 180 180 stringBuilder.append(" " + knownSymbols.indexOf(symbol) + " [label=\"" 181 181 + thisSaneId + "\"];" + StringTools.ENDLINE); 182 List<Event <?>> context = new ArrayList<Event<?>>();182 List<Event> context = new ArrayList<Event>(); 183 183 context.add(symbol); 184 Collection<Event <?>> followers = trie.getFollowingSymbols(context);185 for (Event <?>follower : followers) {184 Collection<Event> followers = trie.getFollowingSymbols(context); 185 for (Event follower : followers) { 186 186 stringBuilder.append(" " + knownSymbols.indexOf(symbol) + " -> " 187 187 + knownSymbols.indexOf(follower) + " "); … … 206 206 Graph<String, MarkovEdge> graph = new SparseMultigraph<String, MarkovEdge>(); 207 207 208 List<Event <?>> knownSymbols = new ArrayList<Event<?>>(209 trie.getKnownSymbols()); 210 211 for (Event <?>symbol : knownSymbols) {208 List<Event> knownSymbols = new ArrayList<Event>( 209 trie.getKnownSymbols()); 210 211 for (Event symbol : knownSymbols) { 212 212 String from = symbol.getShortId(); 213 List<Event <?>> context = new ArrayList<Event<?>>();213 List<Event> context = new ArrayList<Event>(); 214 214 context.add(symbol); 215 215 216 Collection<Event <?>> followers = trie.getFollowingSymbols(context);217 218 for (Event <?>follower : followers) {216 Collection<Event> followers = trie.getFollowingSymbols(context); 217 218 for (Event follower : followers) { 219 219 String to = follower.getShortId(); 220 220 MarkovEdge prob = new MarkovEdge(getProbability(context, -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/HighOrderMarkovModel.java
r518 r547 53 53 */ 54 54 @Override 55 public double getProbability(List< ? extends Event<?>> context,56 Event <?>symbol) {55 public double getProbability(List<Event> context, 56 Event symbol) { 57 57 if (context == null) { 58 58 throw new InvalidParameterException("context must not be null"); … … 63 63 double result = 0.0d; 64 64 65 List<Event <?>> contextCopy;65 List<Event> contextCopy; 66 66 if (context.size() >= trieOrder) { 67 contextCopy = new LinkedList<Event <?>>(context.subList(67 contextCopy = new LinkedList<Event>(context.subList( 68 68 context.size() - trieOrder + 1, context.size())); 69 69 } else { 70 contextCopy = new LinkedList<Event <?>>(context);70 contextCopy = new LinkedList<Event>(context); 71 71 } 72 72 73 Collection<Event <?>> followers = trie.getFollowingSymbols(contextCopy);73 Collection<Event> followers = trie.getFollowingSymbols(contextCopy); 74 74 int sumCountFollowers = 0; // N(s\sigma') 75 for (Event <?>follower : followers) {75 for (Event follower : followers) { 76 76 sumCountFollowers += trie.getCount(contextCopy, follower); 77 77 } -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/IStochasticProcess.java
r518 r547 34 34 * thrown if context or symbol is null 35 35 */ 36 double getProbability(List< ? extends Event<?>> context, Event<?>symbol);36 double getProbability(List<Event> context, Event symbol); 37 37 38 38 /** … … 48 48 * thrown if sequence is null 49 49 */ 50 double getProbability(List< ? extends Event<?>> sequence);50 double getProbability(List<Event> sequence); 51 51 52 52 /** … … 58 58 * @return randomly generated sequence 59 59 */ 60 public List< ? extends Event<?>> randomSequence();60 public List<Event> randomSequence(); 61 61 62 62 /** … … 81 81 * 82 82 */ 83 public List< ? extends Event<?>> randomSequence(int maxLength,83 public List<Event> randomSequence(int maxLength, 84 84 boolean validEnd); 85 85 … … 98 98 * thrown if length is less than or equal to 0 99 99 */ 100 public Collection<List< ? extends Event<?>>> generateSequences(int length);100 public Collection<List<Event>> generateSequences(int length); 101 101 102 102 /** … … 118 118 * thrown if length is less than or equal to 0 119 119 */ 120 public Collection<List< ? extends Event<?>>> generateSequences(int length,120 public Collection<List<Event>> generateSequences(int length, 121 121 boolean fromStart); 122 122 … … 135 135 * thrown if length is less than or equal to 0 136 136 */ 137 public Collection<List< ? extends Event<?>>> generateValidSequences(137 public Collection<List<Event>> generateValidSequences( 138 138 int length); 139 139 … … 190 190 * @return events known by the process 191 191 */ 192 public Collection< ? extends Event<?>> getEvents();192 public Collection<Event> getEvents(); 193 193 194 194 } -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/ModelFlattener.java
r518 r547 27 27 private static final String EVENT_SEPARATOR = "-=-"; 28 28 29 Trie<Event <?>> firstOrderTrie;29 Trie<Event> firstOrderTrie; 30 30 31 31 /** … … 47 47 firstOrderModel.trieOrder = 2; 48 48 if (markovOrder == 1) { 49 firstOrderModel.trie = new Trie<Event <?>>(model.trie);49 firstOrderModel.trie = new Trie<Event>(model.trie); 50 50 firstOrderModel.trieOrder = 2; 51 51 } else { 52 firstOrderTrie = new Trie<Event <?>>();53 TrieNode<Event <?>> rootNode = model.trie.find(null);52 firstOrderTrie = new Trie<Event>(); 53 TrieNode<Event> rootNode = model.trie.find(null); 54 54 generateFirstOrderTrie(rootNode, new LinkedList<String>(), markovOrder); 55 55 firstOrderTrie.updateKnownSymbols(); … … 98 98 * depth to go - NOT the current depth. 99 99 */ 100 private void generateFirstOrderTrie(TrieNode<Event <?>> currentNode,100 private void generateFirstOrderTrie(TrieNode<Event> currentNode, 101 101 List<String> parentIDs, int depth) { 102 for (TrieNode<Event <?>> child : currentNode.getChildren()) {102 for (TrieNode<Event> child : currentNode.getChildren()) { 103 103 String currentId = child.getSymbol().getStandardId(); 104 104 if (depth > 1) { … … 113 113 } 114 114 firstOrderID.append(currentId); 115 TrieNode<Event <?>> firstOrderNode = firstOrderTrie115 TrieNode<Event> firstOrderNode = firstOrderTrie 116 116 .getChildCreate(new Event<Object>(firstOrderID 117 117 .toString())); 118 118 firstOrderNode.setCount(child.getCount()); 119 for (TrieNode<Event <?>> transitionChild : child.getChildren()) {119 for (TrieNode<Event> transitionChild : child.getChildren()) { 120 120 StringBuilder transitionID = new StringBuilder(); 121 121 for (String parentID : parentIDs.subList(1, … … 126 126 transitionID.append(transitionChild.getSymbol() 127 127 .getStandardId()); 128 TrieNode<Event <?>> firstOrderTransitionChild = firstOrderNode128 TrieNode<Event> firstOrderTransitionChild = firstOrderNode 129 129 .getChildCreate(new Event<Object>(transitionID 130 130 .toString())); -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/PredictionByPartialMatch.java
r518 r547 149 149 */ 150 150 @Override 151 public double getProbability(List< ? extends Event<?>> context,152 Event <?>symbol) {151 public double getProbability(List<Event> context, 152 Event symbol) { 153 153 if (context == null) { 154 154 throw new InvalidParameterException("context must not be null"); … … 161 161 double resultShorterContex = 0.0d; 162 162 163 List<Event <?>> contextCopy;163 List<Event> contextCopy; 164 164 if (context.size() >= trieOrder) { 165 contextCopy = new LinkedList<Event <?>>(context.subList(165 contextCopy = new LinkedList<Event>(context.subList( 166 166 context.size() - trieOrder + 1, context.size())); 167 167 } else { 168 contextCopy = new LinkedList<Event <?>>(context);169 } 170 171 Collection<Event <?>> followers = trie.getFollowingSymbols(contextCopy); // \Sigma'168 contextCopy = new LinkedList<Event>(context); 169 } 170 171 Collection<Event> followers = trie.getFollowingSymbols(contextCopy); // \Sigma' 172 172 int sumCountFollowers = 0; // N(s\sigma') 173 for (Event <?>follower : followers) {173 for (Event follower : followers) { 174 174 sumCountFollowers += trie.getCount(contextCopy, follower); 175 175 } -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/TrieBasedModel.java
r518 r547 49 49 * </p> 50 50 */ 51 protected Trie<Event <?>> trie = null;51 protected Trie<Event> trie = null; 52 52 53 53 /** … … 101 101 * thrown is sequences is null 102 102 */ 103 public void train(Collection<List< ? extends Event<?>>> sequences) {103 public void train(Collection<List<Event>> sequences) { 104 104 trie = null; 105 105 update(sequences); … … 119 119 * thrown is sequences is null 120 120 */ 121 public void update(Collection<List< ? extends Event<?>>> sequences) {121 public void update(Collection<List<Event>> sequences) { 122 122 if (sequences == null) { 123 123 throw new InvalidParameterException("sequences must not be null"); 124 124 } 125 125 if (trie == null) { 126 trie = new Trie<Event <?>>();127 } 128 for (List< ? extends Event<?>> sequence : sequences) {129 List<Event <?>> currentSequence = new LinkedList<Event<?>>(sequence); // defensive126 trie = new Trie<Event>(); 127 } 128 for (List<Event> sequence : sequences) { 129 List<Event> currentSequence = new LinkedList<Event>(sequence); // defensive 130 130 // copy 131 131 currentSequence.add(0, Event.STARTEVENT); … … 142 142 */ 143 143 @Override 144 public List< ? extends Event<?>> randomSequence() {144 public List<Event> randomSequence() { 145 145 return randomSequence(Integer.MAX_VALUE, true); 146 146 } … … 152 152 */ 153 153 @Override 154 public List< ? extends Event<?>> randomSequence(int maxLength,154 public List<Event> randomSequence(int maxLength, 155 155 boolean validEnd) { 156 List<Event <?>> sequence = new LinkedList<Event<?>>();156 List<Event> sequence = new LinkedList<Event>(); 157 157 if (trie != null) { 158 158 boolean endFound = false; 159 159 while (!endFound) { // outer loop for length checking 160 sequence = new LinkedList<Event <?>>();161 IncompleteMemory<Event <?>> context = new IncompleteMemory<Event<?>>(160 sequence = new LinkedList<Event>(); 161 IncompleteMemory<Event> context = new IncompleteMemory<Event>( 162 162 trieOrder - 1); 163 163 context.add(Event.STARTEVENT); … … 166 166 double randVal = r.nextDouble(); 167 167 double probSum = 0.0; 168 List<Event <?>> currentContext = context.getLast(trieOrder);169 for (Event <?>symbol : trie.getKnownSymbols()) {168 List<Event> currentContext = context.getLast(trieOrder); 169 for (Event symbol : trie.getKnownSymbols()) { 170 170 probSum += getProbability(currentContext, symbol); 171 171 if (probSum >= randVal) { … … 262 262 String[] stateStrings = new String[getNumSymbols()]; 263 263 int i = 0; 264 for (Event <?>symbol : trie.getKnownSymbols()) {264 for (Event symbol : trie.getKnownSymbols()) { 265 265 if (symbol.toString() == null) { 266 266 stateStrings[i] = "null"; … … 279 279 */ 280 280 @Override 281 public Collection< ? extends Event<?>> getEvents() {282 if (trie == null) { 283 return new HashSet<Event <?>>();281 public Collection<Event> getEvents() { 282 if (trie == null) { 283 return new HashSet<Event>(); 284 284 } else { 285 285 return trie.getKnownSymbols(); … … 294 294 */ 295 295 @Override 296 public Collection<List< ? extends Event<?>>> generateSequences(int length) {296 public Collection<List<Event>> generateSequences(int length) { 297 297 return generateSequences(length, false); 298 298 } … … 306 306 */ 307 307 @Override 308 public Set<List< ? extends Event<?>>> generateSequences(int length,308 public Set<List<Event>> generateSequences(int length, 309 309 boolean fromStart) { 310 Set<List< ? extends Event<?>>> sequenceSet = new LinkedHashSet<List<? extends Event<?>>>();310 Set<List<Event>> sequenceSet = new LinkedHashSet<List<Event>>(); 311 311 if (length < 1) { 312 312 throw new InvalidParameterException( … … 315 315 if (length == 1) { 316 316 if (fromStart) { 317 List<Event <?>> subSeq = new LinkedList<Event<?>>();317 List<Event> subSeq = new LinkedList<Event>(); 318 318 subSeq.add(Event.STARTEVENT); 319 319 sequenceSet.add(subSeq); 320 320 } else { 321 for (Event <?>event : getEvents()) {322 List<Event <?>> subSeq = new LinkedList<Event<?>>();321 for (Event event : getEvents()) { 322 List<Event> subSeq = new LinkedList<Event>(); 323 323 subSeq.add(event); 324 324 sequenceSet.add(subSeq); … … 327 327 return sequenceSet; 328 328 } 329 Collection< ? extends Event<?>> events = getEvents();330 Collection<List< ? extends Event<?>>> seqsShorter = generateSequences(329 Collection<Event> events = getEvents(); 330 Collection<List<Event>> seqsShorter = generateSequences( 331 331 length - 1, fromStart); 332 for (Event <?>event : events) {333 for (List< ? extends Event<?>> seqShorter : seqsShorter) {334 Event <?>lastEvent = event;332 for (Event event : events) { 333 for (List<Event> seqShorter : seqsShorter) { 334 Event lastEvent = event; 335 335 if (getProbability(seqShorter, lastEvent) > 0.0) { 336 List<Event <?>> subSeq = new ArrayList<Event<?>>(seqShorter);336 List<Event> subSeq = new ArrayList<Event>(seqShorter); 337 337 subSeq.add(lastEvent); 338 338 sequenceSet.add(subSeq); … … 351 351 */ 352 352 @Override 353 public Collection<List< ? extends Event<?>>> generateValidSequences(353 public Collection<List<Event>> generateValidSequences( 354 354 int length) { 355 355 // check for min-length implicitly done by generateSequences 356 Collection<List< ? extends Event<?>>> allSequences = generateSequences(356 Collection<List<Event>> allSequences = generateSequences( 357 357 length, true); 358 Collection<List< ? extends Event<?>>> validSequences = new LinkedHashSet<List<? extends Event<?>>>();359 for (List< ? extends Event<?>> sequence : allSequences) {358 Collection<List<Event>> validSequences = new LinkedHashSet<List<Event>>(); 359 for (List<Event> sequence : allSequences) { 360 360 if (sequence.size() == length 361 361 && Event.ENDEVENT.equals(sequence.get(sequence.size() - 1))) { … … 374 374 */ 375 375 @Override 376 public double getProbability(List< ? extends Event<?>> sequence) {376 public double getProbability(List<Event> sequence) { 377 377 if (sequence == null) { 378 378 throw new InvalidParameterException("sequence must not be null"); 379 379 } 380 380 double prob = 1.0; 381 List<Event <?>> context = new LinkedList<Event<?>>();382 for (Event <?>event : sequence) {381 List<Event> context = new LinkedList<Event>(); 382 for (Event event : sequence) { 383 383 prob *= getProbability(context, event); 384 384 context.add(event); -
trunk/quest-runner/.classpath
r533 r547 2 2 <classpath> 3 3 <classpathentry kind="src" output="target/classes" path="src/main/java"> 4 <attributes> 5 <attribute name="optional" value="true"/> 6 <attribute name="maven.pomderived" value="true"/> 7 </attributes> 8 </classpathentry> 9 <classpathentry kind="src" output="target/test-classes" path="src/test/java"> 4 10 <attributes> 5 11 <attribute name="optional" value="true"/> -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ReplayGenerator.java
r488 r547 9 9 10 10 import de.ugoe.cs.quest.IReplayDecorator; 11 import de.ugoe.cs.quest.eventcore.Event; 11 12 import de.ugoe.cs.quest.eventcore.IReplayable; 12 import de.ugoe.cs.quest.eventcore.ReplayableEvent;13 13 import de.ugoe.cs.util.StringTools; 14 14 import de.ugoe.cs.util.console.Console; … … 19 19 * if {@link ReplayableEvent}s. 20 20 * </p> 21 * 22 * TODO: Figure our how to handle {@link IReplayDecorator} 23 * TODO: Add appropriate checks if Events are replayable 21 24 * 22 25 * @author Steffen Herbold … … 52 55 */ 53 56 public void createLogfileMultipleSessions( 54 Collection<List< ReplayableEvent<?>>> sequences, String filename) {57 Collection<List<Event>> sequences, String filename) { 55 58 OutputStreamWriter writer = openReplayFile(filename); 56 59 if (writer != null) { … … 60 63 writer.write(decorator.getHeader()); 61 64 } 62 for (List< ReplayableEvent<?>> actions : sequences) {65 for (List<Event> actions : sequences) { 63 66 writeSession(actions, writer); 64 67 } … … 84 87 * name and path of the replay file 85 88 */ 86 public void createLogfileSingleSession(List< ReplayableEvent<?>> actions,89 public void createLogfileSingleSession(List<Event> actions, 87 90 String filename) { 88 91 OutputStreamWriter writer = openReplayFile(filename); … … 152 155 * thrown if there is a problem writing to writer 153 156 */ 154 private void writeSession(List< ReplayableEvent<?>> actions,157 private void writeSession(List<Event> actions, 155 158 OutputStreamWriter writer) throws IOException { 156 159 if (decorator != null) { 157 160 writer.write(decorator.getSessionHeader(sessionId)); 158 161 } 159 for ( ReplayableEvent<?>currentAction : actions) {162 for (Event currentAction : actions) { 160 163 161 164 List<? extends IReplayable> replayables = currentAction -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/AbstractTrainCommand.java
r434 r547 81 81 return; 82 82 } 83 Collection<List< ? extends Event<?>>> sequences = (Collection<List<? extends Event<?>>>) dataObject;83 Collection<List<Event>> sequences = (Collection<List<Event>>) dataObject; 84 84 85 85 TrieBasedModel model = createModel(); -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDcalcCoverage.java
r434 r547 49 49 50 50 IStochasticProcess process = null; 51 Collection<List< ? extends Event<?>>> observedSequences = null;52 Collection<List< ? extends Event<?>>> sequences = null;51 Collection<List<Event>> observedSequences = null; 52 Collection<List<Event>> sequences = null; 53 53 Object dataObjectProcess = GlobalDataContainer.getInstance().getData( 54 54 modelname); … … 73 73 } 74 74 process = (IStochasticProcess) dataObjectProcess; 75 observedSequences = (Collection<List< ? extends Event<?>>>) dataObjectObserved;75 observedSequences = (Collection<List<Event>>) dataObjectObserved; 76 76 77 77 Console.print("seqName"); … … 103 103 return; 104 104 } 105 sequences = (Collection<List< ? extends Event<?>>>) dataObjectSequences;105 sequences = (Collection<List<Event>>) dataObjectSequences; 106 106 Console.print(sequenceName); 107 107 for (int length = minLength; length <= maxLength; length++) { -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDgenerateFixedLengthSequences.java
r524 r547 68 68 DrawFromAllSequencesGenerator generator = new DrawFromAllSequencesGenerator( 69 69 numSequences, minLength, maxLength, validEnd, all); 70 Collection<List< ? extends Event<?>>> sequences = generator70 Collection<List<Event>> sequences = generator 71 71 .generateTestSuite(model); 72 72 -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDgenerateGreedy.java
r434 r547 78 78 79 79 // set up everything 80 List<List< ? extends Event<?>>> allSequences = new LinkedList<List<? extends Event<?>>>();80 List<List<Event>> allSequences = new LinkedList<List<Event>>(); 81 81 for (int length = minLength; length <= maxLength; length++) { 82 82 if (validEnd) { … … 88 88 Console.traceln("" + allSequences.size() + " possible"); 89 89 90 Collection<List< ? extends Event<?>>> allSubSeqs = model90 Collection<List<Event>> allSubSeqs = model 91 91 .generateSequences(coverageDepth); 92 Map<List< ? extends Event<?>>, Double> weightMap = SequenceTools92 Map<List<Event>, Double> weightMap = SequenceTools 93 93 .generateWeights(model, allSubSeqs); 94 Set<List< ? extends Event<?>>> coveredSubSeqs = new LinkedHashSet<List<? extends Event<?>>>();94 Set<List<Event>> coveredSubSeqs = new LinkedHashSet<List<Event>>(); 95 95 96 List<Set<List< ? extends Event<?>>>> containedSubSeqs = new LinkedList<Set<List<? extends Event<?>>>>();97 for (List< ? extends Event<?>> sequence : allSequences) {98 List<List< ? extends Event<?>>> wrapper = new LinkedList<List<? extends Event<?>>>();96 List<Set<List<Event>>> containedSubSeqs = new LinkedList<Set<List<Event>>>(); 97 for (List<Event> sequence : allSequences) { 98 List<List<Event>> wrapper = new LinkedList<List<Event>>(); 99 99 wrapper.add(sequence); 100 Set<List< ? extends Event<?>>> currentSubSeqs = SequenceTools100 Set<List<Event>> currentSubSeqs = SequenceTools 101 101 .containedSubSequences(wrapper, coverageDepth); 102 102 containedSubSeqs.add(currentSubSeqs); 103 103 } 104 104 105 List<List< ? extends Event<?>>> testSuite = new LinkedList<List<? extends Event<?>>>();105 List<List<Event>> testSuite = new LinkedList<List<Event>>(); 106 106 double currentCoverage = 0.0d; 107 107 … … 112 112 Double[] sequenceGain = new Double[allSequences.size()]; 113 113 int i = 0; 114 for (Set<List< ? extends Event<?>>> containedSubSeq : containedSubSeqs) {114 for (Set<List<Event>> containedSubSeq : containedSubSeqs) { 115 115 double gain = 0.0d; 116 Iterator<List< ? extends Event<?>>> subSeqIter = containedSubSeq116 Iterator<List<Event>> subSeqIter = containedSubSeq 117 117 .iterator(); 118 118 while (subSeqIter.hasNext()) { 119 List< ? extends Event<?>> subSeq = subSeqIter.next();119 List<Event> subSeq = subSeqIter.next(); 120 120 if (!coveredSubSeqs.contains(subSeq)) { 121 121 gain += weightMap.get(subSeq); -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDgenerateHybrid.java
r524 r547 78 78 79 79 HybridGenerator generator = new HybridGenerator(numSequences, length, maxLengthAll, validEnd); 80 Collection<List< ? extends Event<?>>> sequences = generator.generateTestSuite(model);80 Collection<List<Event>> sequences = generator.generateTestSuite(model); 81 81 82 82 if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) { -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDgenerateRandomReplay.java
r434 r547 8 8 import de.ugoe.cs.quest.CommandHelpers; 9 9 import de.ugoe.cs.quest.ReplayGenerator; 10 import de.ugoe.cs.quest.eventcore. ReplayableEvent;10 import de.ugoe.cs.quest.eventcore.Event; 11 11 import de.ugoe.cs.quest.ui.GlobalDataContainer; 12 12 import de.ugoe.cs.quest.usageprofiles.IStochasticProcess; … … 67 67 } 68 68 model = (IStochasticProcess) dataObject; 69 Collection<List< ReplayableEvent<?>>> sequences = new LinkedList<List<ReplayableEvent<?>>>();69 Collection<List<Event>> sequences = new LinkedList<List<Event>>(); 70 70 try { 71 71 for (int i = 0; i < numSessions; i++) { 72 72 sequences 73 .add((List< ReplayableEvent<?>>) model.randomSequence());73 .add((List<Event>) model.randomSequence()); 74 74 } 75 75 } catch (ClassCastException e) { -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDgenerateRandomSequences.java
r524 r547 69 69 RandomWalkGenerator generator = new RandomWalkGenerator(numSessions, 70 70 minLength, maxLength, validEnd, maxIter); 71 Collection<List< ? extends Event<?>>> sequences = generator71 Collection<List<Event>> sequences = generator 72 72 .generateTestSuite(model); 73 73 -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDgenerateReplayfile.java
r434 r547 8 8 import de.ugoe.cs.quest.ReplayGenerator; 9 9 import de.ugoe.cs.quest.SequenceInstanceOf; 10 import de.ugoe.cs.quest.eventcore. ReplayableEvent;10 import de.ugoe.cs.quest.eventcore.Event; 11 11 import de.ugoe.cs.quest.ui.GlobalDataContainer; 12 12 import de.ugoe.cs.util.console.Command; … … 50 50 } 51 51 52 Collection<List< ReplayableEvent<?>>> sequences = null;52 Collection<List<Event>> sequences = null; 53 53 Object dataObject = GlobalDataContainer.getInstance().getData( 54 54 sequencesName); … … 63 63 } 64 64 65 sequences = (Collection<List< ReplayableEvent<?>>>) dataObject;65 sequences = (Collection<List<Event>>) dataObject; 66 66 ReplayGenerator generator = new ReplayGenerator(); 67 67 generator.createLogfileMultipleSessions(sequences, filename); -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDsequenceStatistics.java
r434 r547 41 41 } 42 42 43 Collection<List<Event <?>>> sequences = null;43 Collection<List<Event>> sequences = null; 44 44 Object dataObject = GlobalDataContainer.getInstance().getData( 45 45 sequencesName); … … 54 54 } 55 55 56 sequences = (Collection<List<Event <?>>>) dataObject;56 sequences = (Collection<List<Event>>) dataObject; 57 57 Console.println("Number of Sequences: " + sequences.size()); 58 58 SortedMap<Integer, Integer> lengthMap = new TreeMap<Integer, Integer>(); 59 for (List<Event <?>> sequence : sequences) {59 for (List<Event> sequence : sequences) { 60 60 Integer currentSize = sequence.size(); 61 61 if (lengthMap.containsKey(currentSize)) { -
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/ui/commands/CMDupdateModel.java
r434 r547 52 52 return; 53 53 } 54 Collection<List< ? extends Event<?>>> sequences = (Collection<List<? extends Event<?>>>) dataObject;54 Collection<List<Event>> sequences = (Collection<List<Event>>) dataObject; 55 55 56 56 dataObject = GlobalDataContainer.getInstance().getData(modelname);
Note: See TracChangeset
for help on using the changeset viewer.