Ignore:
Timestamp:
04/13/11 15:53:14 (13 years ago)
Author:
sherbold
Message:

+ added class TrieBasedModel? as base class for all usage models that calculate probabilities based on a trie
+ extracted everything except the probability calculation from PPM to TrieBasedModel?
+ added HighOrderMarkovModel? based on TrieBasedModel?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/Event.java

    r7 r12  
    11package de.ugoe.cs.eventbench.data; 
     2 
     3import java.security.InvalidParameterException; 
    24 
    35 
     
    3234         
    3335        public Event(String type) { 
     36                if( type==null ) { 
     37                        throw new InvalidParameterException("Event type must not be null"); 
     38                } 
    3439                this.type = type; 
    3540        } 
     
    4146                } 
    4247                if (other instanceof Event<?>) { 
    43                         Event<?> otherToken = (Event<?>) other; 
    44                         return otherToken.type.equals(this.type) 
    45                                         && otherToken.target.equals(this.target); 
     48                        Event<?> otherEvent = (Event<?>) other; 
     49                        if( target!=null ) { 
     50                                return type.equals(otherEvent.type) 
     51                                        && target.equals(otherEvent.target); 
     52                        } else { 
     53                                return type.equals(otherEvent.type) 
     54                                        && target==otherEvent.target; 
     55                        } 
    4656                } else { 
    4757                        return false; 
     
    7080 
    7181        public String getStandardId() { 
    72                 String id = target + "." + getType(); 
     82                String id = ""; 
     83                if( target!=null ) { 
     84                        id += target + "."; 
     85                } 
     86                id += getType(); 
    7387                if ( idInfo!="" ) { 
    7488                        id += "." + idInfo; 
Note: See TracChangeset for help on using the changeset viewer.