Changeset 99 for trunk/EventBenchCore
- Timestamp:
- 07/04/11 13:43:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/IStochasticProcess.java
r94 r99 7 7 import de.ugoe.cs.eventbench.data.Event; 8 8 9 /** 10 * <p> 11 * This interface defines the functionalities provided by stochastic processes. 12 * </p> 13 * 14 * @author Steffen Herbold 15 * @version 1.0 16 */ 9 17 public interface IStochasticProcess extends Serializable { 10 18 19 /** 20 * <p> 21 * Returns the probability, that the next event is {@code symbol} given the 22 * last events are {@code context}. The last element of {@code context} is 23 * the most recent in the history, the first element is the oldest. 24 * </p> 25 * 26 * @param context 27 * recently observed symbols 28 * @param symbol 29 * event for which the probability is calculated 30 * @return probabilty the {@code symbol} is the next event, given the last 31 * events {@code context} 32 */ 11 33 double getProbability(List<? extends Event<?>> context, Event<?> symbol); 12 34 35 /** 36 * <p> 37 * Generates a random sequence of events. The sequence starts with 38 * {@link Event#STARTEVENT} and finishes with {@link Event#ENDEVENT}. 39 * </p> 40 * 41 * @return randomly generated sequence 42 */ 13 43 public List<? extends Event<?>> randomSequence(); 14 44 45 /** 46 * <p> 47 * Generates all sequences of a given length are possible, i.e., have a 48 * positive probability.<br> 49 * All states are used as possible starting states. 50 * </p> 51 * 52 * @param length 53 * length of the generated sequences 54 * @return generated sequences 55 * @see #generateSequences(int, boolean) 56 */ 15 57 public Set<List<? extends Event<?>>> generateSequences(int length); 16 17 public Set<List<? extends Event<?>>> generateSequences(int length, boolean fromStart); 18 58 59 /** 60 * <p> 61 * Generates all sequences of given length that can are possible, i.e., have 62 * positive probability.<br> 63 * If {@code fromStart==true}, all generated sequences start in 64 * {@link Event#STARTEVENT}. Otherwise this method is the same as 65 * {@link #generateSequences(int)}. 66 * </p> 67 * 68 * @param length 69 * length of the generated sequences 70 * @param fromStart 71 * if true, all generated sequences start with 72 * {@link Event#STARTEVENT} 73 * @return generated sequences 74 */ 75 public Set<List<? extends Event<?>>> generateSequences(int length, 76 boolean fromStart); 77 78 /** 79 * <p> 80 * Generates all sequences starting with {@link Event#STARTEVENT} and 81 * finishing with {@link Event#ENDEVENT} of a given length. It is possible 82 * that no such sequence exists with the defined length and the returned set 83 * is empty. If {@code length} is less than 2 the returned set is always 84 * empty. 85 * </p> 86 * 87 * @param length 88 * @return generated sequences 89 */ 19 90 public Set<List<? extends Event<?>>> generateValidSequences(int length); 20 91 92 /** 93 * <p> 94 * Returns the number of states known by the stochastic process, i.e., the 95 * size of its alphabet. 96 * </p> 97 * 98 * @return number of states 99 */ 21 100 public int getNumStates(); 22 101 102 /** 103 * <p> 104 * Returns a string representation of all known states. 105 * </p> 106 * 107 * @return string representation for all known states 108 */ 23 109 public String[] getStateStrings(); 24 110 111 /** 112 * <p> 113 * Returns all states known by the stochastic process, i.e., its 114 * {@link Event}s. 115 * </p> 116 * 117 * @return events known by the process 118 */ 25 119 public Set<? extends Event<?>> getEvents(); 26 120
Note: See TracChangeset
for help on using the changeset viewer.