Changeset 326 for trunk/EventBenchCoreTest
- Timestamp:
- 12/16/11 10:17:25 (13 years ago)
- Location:
- trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/ModelFlattenerTest.java
r259 r326 33 33 ModelFlattener fixture = new ModelFlattener(); 34 34 HighOrderMarkovModel model = new HighOrderMarkovModel(2, new Random()); 35 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();35 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 36 36 sequences.add(sequence); 37 37 model.train(sequences); -
trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TrieBasedModelTest.java
r257 r326 202 202 } 203 203 204 private class MockTrieBasedModel extends TrieBasedModel {205 private static final long serialVersionUID = 1L;206 207 public MockTrieBasedModel(int markovOrder, Random r) {208 super(markovOrder, r);209 }210 211 @Override212 public double getProbability(List<? extends Event<?>> context,213 Event<?> symbol) {214 List<Event<?>> list = new ArrayList<Event<?>>();215 list.add(context.get(context.size()-1));216 if( trie.find(list).getFollowingSymbols().contains(symbol) ) {217 return 1;218 } else {219 return 0;220 }221 }222 }223 224 204 @Test 225 205 public void testGenerateSequences_1() … … 227 207 int markovOrder = 2; 228 208 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 229 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();209 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 230 210 sequences.add(sequence); 231 211 fixture.train(sequences); … … 282 262 int markovOrder = 2; 283 263 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 284 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();264 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 285 265 sequences.add(sequence); 286 266 fixture.train(sequences); … … 320 300 int markovOrder = 2; 321 301 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 322 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();302 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 323 303 sequences.add(sequence); 324 304 fixture.train(sequences); … … 333 313 int markovOrder = 2; 334 314 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 335 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();315 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 336 316 sequences.add(sequence); 337 317 fixture.train(sequences); … … 365 345 int markovOrder = 2; 366 346 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 367 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();347 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 368 348 sequences.add(sequence); 369 349 fixture.train(sequences); … … 378 358 int markovOrder = 2; 379 359 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 380 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();360 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 381 361 sequences.add(sequence); 382 362 … … 404 384 int markovOrder = 2; 405 385 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 406 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();386 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 407 387 sequences.add(sequence); 408 388 … … 430 410 int markovOrder = 2; 431 411 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 432 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();412 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 433 413 sequences.add(sequence); 434 414 fixture.train(sequences); … … 455 435 int markovOrder = 2; 456 436 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 457 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();437 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 458 438 sequences.add(sequence); 459 439 fixture.train(sequences); … … 480 460 int markovOrder = 2; 481 461 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 482 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();462 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 483 463 sequences.add(sequence); 484 464 … … 494 474 int markovOrder = 2; 495 475 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 496 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();476 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 497 477 sequences.add(sequence); 498 478 sequences.add(sequence); … … 510 490 int markovOrder = 2; 511 491 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 512 Collection<List< Event<?>>> sequences = new ArrayList<List<Event<?>>>();492 Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>(); 513 493 sequences.add(sequence); 514 494 fixture.train(sequences); … … 525 505 int markovOrder = 2; 526 506 MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 527 Collection<List< Event<?>>> sequences = null;507 Collection<List<? extends Event<?>>> sequences = null; 528 508 fixture.trie = null; 529 509
Note: See TracChangeset
for help on using the changeset viewer.