aivika-4.6: A multi-method simulation library

CopyrightCopyright (c) 2009-2016 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Simulation.Aivika.Statistics

Contents

Description

Tested with: GHC 8.0.1

Represents statistics.

Synopsis

Simple Statistics

data SamplingStats a Source #

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

Constructors

SamplingStats 

Fields

Instances

Eq a => Eq (SamplingStats a) Source # 
Ord a => Ord (SamplingStats a) Source # 
Show a => Show (SamplingStats a) Source # 
SamplingData a => Monoid (SamplingStats a) Source # 
ResultItemable (ResultValue (SamplingStats Double)) Source # 
ResultItemable (ResultValue (SamplingStats Int)) Source # 
ResultComputing m => ResultProvider (m (SamplingStats Int)) Source # 
ResultComputing m => ResultProvider (m (SamplingStats Double)) Source # 

combineSamplingStatsEither :: SamplingData a => Either a (SamplingStats a) -> SamplingStats a -> SamplingStats a Source #

If allows combining statistics more efficiently if we know that the first argument can be a scalar.

samplingStatsVariance :: SamplingStats a -> Double Source #

Return the variance.

samplingStatsDeviation :: SamplingStats a -> Double Source #

Return the deviation.

samplingStatsSummary :: Show a => SamplingStats a -> Int -> ShowS Source #

Show the summary of the statistics using the specified indent.

returnSamplingStats :: SamplingData a => a -> SamplingStats a Source #

Return the statistics by a single sample.

listSamplingStats :: SamplingData a => [a] -> SamplingStats a Source #

Create the statistics by the specified list of data.

fromIntSamplingStats :: SamplingStats Int -> SamplingStats Double Source #

Convert the statistics from integer to double values.

Timing Statistics

data TimingStats a Source #

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

Constructors

TimingStats 

Fields

Instances

Eq a => Eq (TimingStats a) Source # 
Ord a => Ord (TimingStats a) Source # 
(Show a, TimingData a) => Show (TimingStats a) Source # 
ResultItemable (ResultValue (TimingStats Double)) Source # 
ResultItemable (ResultValue (TimingStats Int)) Source # 
ResultComputing m => ResultProvider (m (TimingStats Int)) Source # 
ResultComputing m => ResultProvider (m (TimingStats Double)) Source # 

timingStatsDeviation :: TimingData a => TimingStats a -> Double Source #

Return the deviation.

timingStatsSummary :: (Show a, TimingData a) => TimingStats a -> Int -> ShowS Source #

Show the summary of the statistics using the specified indent.

returnTimingStats :: TimingData a => Double -> a -> TimingStats a Source #

Return the statistics by single timing data.

fromIntTimingStats :: TimingStats Int -> TimingStats Double Source #

Convert the statistics from integer to double values.

normTimingStats :: TimingData a => Int -> TimingStats a -> SamplingStats a Source #

Convert the statistics to its normalised sampling-based representation, where the first argument specifies the number of pseudo-samples.

Simple Counter

data SamplingCounter a Source #

A counter for which the statistics is collected too.

Constructors

SamplingCounter 

Fields

incSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a Source #

Increase the counter.

decSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a Source #

Decrease the counter.

setSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a Source #

Set a new value for the counter.

returnSamplingCounter :: SamplingData a => a -> SamplingCounter a Source #

Create a counter with the specified initial value.

Timing Counter

data TimingCounter a Source #

A counter for which the timing statistics is collected too.

Constructors

TimingCounter 

Fields

incTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a Source #

Increase the counter at the specified time.

decTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a Source #

Decrease the counter at the specified time.

setTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a Source #

Set a new value for the counter at the specified time.

returnTimingCounter :: TimingData a => Double -> a -> TimingCounter a Source #

Create a timing counter with the specified initial value at the given time.