ostore.oil
Class HMM.Segment

java.lang.Object
  |
  +--ostore.oil.HMM.Segment
All Implemented Interfaces:
QueueElementIF, QuickSerializable, SegmentedModel.Segment
Enclosing class:
HMM

public static class HMM.Segment
extends Object
implements SegmentedModel.Segment

A Segment object contains the internal model state associated with a single state. It can be used to swap the information to/from an HMM.

Version:
$Id: HMM.java,v 1.24 2002/01/08 18:24:18 geels Exp $
Author:
Dennis Geels

Field Summary
 Array emissions
          Estimated count of output emissions from this state.
 double marginal
          Estimated marginal count for this state
 QuickSerializable state
          The ID for the state whose information is stored in Segment.
 Array transitions
          Estimated count of transitions out of this state.
 
Constructor Summary
HMM.Segment(byte[] data, int[] offset)
          Create a Segment from its QuickSerializable form.
HMM.Segment(QuickSerializable state, double marginal, Array transitions, Array emissions)
          Create a new Segment.
 
Method Summary
 QuickSerializable id()
          Returns the unique ID for this Segment.
 void to_bytes(byte[] data, int[] offset)
          Store the object in its "on the wire" form in the byte array data, starting at index offset [0], and increment offset [0] by the number of bytes written; if data == null, increment offset [0] by the number of bytes that would have been written otherwise.
 int type_code()
          Returns the unique integer associated with this class in the TypeTable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

public QuickSerializable state
The ID for the state whose information is stored in Segment.

marginal

public double marginal
Estimated marginal count for this state

transitions

public Array transitions
Estimated count of transitions out of this state.

emissions

public Array emissions
Estimated count of output emissions from this state.
Constructor Detail

HMM.Segment

public HMM.Segment(QuickSerializable state,
                   double marginal,
                   Array transitions,
                   Array emissions)
Create a new Segment.
Parameters:
state - The ID for the state whose information is stored in this Segment.
marginal - Estimated marginal count for this state
transitions - Estimated count of transitions out of this state.
emissions - Estimated count of output emissions from this state.

HMM.Segment

public HMM.Segment(byte[] data,
                   int[] offset)
            throws QSException
Create a Segment from its QuickSerializable form.
Method Detail

id

public QuickSerializable id()
Description copied from interface: SegmentedModel.Segment
Returns the unique ID for this Segment. This ID serves as the only key identifying a Segment - Segment.equals should never be called. (Segment.id()).equals and (Segment.id()).hashCode, however, may be called quite often. Avoid using QuickSerializable IDs for which those methods are expensive.
Specified by:
id in interface SegmentedModel.Segment
Following copied from interface: ostore.oil.SegmentedModel.Segment
Returns:
the unique ID for this Segment.

to_bytes

public void to_bytes(byte[] data,
                     int[] offset)
Description copied from interface: QuickSerializable
Store the object in its "on the wire" form in the byte array data, starting at index offset [0], and increment offset [0] by the number of bytes written; if data == null, increment offset [0] by the number of bytes that would have been written otherwise.
Specified by:
to_bytes in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Parameters:
data - The byte array to store into, or null.
offset - A single element array whose first element is the index in data to begin writing at on function entry, and which on function exit has been incremented by the number of bytes written.

type_code

public int type_code()
Description copied from interface: QuickSerializable
Returns the unique integer associated with this class in the TypeTable.
Specified by:
type_code in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Returns:
an integer unique to this class