package de.ugoe.cs.eventbench.models; import java.security.InvalidParameterException; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Random; import de.ugoe.cs.eventbench.data.Event; /** *
* Implements a Deterministic Finite Automata (DFA) capable of random session * generation. It is a special case of a first-order Markov model, where the * transition probability is equally high for all following states. *
* * @author Steffen Herbold * @version 1.0 */ public class DeterministicFiniteAutomaton extends FirstOrderMarkovModel { /** ** Id for object serialization. *
*/ private static final long serialVersionUID = 1L; /** ** Constructor. Creates a new DeterministicFiniteAutomaton. *
* * @param r * random number generator used by probabilistic methods of the * class */ public DeterministicFiniteAutomaton(Random r) { super(r); } /** ** Calculates the proability of the next state. Each of the following states * in the automaton is equally probable. *
* * @see de.ugoe.cs.eventbench.models.IStochasticProcess#getProbability(java.util.List, * de.ugoe.cs.eventbench.data.Event) */ @Override public double getProbability(List extends Event>> context, Event> symbol) { if( context==null ) { throw new InvalidParameterException("context must not be null"); } if( symbol==null ) { throw new InvalidParameterException("symbol must not be null"); } double result = 0.0d; List