|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.biojava.utils.AbstractChangeable
|
+--org.biojava.bio.dp.SimpleMarkovModel
| Nested Class Summary |
| Nested classes inherited from class org.biojava.bio.dp.MarkovModel |
MarkovModel.DistributionForwarder |
| Field Summary | |
static long |
serialVersionUID
|
| Fields inherited from interface org.biojava.bio.dp.MarkovModel |
ARCHITECTURE, PARAMETER |
| Constructor Summary | |
SimpleMarkovModel(int heads,
Alphabet emissionAlpha)
Deprecated. |
|
SimpleMarkovModel(int heads,
Alphabet emissionAlpha,
java.lang.String name)
|
|
| Method Summary | |
void |
addState(State toAdd)
Adds a state to the model. |
boolean |
containsTransition(State from,
State to)
Returns wether a transition exists or not. |
void |
createTransition(State from,
State to)
Makes a transition between two states legal. |
void |
destroyTransition(State from,
State to)
Breaks a transition between two states legal. |
Alphabet |
emissionAlphabet()
Alphabet that is emitted by the emission states. |
protected ChangeSupport |
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this object |
Distribution |
getWeights(State source)
Get a probability Distribution over the transition from 'source'. |
int |
heads()
The number of heads on this model. |
MagicalState |
magicalState()
The MagicalState for this model. |
void |
removeState(State toGo)
Remove a state from the model. |
void |
setWeights(State source,
Distribution dist)
Use this methods to customize the transition probabilities. |
FiniteAlphabet |
stateAlphabet()
FiniteAlphabet of the states. |
FiniteAlphabet |
transitionsFrom(State from)
Returns the FiniteAlphabet of all states that have a transition from 'source'. |
FiniteAlphabet |
transitionsTo(State to)
Returns the FiniteAlphabet of all states that have a transition to 'dest'. |
| Methods inherited from class org.biojava.utils.AbstractChangeable |
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.biojava.utils.Changeable |
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
| Field Detail |
public static final long serialVersionUID
| Constructor Detail |
public SimpleMarkovModel(int heads,
Alphabet emissionAlpha,
java.lang.String name)
public SimpleMarkovModel(int heads,
Alphabet emissionAlpha)
| Method Detail |
protected ChangeSupport getChangeSupport(ChangeType ct)
AbstractChangeable
getChangeSupport in class AbstractChangeablepublic Alphabet emissionAlphabet()
MarkovModel
emissionAlphabet in interface MarkovModelpublic FiniteAlphabet stateAlphabet()
MarkovModelWe are modeling a finite-state-machine, so there will be a finite set of states.
The MagicalState returned by getMagicalState is always contained within this as the start/end state.
stateAlphabet in interface MarkovModelpublic int heads()
MarkovModelEach head consumes a single SymbolList. A single-head model just consumes/ emits a single sequence. A two-head model performs alignment between two sequences (e.g. smith-waterman). Models with more heads do more interesting things.
heads in interface MarkovModelpublic MagicalState magicalState()
MarkovModel
magicalState in interface MarkovModel
public Distribution getWeights(State source)
throws IllegalSymbolException
MarkovModel
getWeights in interface MarkovModelsource - the State currently occupied
IllegalSymbolException - if from is not a legal state
public void setWeights(State source,
Distribution dist)
throws IllegalSymbolException,
IllegalAlphabetException
By default, the distribution P(destination | source) is a totally free distribution. This allows the different probabilities to vary. If you wish to change this behaviour (for example, to make one set of transition probabilities equal to another), then use this method to replace the Distribution with one of your own.
setWeights in interface MarkovModeldist - the new Distribution over the transition probabilites from sourcesource - the source State
IllegalSymbolException - if source is not a member of this model
IllegalAlphabetException - if dist is not a distribution over the
states returned by model.transitionsFrom(source)
public void createTransition(State from,
State to)
throws IllegalSymbolException,
ChangeVetoException
MarkovModelThis should inform each TransitionListener that a transition is to be created using preCreateTransition, and if none of the listeners fire a ChangeVetoException, it should create the transition, and then inform each TransitionListener with postCreateTransition.
createTransition in interface MarkovModelfrom - the State currently occupiedto - the State to move to
ChangeVetoException - if creating the transition is vetoed
IllegalSymbolException - if either from or to are not legal states
public void destroyTransition(State from,
State to)
throws IllegalSymbolException,
ChangeVetoException
MarkovModelThis should inform each TransitionListener that a transition is to be broken using preDestroyTransition, and if none of the listeners fire a ChangeVetoException, it should break the transition, and then inform each TransitionListener with postDestroyTransition.
destroyTransition in interface MarkovModelfrom - the State currently occupiedto - the State to move to
ChangeVetoException - if breaking the transition is vetoed
IllegalSymbolException - if either from or to are not legal states
public boolean containsTransition(State from,
State to)
throws IllegalSymbolException
MarkovModel
containsTransition in interface MarkovModelfrom - the transitin sourceto - the transition destination
IllegalSymbolException - if either from or to are not states in this
model
public FiniteAlphabet transitionsFrom(State from)
throws IllegalSymbolException
MarkovModel
transitionsFrom in interface MarkovModelfrom - the source State
IllegalSymbolException
public FiniteAlphabet transitionsTo(State to)
throws IllegalSymbolException
MarkovModel
transitionsTo in interface MarkovModelto - the destination state
IllegalSymbolException
public void addState(State toAdd)
throws IllegalSymbolException,
ChangeVetoException
MarkovModel
addState in interface MarkovModeltoAdd - the state to add
ChangeVetoException - if either the model does not allow states to
be added, or the change was vetoed
IllegalSymbolException - if the state is not valid or is a MagicalState
public void removeState(State toGo)
throws IllegalSymbolException,
IllegalTransitionException,
ChangeVetoException
MarkovModelStates should not be removed untill they are involved in no transitions. This is to avoid producing corrupted models by accident.
removeState in interface MarkovModeltoGo - the state to remove
IllegalSymbolException - if the symbol is not part of this model
or a MagicalState
ChangeVetoException - if either the model does not allow states to
be removed, or the change was vetoed
IllegalTransitionException - if the state is currently involved in
any transitions
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||