aivika-gpss-0.7.1: GPSS-like DSL for Aivika
CopyrightCopyright (c) 2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Trans.GPSS.Facility

Description

Tested with: GHC 8.0.1

This module defines the GPSS Facility entity.

Synopsis

Facility Type

data Facility m a Source #

Represents a GPSS Facility entity.

data FacilityPreemptMode m a Source #

The facility preemption mode.

Constructors

FacilityPreemptMode 

Fields

type FacilityPreemptTransfer m a = Transact m a -> Maybe Double -> Process m () Source #

Proceed with the computation by the specified preempted transact and remaining time from the process holding computation such as the ADVANCE block.

Creating Facility

newFacility :: MonadDES m => Event m (Facility m a) Source #

Create a new facility.

Facility Properties

facilityCount :: MonadDES m => Facility m a -> Event m Int Source #

Return the current available count of the facility.

facilityCountStats :: MonadDES m => Facility m a -> Event m (TimingStats Int) Source #

Return the statistics for the available count of the facility.

facilityCaptureCount :: MonadDES m => Facility m a -> Event m Int Source #

Return the current capture count of the facility.

facilityUtilisationCount :: MonadDES m => Facility m a -> Event m Int Source #

Return the current utilisation count of the facility.

facilityUtilisationCountStats :: MonadDES m => Facility m a -> Event m (TimingStats Int) Source #

Return the statistics for the utilisation count of the facility.

facilityQueueCount :: MonadDES m => Facility m a -> Event m Int Source #

Return the current queue length of the facility.

facilityQueueCountStats :: MonadDES m => Facility m a -> Event m (TimingStats Int) Source #

Return the statistics for the queue length of the facility.

facilityTotalWaitTime :: MonadDES m => Facility m a -> Event m Double Source #

Return the total wait time of the facility.

facilityWaitTime :: MonadDES m => Facility m a -> Event m (SamplingStats Double) Source #

Return the statistics for the wait time of the facility.

facilityTotalHoldingTime :: MonadDES m => Facility m a -> Event m Double Source #

Return the total holding time of the facility.

facilityHoldingTime :: MonadDES m => Facility m a -> Event m (SamplingStats Double) Source #

Return the statistics for the holding time of the facility.

facilityInterrupted :: MonadDES m => Facility m a -> Event m Bool Source #

Whether the facility is currently interrupted.

Seizing-Releasing and Preempting-Returning Facility

seizeFacility Source #

Arguments

:: MonadDES m 
=> Facility m a

the requested facility

-> Transact m a

the transact that tries to seize the facility

-> Process m () 

Seize the facility.

releaseFacility Source #

Arguments

:: MonadDES m 
=> Facility m a

the facility to release

-> Transact m a

the active transact that tries to release the facility

-> Process m () 

Release the facility by the active transact.

preemptFacility Source #

Arguments

:: MonadDES m 
=> Facility m a

the requested facility

-> Transact m a

the transact that tries to preempt the facility

-> FacilityPreemptMode m a

the Preempt mode

-> Process m () 

Preempt the facility.

returnFacility Source #

Arguments

:: MonadDES m 
=> Facility m a

the facility to return

-> Transact m a

the active transact that tries to return the facility

-> Process m () 

Return the facility by the active transact.

Statistics Reset

resetFacility :: MonadDES m => Facility m a -> Event m () Source #

Reset the statistics.

Signals

facilityCountChanged :: MonadDES m => Facility m a -> Signal m Int Source #

Signal triggered when the facilityCount property changes.

facilityCountChanged_ :: MonadDES m => Facility m a -> Signal m () Source #

Signal triggered when the facilityCount property changes.

facilityCaptureCountChanged :: MonadDES m => Facility m a -> Signal m Int Source #

Signal triggered when the facilityCaptureCount property changes.

facilityCaptureCountChanged_ :: MonadDES m => Facility m a -> Signal m () Source #

Signal triggered when the facilityCaptureCount property changes.

facilityUtilisationCountChanged :: MonadDES m => Facility m a -> Signal m Int Source #

Signal triggered when the facilityUtilisationCount property changes.

facilityUtilisationCountChanged_ :: MonadDES m => Facility m a -> Signal m () Source #

Signal triggered when the facilityUtilisationCount property changes.

facilityQueueCountChanged :: MonadDES m => Facility m a -> Signal m Int Source #

Signal triggered when the facilityQueueCount property changes.

facilityQueueCountChanged_ :: MonadDES m => Facility m a -> Signal m () Source #

Signal triggered when the facilityQueueCount property changes.

facilityWaitTimeChanged :: MonadDES m => Facility m a -> Signal m (SamplingStats Double) Source #

Signal triggered when the facilityTotalWaitTime and facilityWaitTime properties change.

facilityWaitTimeChanged_ :: MonadDES m => Facility m a -> Signal m () Source #

Signal triggered when the facilityTotalWaitTime and facilityWaitTime properties change.

facilityHoldingTimeChanged_ :: MonadDES m => Facility m a -> Signal m () Source #

Signal triggered when the facilityTotalHoldingTime and facilityHoldingTime properties change.

facilityChanged_ :: MonadDES m => Facility m a -> Signal m () Source #

Signal triggered when one of the facility counters changes.