aivika-transformers-5.2: Transformers for the Aivika simulation library

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

Simulation.Aivika.Trans.Results.Transform

Contents

Description

Tested with: GHC 8.0.1

The module defines useful result transformations that can be used in simulation experiments.

Synopsis

Basic Class Type

Sampling Statistics

newtype SamplingStats m Source #

Represents a statistics based upon observations.

Constructors

SamplingStats (ResultTransform m) 

samplingStatsCount :: MonadDES m => SamplingStats m -> ResultTransform m Source #

The total number of samples.

samplingStatsMin :: MonadDES m => SamplingStats m -> ResultTransform m Source #

The minimum value among the samples.

samplingStatsMax :: MonadDES m => SamplingStats m -> ResultTransform m Source #

The maximum value among the samples.

samplingStatsMean2 :: MonadDES m => SamplingStats m -> ResultTransform m Source #

The average square value.

Time-dependent Statistics

newtype TimingStats m Source #

The time-dependent statistics.

Constructors

TimingStats (ResultTransform m) 

timingStatsCount :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the number of samples.

timingStatsMin :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the minimum value.

timingStatsMax :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the maximum value.

timingStatsMean :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the average value.

timingStatsVariance :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the variance.

timingStatsDeviation :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the deviation.

timingStatsMinTime :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the time at which the minimum is attained.

timingStatsMaxTime :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the time at which the maximum is attained.

timingStatsStartTime :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the start time of sampling.

timingStatsLastTime :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the last time of sampling.

timingStatsSum :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the sum of values.

timingStatsSum2 :: MonadDES m => TimingStats m -> ResultTransform m Source #

Return the sum of square values.

Sampling-based Counter

newtype SamplingCounter m Source #

A counter for which the statistics is collected too.

samplingCounterStats :: SamplingCounter m -> SamplingStats m Source #

The counter statistics.

Time-dependent Counter

newtype TimingCounter m Source #

A time-dependent counter that collects the statistics too.

Constructors

TimingCounter (ResultTransform m) 

timingCounterStats :: TimingCounter m -> TimingStats m Source #

The counter statistics.

Queue

newtype Queue m Source #

Represents either finite or infinite queue.

Constructors

Queue (ResultTransform m) 

enqueueStrategy :: Queue m -> ResultTransform m Source #

The strategy applied to the enqueueing (input) processes when the finite queue is full.

enqueueStoringStrategy :: Queue m -> ResultTransform m Source #

The strategy applied when storing (in memory) items in the queue.

dequeueStrategy :: Queue m -> ResultTransform m Source #

The strategy applied to the dequeueing (output) processes when the queue is empty.

queueNull :: Queue m -> ResultTransform m Source #

Test whether the queue is empty.

queueFull :: Queue m -> ResultTransform m Source #

Test whether the finite queue is full.

queueMaxCount :: Queue m -> ResultTransform m Source #

The finite queue capacity.

queueCount :: Queue m -> ResultTransform m Source #

Return the current queue size.

queueCountStats :: Queue m -> TimingStats m Source #

Return the queue size statistics.

enqueueCount :: Queue m -> ResultTransform m Source #

Return the total number of input items that were enqueued in the finite queue.

enqueueLostCount :: Queue m -> ResultTransform m Source #

Return the number of lost items for the finite queue.

enqueueStoreCount :: Queue m -> ResultTransform m Source #

Return the total number of input items that were stored.

dequeueCount :: Queue m -> ResultTransform m Source #

Return the total number of requests for dequeueing the items, not taking into account the failed attempts to dequeue immediately without suspension.

dequeueExtractCount :: Queue m -> ResultTransform m Source #

Return the total number of output items that were actually dequeued.

queueLoadFactor :: Queue m -> ResultTransform m Source #

Return the load factor: the finite queue size divided by its capacity.

enqueueRate :: Queue m -> ResultTransform m Source #

Return the rate of the input items that were enqueued in the finite queue: how many items per time.

enqueueStoreRate :: Queue m -> ResultTransform m Source #

Return the rate of the items that were stored: how many items per time.

dequeueRate :: Queue m -> ResultTransform m Source #

Return the rate of the requests for dequeueing the items: how many requests per time. It does not include the failed attempts to dequeue immediately without suspension.

dequeueExtractRate :: Queue m -> ResultTransform m Source #

Return the rate of the output items that were dequeued: how many items per time.

queueWaitTime :: Queue m -> SamplingStats m Source #

Return the wait time from the time at which the item was stored in the queue to the time at which it was dequeued.

queueTotalWaitTime :: Queue m -> SamplingStats m Source #

Return the total wait time for the finite queue from the time at which the enqueueing operation was initiated to the time at which the item was dequeued.

enqueueWaitTime :: Queue m -> SamplingStats m Source #

Return the wait time from the time at which the item was stored in the queue to the time at which it was dequeued.

dequeueWaitTime :: Queue m -> SamplingStats m Source #

Return the dequeue wait time from the time at which the item was requested for dequeueing to the time at which it was actually dequeued.

queueRate :: Queue m -> ResultTransform m Source #

Return a long-term average queue rate calculated as the average queue size divided by the average wait time.

