Changeset 553 for trunk


Ignore:
Timestamp:
08/16/12 16:08:48 (12 years ago)
Author:
sherbold
Message:
  • countless adaptations throughout nearly all components to remove errors introduced due to the refactoring of the event core
  • added StringEventType? as a simple-to-use event type instead of DummyEventType?
Location:
trunk
Files:
1 deleted
17 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/java-utils-test/.classpath

    r482 r553  
    22<classpath> 
    33        <classpathentry kind="src" output="target/test-classes" path="src/test/java"> 
     4                <attributes> 
     5                        <attribute name="optional" value="true"/> 
     6                        <attribute name="maven.pomderived" value="true"/> 
     7                </attributes> 
     8        </classpathentry> 
     9        <classpathentry kind="src" output="target/classes" path="src/main/java"> 
    410                <attributes> 
    511                        <attribute name="optional" value="true"/> 
  • trunk/quest-core-coverage-test/src/test/java/de/ugoe/cs/quest/coverage/CoverageCalculatorObservedTest.java

    r548 r553  
    55import de.ugoe.cs.quest.coverage.CoverageCalculatorObserved; 
    66import de.ugoe.cs.quest.eventcore.Event; 
     7import de.ugoe.cs.quest.eventcore.StringEventType; 
    78import de.ugoe.cs.quest.usageprofiles.MockTrieBasedModel; 
    8 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    99 
    1010import java.util.LinkedHashSet; 
  • trunk/quest-core-coverage-test/src/test/java/de/ugoe/cs/quest/coverage/CoverageCalculatorProcessTest.java

    r548 r553  
    1111import de.ugoe.cs.quest.coverage.CoverageCalculatorProcess; 
    1212import de.ugoe.cs.quest.eventcore.Event; 
     13import de.ugoe.cs.quest.eventcore.StringEventType; 
    1314import de.ugoe.cs.quest.usageprofiles.MockTrieBasedModel; 
    14 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    1515 
    1616import org.junit.*; 
  • trunk/quest-core-coverage-test/src/test/java/de/ugoe/cs/quest/coverage/SequenceToolsTest.java

    r548 r553  
    1212import de.ugoe.cs.quest.coverage.SequenceTools; 
    1313import de.ugoe.cs.quest.eventcore.Event; 
     14import de.ugoe.cs.quest.eventcore.StringEventType; 
    1415import de.ugoe.cs.quest.usageprofiles.FirstOrderMarkovModel; 
    1516import de.ugoe.cs.quest.usageprofiles.IStochasticProcess; 
    1617import de.ugoe.cs.quest.usageprofiles.MockTrieBasedModel; 
    17 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    1818 
    1919import org.junit.*; 
  • trunk/quest-core-events-test/.classpath

    r481 r553  
    22<classpath> 
    33        <classpathentry kind="src" output="target/test-classes" path="src/test/java"> 
     4                <attributes> 
     5                        <attribute name="optional" value="true"/> 
     6                        <attribute name="maven.pomderived" value="true"/> 
     7                </attributes> 
     8        </classpathentry> 
     9        <classpathentry kind="src" output="target/classes" path="src/main/java"> 
    410                <attributes> 
    511                        <attribute name="optional" value="true"/> 
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/Event.java

    r551 r553  
    3030     * </p> 
    3131     */ 
    32     public static final Event STARTEVENT = new Event(new DummyEventType()); 
     32    public static final Event STARTEVENT = new Event(new StringEventType("START")); 
    3333 
    3434    /** 
     
    3636     * Global end event that can be used to indicate the end of a sequence. 
    3737     */ 
    38     public static final Event ENDEVENT = new Event(new DummyEventType()); 
     38    public static final Event ENDEVENT = new Event(new StringEventType("END")); 
    3939 
    4040    /** 
     
    160160     */ 
    161161    public String getId() { 
    162         return "(" + type.toString() + ";" + target.toString() + ")"; 
     162        String id = type.toString(); 
     163        if( target!=null ) { 
     164            id += "." + target.toString(); 
     165        } 
     166        return id; 
    163167    } 
    164168 
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/StringEventType.java

    r549 r553  
    1 package de.ugoe.cs.quest.usageprofiles.mock; 
    21 
    3 import de.ugoe.cs.quest.eventcore.IEventType; 
     2package de.ugoe.cs.quest.eventcore; 
    43 
     4import java.security.InvalidParameterException; 
     5 
     6/** 
     7 * <p> 
     8 * A simple event type that is identified by a string. 
     9 * </p> 
     10 *  
     11 * @version $Revision: $ $Date: Aug 16, 2012$ 
     12 * @author 2012, last modified by $Author: sherbold$ 
     13 */ 
    514public class StringEventType implements IEventType { 
    6     /**  */ 
     15 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    721    private static final long serialVersionUID = 1L; 
    8     String str; 
    922 
    10     public StringEventType(String str) { 
     23    /** 
     24     * <p> 
     25     * String that identifies the event type. 
     26     * </p> 
     27     */ 
     28    private String str; 
     29 
     30    /** 
     31     * <p> 
     32     * Constructor. Creates a new StringEventType. str must not be null. 
     33     * </p> 
     34     *  
     35     * @param str 
     36     *            string that identifies the event type 
     37     * @throws InvalidParameterException 
     38     *             thrown if str is null 
     39     */ 
     40    public StringEventType(String str) throws InvalidParameterException { 
    1141        if (str == null) { 
    12             throw new AssertionError( 
    13                                      "illegal use of mock StringEventType: str must nut be null"); 
     42            throw new InvalidParameterException("str must not be null"); 
    1443        } 
    1544        this.str = str; 
    1645    } 
    1746 
     47    /* 
     48     * (non-Javadoc) 
     49     *  
     50     * @see de.ugoe.cs.quest.eventcore.IEventType#getName() 
     51     */ 
     52    @Override 
    1853    public String getName() { 
    1954        return "StringEventType"; 
    2055    } 
    2156 
     57    /* 
     58     * (non-Javadoc) 
     59     *  
     60     * @see java.lang.Object#toString() 
     61     */ 
     62    @Override 
     63    public String toString() { 
     64        return str; 
     65    } 
     66 
     67    /* 
     68     * (non-Javadoc) 
     69     *  
     70     * @see java.lang.Object#hashCode() 
     71     */ 
     72    @Override 
     73    public int hashCode() { 
     74        return str.hashCode(); 
     75    } 
     76 
     77    /* 
     78     * (non-Javadoc) 
     79     *  
     80     * @see java.lang.Object#equals(java.lang.Object) 
     81     */ 
    2282    @Override 
    2383    public boolean equals(Object other) { 
  • trunk/quest-core-tasktrees-test/.classpath

    r506 r553  
    22<classpath> 
    33        <classpathentry kind="src" output="target/test-classes" path="src/test/java"> 
     4                <attributes> 
     5                        <attribute name="optional" value="true"/> 
     6                        <attribute name="maven.pomderived" value="true"/> 
     7                </attributes> 
     8        </classpathentry> 
     9        <classpathentry kind="src" output="target/classes" path="src/main/java"> 
    410                <attributes> 
    511                        <attribute name="optional" value="true"/> 
  • trunk/quest-core-usageprofiles-test/.classpath

    r518 r553  
    22<classpath> 
    33        <classpathentry kind="src" output="target/test-classes" path="src/test/java"> 
     4                <attributes> 
     5                        <attribute name="optional" value="true"/> 
     6                        <attribute name="maven.pomderived" value="true"/> 
     7                </attributes> 
     8        </classpathentry> 
     9        <classpathentry kind="src" output="target/classes" path="src/main/java"> 
    410                <attributes> 
    511                        <attribute name="optional" value="true"/> 
  • trunk/quest-core-usageprofiles-test/src/test/java/de/ugoe/cs/quest/usageprofiles/DeterministicFiniteAutomatonTest.java

    r548 r553  
    66 
    77import de.ugoe.cs.quest.eventcore.Event; 
     8import de.ugoe.cs.quest.eventcore.StringEventType; 
    89import de.ugoe.cs.quest.usageprofiles.DeterministicFiniteAutomaton; 
    9 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    1010 
    1111import java.util.Random; 
  • trunk/quest-core-usageprofiles-test/src/test/java/de/ugoe/cs/quest/usageprofiles/FirstOrderMarkovModelTest.java

    r548 r553  
    88 
    99import de.ugoe.cs.quest.eventcore.Event; 
     10import de.ugoe.cs.quest.eventcore.StringEventType; 
    1011import de.ugoe.cs.quest.usageprofiles.FirstOrderMarkovModel; 
    1112import de.ugoe.cs.quest.usageprofiles.FirstOrderMarkovModel.MarkovEdge; 
    12 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    1313import static org.junit.Assert.*; 
    1414 
  • trunk/quest-core-usageprofiles-test/src/test/java/de/ugoe/cs/quest/usageprofiles/HighOrderMarkovModelTest.java

    r548 r553  
    66 
    77import de.ugoe.cs.quest.eventcore.Event; 
     8import de.ugoe.cs.quest.eventcore.StringEventType; 
    89import de.ugoe.cs.quest.usageprofiles.HighOrderMarkovModel; 
    9 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    1010 
    1111import java.util.Random; 
  • trunk/quest-core-usageprofiles-test/src/test/java/de/ugoe/cs/quest/usageprofiles/ModelFlattenerTest.java

    r548 r553  
    1010 
    1111import de.ugoe.cs.quest.eventcore.Event; 
     12import de.ugoe.cs.quest.eventcore.StringEventType; 
    1213import de.ugoe.cs.quest.usageprofiles.FirstOrderMarkovModel; 
    1314import de.ugoe.cs.quest.usageprofiles.HighOrderMarkovModel; 
     
    1516import de.ugoe.cs.quest.usageprofiles.PredictionByPartialMatch; 
    1617import de.ugoe.cs.quest.usageprofiles.TrieNode; 
    17 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    1818import static org.junit.Assert.*; 
    1919 
  • trunk/quest-core-usageprofiles-test/src/test/java/de/ugoe/cs/quest/usageprofiles/PredictionByPartialMatchTest.java

    r548 r553  
    66 
    77import de.ugoe.cs.quest.eventcore.Event; 
     8import de.ugoe.cs.quest.eventcore.StringEventType; 
    89import de.ugoe.cs.quest.usageprofiles.PredictionByPartialMatch; 
    9 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    1010 
    1111import java.util.Random; 
  • trunk/quest-core-usageprofiles-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TrieBasedModelTest.java

    r548 r553  
    88 
    99import de.ugoe.cs.quest.eventcore.Event; 
     10import de.ugoe.cs.quest.eventcore.StringEventType; 
    1011import de.ugoe.cs.quest.usageprofiles.Trie; 
    1112import de.ugoe.cs.quest.usageprofiles.TrieBasedModel; 
    1213import de.ugoe.cs.quest.usageprofiles.TrieNode; 
    13 import de.ugoe.cs.quest.usageprofiles.mock.StringEventType; 
    1414 
    1515import org.junit.*; 
  • trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/FirstOrderMarkovModel.java

    r547 r553  
    103103                List<Integer> endIndexList = new LinkedList<Integer>(); 
    104104                for( int i=0 ; i<knownSymbols.size() ; i++ ) { 
    105                         String id = knownSymbols.get(i).getStandardId(); 
    106                         if( id.equals(Event.STARTEVENT.getStandardId()) || id.contains(Event.STARTEVENT.getStandardId()+"-=-") ) { 
     105                        String id = knownSymbols.get(i).getId(); 
     106                        if( id.equals(Event.STARTEVENT.getId()) || id.contains(Event.STARTEVENT.getId()+"-=-") ) { 
    107107                                startIndexList.add(i); 
    108108                        } 
    109                         if( id.equals(Event.ENDEVENT.getStandardId()) || id.contains("-=-"+Event.ENDEVENT.getStandardId()) ) { 
     109                        if( id.equals(Event.ENDEVENT.getId()) || id.contains("-=-"+Event.ENDEVENT.getId()) ) { 
    110110                                endIndexList.add(i); 
    111111                        } 
     
    176176                                trie.getKnownSymbols()); 
    177177                for (Event symbol : knownSymbols) { 
    178                         final String thisSaneId = symbol.getShortId().replace("\"", "\\\"") 
     178                        final String thisSaneId = symbol.getId().replace("\"", "\\\"") 
    179179                                        .replaceAll("[\r\n]", ""); 
    180180                        stringBuilder.append(" " + knownSymbols.indexOf(symbol) + " [label=\"" 
     
    210210 
    211211                for (Event symbol : knownSymbols) { 
    212                         String from = symbol.getShortId(); 
     212                        String from = symbol.getId(); 
    213213                        List<Event> context = new ArrayList<Event>(); 
    214214                        context.add(symbol); 
     
    217217 
    218218                        for (Event follower : followers) { 
    219                                 String to = follower.getShortId(); 
     219                                String to = follower.getId(); 
    220220                                MarkovEdge prob = new MarkovEdge(getProbability(context, 
    221221                                                follower)); 
  • trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/ModelFlattener.java

    r547 r553  
    66 
    77import de.ugoe.cs.quest.eventcore.Event; 
    8 import de.ugoe.cs.quest.eventcore.ReplayableEvent; 
     8import de.ugoe.cs.quest.eventcore.StringEventType; 
    99 
    1010/** 
     
    101101                        List<String> parentIDs, int depth) { 
    102102                for (TrieNode<Event> child : currentNode.getChildren()) { 
    103                         String currentId = child.getSymbol().getStandardId(); 
     103                        String currentId = child.getSymbol().getId(); 
    104104                        if (depth > 1) { 
    105105                                List<String> childParentIDs = new LinkedList<String>(parentIDs); 
     
    114114                                firstOrderID.append(currentId); 
    115115                                TrieNode<Event> firstOrderNode = firstOrderTrie 
    116                                                 .getChildCreate(new Event<Object>(firstOrderID 
    117                                                                 .toString())); 
     116                                                .getChildCreate(new Event(new StringEventType(firstOrderID 
     117                                                                .toString()))); 
    118118                                firstOrderNode.setCount(child.getCount()); 
    119119                                for (TrieNode<Event> transitionChild : child.getChildren()) { 
     
    125125                                        transitionID.append(currentId + EVENT_SEPARATOR); 
    126126                                        transitionID.append(transitionChild.getSymbol() 
    127                                                         .getStandardId()); 
     127                                                        .getId()); 
    128128                                        TrieNode<Event> firstOrderTransitionChild = firstOrderNode 
    129                                                         .getChildCreate(new Event<Object>(transitionID 
    130                                                                         .toString())); 
     129                                                        .getChildCreate(new Event(new StringEventType(transitionID 
     130                                                                        .toString()))); 
    131131                                        firstOrderTransitionChild.setCount(transitionChild 
    132132                                                        .getCount()); 
  • trunk/quest-ui-core-test/.classpath

    r494 r553  
    22<classpath> 
    33        <classpathentry kind="src" output="target/test-classes" path="src/test/java"> 
     4                <attributes> 
     5                        <attribute name="optional" value="true"/> 
     6                        <attribute name="maven.pomderived" value="true"/> 
     7                </attributes> 
     8        </classpathentry> 
     9        <classpathentry kind="src" output="target/classes" path="src/main/java"> 
    410                <attributes> 
    511                        <attribute name="optional" value="true"/> 
Note: See TracChangeset for help on using the changeset viewer.