Changeset 25


Ignore:
Timestamp:
04/14/11 13:51:20 (14 years ago)
Author:
sherbold
Message:
  • renamed DotPrinter? to IDotCompatible in package de.ugoe.cs.eventbench.models

+ added getDotRepresentation to de.ugoe.cs.eventbench.models.IDotCompatible

  • removed printDot from de.ugoe.cs.eventbench.models.IDotCompatible
Location:
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models
Files:
1 edited
1 moved

Legend:

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

    r19 r25  
    1313import Jama.Matrix; 
    1414 
    15 public class FirstOrderMarkovModel extends HighOrderMarkovModel implements DotPrinter { 
     15public class FirstOrderMarkovModel extends HighOrderMarkovModel implements IDotCompatible { 
    1616 
    1717        final static int MAX_STATDIST_ITERATIONS = 1000; 
     
    3939        } 
    4040         
    41         public void printDot() { 
    42                 Console.println("digraph model {"); 
     41        public String getDotRepresentation() { 
     42                StringBuilder stringBuilder = new StringBuilder(); 
     43                stringBuilder.append("digraph model {"); 
    4344 
    4445                List<Event<?>> knownSymbols = new ArrayList<Event<?>>(trie.getKnownSymbols()); 
     
    4647                for( Event<?> symbol : knownSymbols) { 
    4748                        final String thisSaneId = symbol.getShortId().replace("\"", "\\\"").replaceAll("[\r\n]",""); 
    48                         Console.println(" " + symbol.hashCode() + " [label=\""+thisSaneId+"\"];"); 
     49                        stringBuilder.append(" " + symbol.hashCode() + " [label=\""+thisSaneId+"\"];"); 
    4950                        List<Event<?>> context = new ArrayList<Event<?>>(); 
    5051                        context.add(symbol);  
     
    5556                        } 
    5657                } 
    57                 System.out.println('}'); 
     58                stringBuilder.append('}'); 
     59                return stringBuilder.toString(); 
    5860        } 
    5961         
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/IDotCompatible.java

    r19 r25  
    11package de.ugoe.cs.eventbench.models; 
    22 
    3 public interface DotPrinter { 
    4         public abstract void printDot(); 
     3public interface IDotCompatible { 
     4        public abstract String getDotRepresentation(); 
    55} 
Note: See TracChangeset for help on using the changeset viewer.