aivika-0.5.1: A multi-paradigm simulation library

Stabilityexperimental
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Safe HaskellSafe-Inferred

Simulation.Aivika.Statistics

Description

Tested with: GHC 7.0.3

Represents statistics.

Synopsis

Documentation

data SamplingStats a Source

Describes when the statistics consists of only samples not bound to the simulation time.

Constructors

SamplingStats 

Fields

samplingStatsCount :: !Int

The total number of samples.

samplingStatsMin :: !a

The minimum value among the samples.

samplingStatsMax :: !a

The maximum value among the samples.

samplingStatsMean :: !Double

The average value.

samplingStatsMean2 :: !Double

The average square value.

Instances

Eq a => Eq (SamplingStats a) 
(Eq (SamplingStats a), Ord a) => Ord (SamplingStats a) 
Show a => Show (SamplingStats a) 

class SamplingData a whereSource

Specifies data type from which values we can gather the statistics.

Methods

emptySamplingStats :: SamplingStats aSource

An empty statistics that has no samples.

addSamplingStats :: a -> SamplingStats a -> SamplingStats aSource

Add a new sample to the statistics.

samplingStatsVariance :: SamplingStats a -> DoubleSource

Return the variance.

samplingStatsDeviation :: SamplingStats a -> DoubleSource

Return the deviation.

showSamplingStats :: Show a => SamplingStats a -> Int -> ShowSSource

Show the summary of the statistics with the specified indent.

data TimingStats a Source

This is the timing statistics where data are bound to the time.

Constructors

TimingStats 

Fields

timingStatsCount :: !Int

Return the number of samples.

timingStatsMin :: !a

Return the minimum value.

timingStatsMax :: !a

Return the maximum value.

timingStatsMinTime :: !Double

Return the time at which the minimum is attained.

timingStatsMaxTime :: !Double

Return the time at which the maximum is attained.

timingStatsStartTime :: !Double

Return the start time of sampling.

timingStatsLastTime :: !Double

Return the last time of sampling.

timingStatsSum :: !Double

Return the sum of values.

timingStatsSum2 :: !Double

Return the sum of square values.

Instances

Eq a => Eq (TimingStats a) 
(Eq (TimingStats a), Ord a) => Ord (TimingStats a) 
Show a => Show (TimingStats a) 

class TimingData a whereSource

Defines the data type from which values we can gather the timing statistics.

Methods

emptyTimingStats :: TimingStats aSource

An empty statistics that has no samples.

addTimingStats :: Double -> a -> TimingStats a -> TimingStats aSource

Add a sample with the specified time to the statistics.

timingStatsMean :: TimingStats a -> DoubleSource

Return the average value.

timingStatsVariance :: TimingStats a -> DoubleSource

Return the variance.

timingStatsDeviation :: TimingData a => TimingStats a -> DoubleSource

Return the deviation.

showTimingStats :: (Show a, TimingData a) => TimingStats a -> Int -> ShowSSource

Show the summary of the statistics with the specified indent.