Skip to content

Commit 99c480a

Browse files
committed
Started text on histograms
1 parent 16286a6 commit 99c480a

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

docs/manual.adoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,3 +753,35 @@ public class TimeVariance extends Variance
753753
----
754754

755755
Whenever a value is supplied to an instance of the TimeVariance class the simulation time at which it occurred is also noted. If a value changes, or the timeAverage() method is invoked, then the time it has been maintained for is calculated and the statistical data is updated.
756+
757+
=== Histograms
758+
759+
Mean, Variance, and TimeVariance provide a snapshot of values in the simulation. However, histograms can yield better information about how a range of values change over the course of a simulation run. This information can be viewed in a number of ways, but typically it is plotted in graphical form.
760+
761+
A histogram typically maintains a slot for each value, or range of values, given to it. These slots are termed _buckets_, and the way in which these buckets are maintained and manipulated gives rise to a variety of different histogram implementations. The following sections detail this variety of different histogram classes.
762+
763+
==== PrecisionHistogram
764+
765+
The PrecisionHistogram class represents the core histogram class from which all others are derived. This class keeps an exact tally of all values given to it, i.e., a bucket is created for each value. Although buckets are only created when requires, over the course of a simulation this can still utilise a large amount of resources, and so other, less precise, histogram classes are provided.
766+
767+
----
768+
public class PrecisionHistogram extends Variance
769+
{
770+
public void setValue (double value) throws IllegalArgumentException;
771+
772+
public void reset ();
773+
774+
public long numberOfBuckets ();
775+
776+
public double sizeByIndex (long index) throws StatisticsException, IllegalArgumentException;
777+
public double sizeByName (double name) throws IllegalArgumentException;
778+
779+
public boolean saveState (String fileName) throws IOException;
780+
public boolean saveState (DataOutputStream oFile) throws IOException;
781+
782+
public boolean restoreState (String fileName) throws FileNotFoundException, IOException;
783+
public boolean restoreState (DataInputStream iFile) throws IOException;
784+
785+
public void print ();
786+
};
787+
----

0 commit comments

Comments
 (0)