aivika-5.7: A multi-method 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.Operation

Contents

Description

Tested with: GHC 8.0.1

It defines a stateless activity, some simplification of Server and Activity.

Synopsis

Operation

data Operation a b Source #

Like Server it models an activity that takes a and provides b. But unlike the former this kind of activity has no state. Also it is destined to be used within Process computations.

newOperation Source #

Arguments

:: (a -> Process b)

provide an output by the specified input

-> Event (Operation a b) 

Create a new operation that can provide output b by input a.

By default, it is assumed that the activity utilisation cannot be preempted, because the handling of possible task preemption is rather costly operation.

newPreemptibleOperation Source #

Arguments

:: Bool

whether the activity can be preempted

-> (a -> Process b)

provide an output by the specified input

-> Event (Operation a b) 

Create a new operation that can provide output b by input a.

Processing

operationProcess :: Operation a b -> a -> Process b Source #

Return a computation for the specified operation. It updates internal counters.

The computation can be used only within one process at any time.

Operation Properties

operationTotalUtilisationTime :: Operation a b -> Event Double Source #

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

The value returned changes discretely and it is usually delayed relative to the current simulation time.

See also operationTotalUtilisationTimeChanged and operationTotalUtilisationTimeChanged_.

operationTotalPreemptionTime :: Operation a b -> Event Double Source #

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

The value returned changes discretely and it is usually delayed relative to the current simulation time.

See also operationTotalPreemptionTimeChanged and operationTotalPreemptionTimeChanged_.

operationUtilisationTime :: Operation a b -> Event (SamplingStats Double) Source #

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

The value returned changes discretely and it is usually delayed relative to the current simulation time.

See also operationUtilisationTimeChanged and operationUtilisationTimeChanged_.

operationPreemptionTime :: Operation a b -> Event (SamplingStats Double) Source #

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

The value returned changes discretely and it is usually delayed relative to the current simulation time.

See also operationPreemptionTimeChanged and operationPreemptionTimeChanged_.

operationUtilisationFactor :: Operation a b -> Event Double Source #

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

The value returned changes discretely and it is usually delayed relative to the current simulation time.

See also operationUtilisationFactorChanged and operationUtilisationFactorChanged_.

operationPreemptionFactor :: Operation a b -> Event Double Source #

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

The value returned changes discretely and it is usually delayed relative to the current simulation time.

See also operationPreemptionFactorChanged and operationPreemptionFactorChanged_.

Statistics Reset

resetOperation :: Operation a b -> Event () Source #

Reset the statistics.

Summary

operationSummary :: Operation a b -> Int -> Event ShowS Source #

Return the summary for the operation with desciption of its properties using the specified indent.

Derived Signals for Properties

operationTotalUtilisationTimeChanged_ :: Operation a b -> Signal () Source #

Signal when the operationTotalUtilisationTime property value has changed.

operationTotalPreemptionTimeChanged_ :: Operation a b -> Signal () Source #

Signal when the operationTotalPreemptionTime property value has changed.

operationUtilisationTimeChanged_ :: Operation a b -> Signal () Source #

Signal when the operationUtilisationTime property value has changed.

operationPreemptionTimeChanged_ :: Operation a b -> Signal () Source #

Signal when the operationPreemptionTime property value has changed.

operationUtilisationFactorChanged :: Operation a b -> Signal Double Source #

Signal when the operationUtilisationFactor property value has changed.

operationUtilisationFactorChanged_ :: Operation a b -> Signal () Source #

Signal when the operationUtilisationFactor property value has changed.

operationPreemptionFactorChanged :: Operation a b -> Signal Double Source #

Signal when the operationPreemptionFactor property value has changed.

operationPreemptionFactorChanged_ :: Operation a b -> Signal () Source #

Signal when the operationPreemptionFactor property value has changed.

Basic Signals

operationUtilising :: Operation a b -> Signal a Source #

Raised when starting to utilise the operation activity after a new input task is received.

operationUtilised :: Operation a b -> Signal (a, b) Source #

Raised when the operation activity has been utilised after the current task is processed.

operationPreemptionBeginning :: Operation a b -> Signal a Source #

Raised when the operation activity utilisation was preempted.

operationPreemptionEnding :: Operation a b -> Signal a Source #

Raised when the operation activity utilisation was proceeded after it had been preempted earlier.

Overall Signal

operationChanged_ :: Operation a b -> Signal () Source #

Signal whenever any property of the operation changes.