Changeset 16 for trunk/EventBenchCore/src/de/ugoe/cs
- Timestamp:
- 04/14/11 10:53:57 (14 years ago)
- Location:
- trunk/EventBenchCore/src/de/ugoe/cs/eventbench
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/Event.java
r12 r16 75 75 shortId += "."+idInfo; 76 76 } 77 } else { 78 shortId = getStandardId(); 77 79 } 78 80 return shortId; -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/PredictionByPartialMatch.java
r13 r16 13 13 double probEscape; 14 14 15 public PredictionByPartialMatch(int ma xOrder, Random r) {16 this(ma xOrder, r, 0.1);15 public PredictionByPartialMatch(int markovOrder, Random r) { 16 this(markovOrder, r, 0.1); 17 17 } 18 18 19 public PredictionByPartialMatch(int ma xOrder, Random r, double probEscape) {20 super(ma xOrder, r);19 public PredictionByPartialMatch(int markovOrder, Random r, double probEscape) { 20 super(markovOrder, r); 21 21 this.probEscape = probEscape; 22 22 } -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/Trie.java
r13 r16 38 38 } 39 39 40 // trains the current Trie using the given sequence and adds all subsequence of length maxOrder40 // trains the current Trie using the given sequence and adds all subsequence of length trieOrder 41 41 public void train(List<T> sequence, int maxOrder) { 42 42 IncompleteMemory<T> latestActions = new IncompleteMemory<T>(maxOrder); -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieBasedModel.java
r13 r16 10 10 public abstract class TrieBasedModel { 11 11 12 protected int maxOrder;12 protected int trieOrder; 13 13 14 14 protected abstract double getProbability(List<Event<?>> context, Event<?> symbol); … … 18 18 19 19 20 public TrieBasedModel(int ma xOrder, Random r) {20 public TrieBasedModel(int markovOrder, Random r) { 21 21 super(); 22 this. maxOrder = maxOrder;22 this.trieOrder = markovOrder+1; 23 23 this.r = r; 24 24 } … … 32 32 currentSequence.add(Event.ENDEVENT); 33 33 34 trie.train(currentSequence, maxOrder);34 trie.train(currentSequence, trieOrder); 35 35 } 36 36 } … … 39 39 List<Event<?>> sequence = new LinkedList<Event<?>>(); 40 40 41 IncompleteMemory<Event<?>> context = new IncompleteMemory<Event<?>>( maxOrder-1);41 IncompleteMemory<Event<?>> context = new IncompleteMemory<Event<?>>(trieOrder-1); 42 42 context.add(Event.STARTEVENT); 43 43 … … 49 49 double randVal = r.nextDouble(); 50 50 double probSum = 0.0; 51 List<Event<?>> currentContext = context.getLast( maxOrder);51 List<Event<?>> currentContext = context.getLast(trieOrder); 52 52 for( Event<?> symbol : trie.getKnownSymbols() ) { 53 53 probSum += getProbability(currentContext, symbol);
Note: See TracChangeset
for help on using the changeset viewer.