aivika-gpss-0.3: GPSS-like DSL for Aivika

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

Simulation.Aivika.GPSS.Facility

Contents

Description

Tested with: GHC 8.0.1

This module defines the GPSS Facility entity.

Synopsis

Facility Type

data Facility a Source #

Represents a GPSS Facility entity.

Instances

Eq (Facility a) Source # 

Methods

(==) :: Facility a -> Facility a -> Bool #

(/=) :: Facility a -> Facility a -> Bool #

data FacilityPreemptMode a Source #

The facility preemption mode.

Constructors

FacilityPreemptMode 

Fields

type FacilityPreemptTransfer a = Transact a -> Maybe Double -> Process () 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 :: Event (Facility a) Source #

Create a new facility.

Facility Properties

facilityCount :: Facility a -> Event Int Source #

Return the current available count of the facility.

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

Return the statistics for the available count of the facility.

facilityCaptureCount :: Facility a -> Event Int Source #

Return the current capture count of the facility.

facilityUtilisationCount :: Facility a -> Event Int Source #

Return the current utilisation count of the facility.

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

Return the statistics for the utilisation count of the facility.

facilityQueueCount :: Facility a -> Event Int Source #

Return the current queue length of the facility.

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

Return the statistics for the queue length of the facility.

facilityTotalWaitTime :: Facility a -> Event Double Source #

Return the total wait time of the facility.

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

Return the statistics for the wait time of the facility.

facilityTotalHoldingTime :: Facility a -> Event Double Source #

Return the total holding time of the facility.

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

Return the statistics for the holding time of the facility.

facilityInterrupted :: Facility a -> Event Bool Source #

Whether the facility is currently interrupted.

Seizing-Releasing and Preempting-Returning Facility

seizeFacility Source #

Arguments

:: Facility a

the requested facility

-> Transact a

the transact that tries to seize the facility

-> Process () 

Seize the facility.

releaseFacility Source #

Arguments

:: Facility a

the facility to release

-> Transact a

the active transact that tries to release the facility

-> Process () 

Release the facility by the active transact.

preemptFacility Source #

Arguments

:: Facility a

the requested facility

-> Transact a

the transact that tries to preempt the facility

-> FacilityPreemptMode a

the Preempt mode

-> Process () 

Preempt the facility.

returnFacility Source #

Arguments

:: Facility a

the facility to return

-> Transact a

the active transact that tries to return the facility

-> Process () 

Return the facility by the active transact.

Statistics Reset

resetFacility :: Facility a -> Event () Source #

Reset the statistics.

Signals

facilityCountChanged :: Facility a -> Signal Int Source #

Signal triggered when the facilityCount property changes.

facilityCountChanged_ :: Facility a -> Signal () Source #

Signal triggered when the facilityCount property changes.

facilityCaptureCountChanged :: Facility a -> Signal Int Source #

Signal triggered when the facilityCaptureCount property changes.

facilityCaptureCountChanged_ :: Facility a -> Signal () Source #

Signal triggered when the facilityCaptureCount property changes.

facilityUtilisationCountChanged :: Facility a -> Signal Int Source #

Signal triggered when the facilityUtilisationCount property changes.

facilityUtilisationCountChanged_ :: Facility a -> Signal () Source #

Signal triggered when the facilityUtilisationCount property changes.

facilityQueueCountChanged :: Facility a -> Signal Int Source #

Signal triggered when the facilityQueueCount property changes.

facilityQueueCountChanged_ :: Facility a -> Signal () Source #

Signal triggered when the facilityQueueCount property changes.

facilityWaitTimeChanged_ :: Facility a -> Signal () Source #

Signal triggered when the facilityTotalWaitTime and facilityWaitTime properties change.

facilityHoldingTimeChanged_ :: Facility a -> Signal () Source #

Signal triggered when the facilityTotalHoldingTime and facilityHoldingTime properties change.

facilityChanged_ :: Facility a -> Signal () Source #

Signal triggered when one of the facility counters changes.