Ignore:
Timestamp:
06/22/11 14:12:18 (13 years ago)
Author:
sherbold
Message:
  • added getProbability() to de.ugoe.cs.eventbench.models.IStochasticProcess and implementing classes
  • added getEvents() to de.ugoe.cs.eventbench.models.IStochasticProcess and implementing classes
  • changed getProbability() of subclasses of de.ugoe.cs.eventbench.TrieBasedModel? such that the probability is not zero if the context length is higher than the order of the model, but rather the probability of the suffix of the length of the order, i.e., for a 2nd-order model context(X1,X2,X3,X4) becomes context(X3,X4)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/HighOrderMarkovModel.java

    r13 r80  
    1212                super(maxOrder, r); 
    1313        } 
    14                  
     14         
    1515        @Override 
    16         protected double getProbability(List<Event<?>> context, Event<?> symbol) { 
     16        public double getProbability(List<Event<?>> context, Event<?> symbol) { 
    1717                double result = 0.0d; 
    1818                 
    19                 List<Event<?>> contextCopy = new LinkedList<Event<?>>(context); 
     19                List<Event<?>> contextCopy; 
     20                if( context.size()>=trieOrder ) { 
     21                        contextCopy = new LinkedList<Event<?>>(context.subList(context.size()-trieOrder+1, context.size())); 
     22                } else { 
     23                        contextCopy = new LinkedList<Event<?>>(context); 
     24                } 
    2025 
    2126         
Note: See TracChangeset for help on using the changeset viewer.