aivika-5.0.1: A multi-method simulation library

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

Simulation.Aivika.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 Source #

Represents a statistics based upon observations.

samplingStatsCount :: SamplingStats -> ResultTransform Source #

The total number of samples.

samplingStatsMin :: SamplingStats -> ResultTransform Source #

The minimum value among the samples.

samplingStatsMax :: SamplingStats -> ResultTransform Source #

The maximum value among the samples.

Time-dependent Statistics

newtype TimingStats Source #

The time-dependent statistics.

timingStatsCount :: TimingStats -> ResultTransform Source #

Return the number of samples.

timingStatsMin :: TimingStats -> ResultTransform Source #

Return the minimum value.

timingStatsMax :: TimingStats -> ResultTransform Source #

Return the maximum value.

timingStatsMean :: TimingStats -> ResultTransform Source #

Return the average value.

timingStatsMinTime :: TimingStats -> ResultTransform Source #

Return the time at which the minimum is attained.

timingStatsMaxTime :: TimingStats -> ResultTransform Source #

Return the time at which the maximum is attained.

timingStatsStartTime :: TimingStats -> ResultTransform Source #

Return the start time of sampling.

timingStatsLastTime :: TimingStats -> ResultTransform Source #

Return the last time of sampling.

timingStatsSum :: TimingStats -> ResultTransform Source #

Return the sum of values.

timingStatsSum2 :: TimingStats -> ResultTransform Source #

Return the sum of square values.

Sampling-based Counter

newtype SamplingCounter Source #

A counter for which the statistics is collected too.

Time-dependent Counter

newtype TimingCounter Source #

A time-dependent counter that collects the statistics too.

timingCounterStats :: TimingCounter -> TimingStats Source #

The counter statistics.

Queue

newtype Queue Source #

Represents either finite or infinite queue.

Constructors

Queue ResultTransform 

enqueueStrategy :: Queue -> ResultTransform Source #

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

enqueueStoringStrategy :: Queue -> ResultTransform Source #

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

dequeueStrategy :: Queue -> ResultTransform Source #

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

queueNull :: Queue -> ResultTransform Source #

Test whether the queue is empty.

queueFull :: Queue -> ResultTransform Source #

Test whether the finite queue is full.

queueMaxCount :: Queue -> ResultTransform Source #

The finite queue capacity.

queueCount :: Queue -> ResultTransform Source #

Return the current queue size.

queueCountStats :: Queue -> TimingStats Source #

Return the queue size statistics.

enqueueCount :: Queue -> ResultTransform Source #

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

enqueueLostCount :: Queue -> ResultTransform Source #

Return the number of lost items for the finite queue.

enqueueStoreCount :: Queue -> ResultTransform Source #

Return the total number of input items that were stored.

dequeueCount :: Queue -> ResultTransform 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 -> ResultTransform Source #

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

queueLoadFactor :: Queue -> ResultTransform Source #

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

enqueueRate :: Queue -> ResultTransform Source #

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

enqueueStoreRate :: Queue -> ResultTransform Source #

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

dequeueRate :: Queue -> ResultTransform 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 -> ResultTransform Source #

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

queueWaitTime :: Queue -> SamplingStats 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 -> SamplingStats 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 -> SamplingStats 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 -> SamplingStats 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 -> ResultTransform Source #

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

Arrival Timer

newtype ArrivalTimer Source #

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

arrivalProcessingTime :: ArrivalTimer -> SamplingStats Source #

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

Server

newtype Server Source #

It models the server that prodives a service.

Constructors

Server ResultTransform 

serverInitState :: Server -> ResultTransform Source #

The initial state of the server.

serverState :: Server -> ResultTransform Source #

Return the current state of the server.

serverTotalInputWaitTime :: Server -> ResultTransform Source #

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

serverTotalProcessingTime :: Server -> ResultTransform Source #

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

serverTotalOutputWaitTime :: Server -> ResultTransform Source #

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

serverTotalPreemptionTime :: Server -> ResultTransform Source #

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

serverInputWaitTime :: Server -> SamplingStats Source #

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

serverProcessingTime :: Server -> SamplingStats Source #

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

serverOutputWaitTime :: Server -> SamplingStats Source #

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

serverPreemptionTime :: Server -> SamplingStats Source #

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

serverInputWaitFactor :: Server -> ResultTransform 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 -> ResultTransform 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 -> ResultTransform 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 -> ResultTransform 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 Source #

It models an activity that can be utilised.

activityInitState :: Activity -> ResultTransform Source #

The initial state of the activity.

activityState :: Activity -> ResultTransform Source #

Return the current state of the activity.

activityTotalUtilisationTime :: Activity -> ResultTransform Source #

Return the counted total time when the activity was utilised.

activityTotalIdleTime :: Activity -> ResultTransform Source #

Return the counted total time when the activity was idle.

activityTotalPreemptionTime :: Activity -> ResultTransform Source #

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

activityUtilisationTime :: Activity -> SamplingStats Source #

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

activityIdleTime :: Activity -> SamplingStats Source #

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

activityPreemptionTime :: Activity -> SamplingStats Source #

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

activityUtilisationFactor :: Activity -> ResultTransform Source #

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

activityIdleFactor :: Activity -> ResultTransform Source #

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

activityPreemptionFactor :: Activity -> ResultTransform 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 Source #

The resource which can be acquired and then released.

resourceCount :: Resource -> ResultTransform Source #

Return the current available count of the resource.

resourceCountStats :: Resource -> TimingStats Source #

Return the statistics for the available count of the resource.

resourceUtilisationCount :: Resource -> ResultTransform Source #

Return the current utilisation count of the resource.

resourceUtilisationCountStats :: Resource -> TimingStats Source #

Return the statistics for the utilisation count of the resource.

resourceQueueCount :: Resource -> ResultTransform Source #

Return the current queue length of the resource.

resourceQueueCountStats :: Resource -> TimingStats Source #

Return the statistics for the queue length of the resource.

resourceTotalWaitTime :: Resource -> ResultTransform Source #

Return the total wait time of the resource.

resourceWaitTime :: Resource -> SamplingStats Source #

Return the statistics for the wait time of the resource.

Operation

newtype Operation Source #

It models an opreation which actvity can be utilised.

operationTotalUtilisationTime :: Operation -> ResultTransform Source #

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

operationTotalPreemptionTime :: Operation -> ResultTransform Source #

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

operationUtilisationTime :: Operation -> SamplingStats Source #

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

operationPreemptionTime :: Operation -> SamplingStats Source #

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

operationUtilisationFactor :: Operation -> ResultTransform Source #

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

operationPreemptionFactor :: Operation -> ResultTransform Source #

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