Ignore:
Timestamp:
12/16/11 10:17:25 (13 years ago)
Author:
sherbold
Message:
  • changed signature of de.ugoe.cs.util.eventbench.models.TrieBasedModel?.train() and update() from using Collection<List<Event<?>>> to Collection<List<? extends Event<?>>>
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  
    3333                ModelFlattener fixture = new ModelFlattener(); 
    3434                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<?>>>(); 
    3636                sequences.add(sequence); 
    3737                model.train(sequences); 
  • trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TrieBasedModelTest.java

    r257 r326  
    202202        } 
    203203         
    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                 @Override 
    212                 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          
    224204        @Test 
    225205        public void testGenerateSequences_1() 
     
    227207                int markovOrder = 2; 
    228208                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<?>>>(); 
    230210                sequences.add(sequence); 
    231211                fixture.train(sequences); 
     
    282262                int markovOrder = 2; 
    283263                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<?>>>(); 
    285265                sequences.add(sequence); 
    286266                fixture.train(sequences); 
     
    320300                int markovOrder = 2; 
    321301                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<?>>>(); 
    323303                sequences.add(sequence); 
    324304                fixture.train(sequences); 
     
    333313                int markovOrder = 2; 
    334314                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<?>>>(); 
    336316                sequences.add(sequence); 
    337317                fixture.train(sequences); 
     
    365345                int markovOrder = 2; 
    366346                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<?>>>(); 
    368348                sequences.add(sequence); 
    369349                fixture.train(sequences); 
     
    378358                int markovOrder = 2; 
    379359                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<?>>>(); 
    381361                sequences.add(sequence); 
    382362 
     
    404384                int markovOrder = 2; 
    405385                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<?>>>(); 
    407387                sequences.add(sequence); 
    408388 
     
    430410                int markovOrder = 2; 
    431411                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<?>>>(); 
    433413                sequences.add(sequence); 
    434414                fixture.train(sequences); 
     
    455435                int markovOrder = 2; 
    456436                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<?>>>(); 
    458438                sequences.add(sequence); 
    459439                fixture.train(sequences); 
     
    480460                int markovOrder = 2; 
    481461                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<?>>>(); 
    483463                sequences.add(sequence); 
    484464 
     
    494474                int markovOrder = 2; 
    495475                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<?>>>(); 
    497477                sequences.add(sequence); 
    498478                sequences.add(sequence); 
     
    510490                int markovOrder = 2; 
    511491                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<?>>>(); 
    513493                sequences.add(sequence); 
    514494                fixture.train(sequences); 
     
    525505                int markovOrder = 2; 
    526506                MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random()); 
    527                 Collection<List<Event<?>>> sequences = null; 
     507                Collection<List<? extends Event<?>>> sequences = null; 
    528508                fixture.trie = null; 
    529509 
Note: See TracChangeset for help on using the changeset viewer.