Arrival Timer

newtype ArrivalTimer m Source #

Accumulates the statistics about that how long the arrived events are processed.

Constructors

ArrivalTimer (ResultTransform m) 

arrivalProcessingTime :: ArrivalTimer m -> SamplingStats m Source #

Return the statistics about that how long the arrived events were processed.

Server

newtype Server m Source #

It models the server that prodives a service.

Constructors

Server (ResultTransform m) 

serverInitState :: Server m -> ResultTransform m Source #

The initial state of the server.

serverState :: Server m -> ResultTransform m Source #

Return the current state of the server.

serverTotalInputWaitTime :: Server m -> ResultTransform m Source #

Return the counted total time when the server was locked while awaiting the input.

serverTotalProcessingTime :: Server m -> ResultTransform m Source #

Return the counted total time spent by the server while processing the tasks.

serverTotalOutputWaitTime :: Server m -> ResultTransform m Source #

Return the counted total time when the server was locked while trying to deliver the output.

serverTotalPreemptionTime :: Server m -> ResultTransform m Source #

Return the counted total time spent by the server while it was preempted waiting for the further proceeding.

serverInputWaitTime :: Server m -> SamplingStats m Source #

Return the statistics of the time when the server was locked while awaiting the input.

serverProcessingTime :: Server m -> SamplingStats m Source #

Return the statistics of the time spent by the server while processing the tasks.

serverOutputWaitTime :: Server m -> SamplingStats m Source #

Return the statistics of the time when the server was locked while trying to deliver the output.

serverPreemptionTime :: Server m -> SamplingStats m Source #

Return the statistics of the time spent by the server while it was preempted waiting for the further proceeding.

serverInputWaitFactor :: Server m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the server was awaiting for the next input task.

serverProcessingFactor :: Server m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the server was busy with direct processing its tasks.

serverOutputWaitFactor :: Server m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the server was locked trying to deliver the output after the task is finished.

serverPreemptionFactor :: Server m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the server was preempted waiting for the further proceeding.

Activity

newtype Activity m Source #

It models an activity that can be utilised.

Constructors

Activity (ResultTransform m) 

activityInitState :: Activity m -> ResultTransform m Source #

The initial state of the activity.

activityState :: Activity m -> ResultTransform m Source #

Return the current state of the activity.

activityTotalUtilisationTime :: Activity m -> ResultTransform m Source #

Return the counted total time when the activity was utilised.

activityTotalIdleTime :: Activity m -> ResultTransform m Source #

Return the counted total time when the activity was idle.

activityTotalPreemptionTime :: Activity m -> ResultTransform m Source #

Return the counted total time when the activity was preemted waiting for the further proceeding.

activityUtilisationTime :: Activity m -> SamplingStats m Source #

Return the statistics for the time when the activity was utilised.

activityIdleTime :: Activity m -> SamplingStats m Source #

Return the statistics for the time when the activity was idle.

activityPreemptionTime :: Activity m -> SamplingStats m Source #

Return the statistics for the time when the activity was preempted waiting for the further proceeding.

activityUtilisationFactor :: Activity m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the activity was utilised.

activityIdleFactor :: Activity m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the activity was idle.

activityPreemptionFactor :: Activity m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the activity was preempted waiting for the further proceeding.

Resource

newtype Resource m Source #

The resource which can be acquired and then released.

Constructors

Resource (ResultTransform m) 

resourceCount :: Resource m -> ResultTransform m Source #

Return the current available count of the resource.

resourceCountStats :: Resource m -> TimingStats m Source #

Return the statistics for the available count of the resource.

resourceUtilisationCount :: Resource m -> ResultTransform m Source #

Return the current utilisation count of the resource.

resourceUtilisationCountStats :: Resource m -> TimingStats m Source #

Return the statistics for the utilisation count of the resource.

resourceQueueCount :: Resource m -> ResultTransform m Source #

Return the current queue length of the resource.

resourceQueueCountStats :: Resource m -> TimingStats m Source #

Return the statistics for the queue length of the resource.

resourceTotalWaitTime :: Resource m -> ResultTransform m Source #

Return the total wait time of the resource.

resourceWaitTime :: Resource m -> SamplingStats m Source #

Return the statistics for the wait time of the resource.

Operation

newtype Operation m Source #

It models an opreation which actvity can be utilised.

Constructors

Operation (ResultTransform m) 

operationTotalUtilisationTime :: Operation m -> ResultTransform m Source #

Return the counted total time when the operation activity was utilised.

operationTotalPreemptionTime :: Operation m -> ResultTransform m Source #

Return the counted total time when the operation activity was preemted waiting for the further proceeding.

operationUtilisationTime :: Operation m -> SamplingStats m Source #

Return the statistics for the time when the operation activity was utilised.

operationPreemptionTime :: Operation m -> SamplingStats m Source #

Return the statistics for the time when the operation activity was preempted waiting for the further proceeding.

operationUtilisationFactor :: Operation m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the operation activity was utilised.

operationPreemptionFactor :: Operation m -> ResultTransform m Source #

It returns the factor changing from 0 to 1, which estimates how often the operation activity was preempted waiting for the further proceeding.