ccs.chaos
Class ChaosMetrics

java.lang.Object
  extended by ccs.chaos.ChaosMetrics
All Implemented Interfaces:
java.io.Serializable

public class ChaosMetrics
extends java.lang.Object
implements java.io.Serializable

A ChaosMetrics object is returned when an entropy sample is submitted via a ChaosSetter. It contains information about the quality of the sample.

See Also:
Serialized Form

Field Summary
 double degrader
          The entropy degradation factor.
 double entropy
          The mean entropy per byte.
 int[] hist
          Histogram of value vs. frequency. hist[i] contains the number of sample bytes with value i.
 double mean
          The arithmetic mean of the sample.
 int n
          The number of bytes in the sample.
 double scorr
          The serial correlation coefficient of the sample.
 
Constructor Summary
ChaosMetrics()
          Construct an empty ChaosMetrics.
ChaosMetrics(byte[] sample)
          Construct a ChaosMetrics which measures the supplied sample.
ChaosMetrics(ChaosMetrics cm)
          Construct a ChaosMetrics which is a copy of another ChaosMetrics.
 
Method Summary
 void transientMarshal(java.io.DataOutputStream dos)
          Transfer the ChaosMetrics over a stream.
 void transientUnmarshal(java.io.DataInputStream dis)
          Transfer the ChaosMetrics over a stream.
 void xmlMarshal(CXTStream cxt)
          Express the ChaosMetrics as a CXT element, histogram excluded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

n

public int n
The number of bytes in the sample.


entropy

public double entropy
The mean entropy per byte. Perfect: 8.000. This used to be a float, which was plenty, but as of Checkpoint 5.10 it has to be transportable via Hessian (CXP2) which doesn't do floats.


degrader

public double degrader
The entropy degradation factor. When considering the entropy contribution to the pool due to this sample, entropy is multiplied by this in order to make sure the pool entropy estimate is conservative. Precision: cf entropy.


mean

public double mean
The arithmetic mean of the sample. Perfect: 127.500. Precision: cf entropy.


scorr

public double scorr
The serial correlation coefficient of the sample. Perfect: 0.000. Varies between -1.000 and +1.000: both are equally bad. Precision: cf entropy.


hist

public int[] hist
Histogram of value vs. frequency. hist[i] contains the number of sample bytes with value i.

Constructor Detail

ChaosMetrics

public ChaosMetrics()
Construct an empty ChaosMetrics.


ChaosMetrics

public ChaosMetrics(byte[] sample)
Construct a ChaosMetrics which measures the supplied sample.


ChaosMetrics

public ChaosMetrics(ChaosMetrics cm)
Construct a ChaosMetrics which is a copy of another ChaosMetrics.

Method Detail

transientMarshal

public void transientMarshal(java.io.DataOutputStream dos)
                      throws java.io.IOException
Transfer the ChaosMetrics over a stream.

Throws:
java.io.IOException

transientUnmarshal

public void transientUnmarshal(java.io.DataInputStream dis)
                        throws java.io.IOException
Transfer the ChaosMetrics over a stream.

Throws:
java.io.IOException

xmlMarshal

public void xmlMarshal(CXTStream cxt)
                throws java.io.IOException
Express the ChaosMetrics as a CXT element, histogram excluded.

Throws:
java.io.IOException