aivika-5.3: A multi-method simulation library

Simulation.Aivika.Operation

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.

Instances

 Source # MethodsresultSource' :: ResultName -> [ResultName] -> ResultId -> [ResultId] -> Operation a b -> ResultSource 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.

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

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_.

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_.

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_.

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_.

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_.

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

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

# Derived Signals for Properties

Signal when the operationTotalUtilisationTime property value has changed.

Signal when the operationTotalUtilisationTime property value has changed.

Signal when the operationTotalPreemptionTime property value has changed.

Signal when the operationTotalPreemptionTime property value has changed.

Signal when the operationUtilisationTime property value has changed.

Signal when the operationUtilisationTime property value has changed.

Signal when the operationPreemptionTime property value has changed.

Signal when the operationPreemptionTime property value has changed.

Signal when the operationUtilisationFactor property value has changed.

Signal when the operationUtilisationFactor property value has changed.

Signal when the operationPreemptionFactor property value has changed.

Signal when the operationPreemptionFactor property value has changed.

# Basic Signals

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.

Raised when the operation activity utilisation was preempted.

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.