{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}

-- |
-- Module     : Simulation.Aivika.Trans.GPSS.Results
-- Copyright  : Copyright (c) 2017, David Sorokin <david.sorokin@gmail.com>
-- License    : BSD3
-- Maintainer : David Sorokin <david.sorokin@gmail.com>
-- Stability  : experimental
-- Tested with: GHC 8.0.2
--
-- The module allows exporting the simulation results from the model.
--
module Simulation.Aivika.Trans.GPSS.Results () where

import Control.Monad
import Control.Monad.Trans

import Simulation.Aivika.Trans

import qualified Simulation.Aivika.Trans.GPSS.Queue as Q
import Simulation.Aivika.Trans.GPSS.Facility
import Simulation.Aivika.Trans.GPSS.Storage
import Simulation.Aivika.Trans.GPSS.Results.Locale
  
-- | Return a source by the specified queue.
queueResultSource :: MonadDES m
                     => ResultContainer (Q.Queue m) m
                     -- ^ the queue container
                     -> ResultSource m
queueResultSource :: ResultContainer (Queue m) m -> ResultSource m
queueResultSource ResultContainer (Queue m) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Queue m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Queue m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Queue m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
queueId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Queue m) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Queue m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (Queue m) m -> ResultSource m
queueResultSummary ResultContainer (Queue m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m Bool)
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueNull" ResultId
queueNullId Queue m -> Event m Bool
forall (m :: * -> *). MonadDES m => Queue m -> Event m Bool
Q.queueNull Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueNullChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m Int)
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueContent" ResultId
queueContentId Queue m -> Event m Int
forall (m :: * -> *). MonadDES m => Queue m -> Event m Int
Q.queueContent Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueContentChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m (TimingStats Int))
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueContentStats" ResultId
queueContentStatsId Queue m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadDES m =>
Queue m -> Event m (TimingStats Int)
Q.queueContentStats Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueContentChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m Int)
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"enqueueCount" ResultId
enqueueCountId Queue m -> Event m Int
forall (m :: * -> *). MonadDES m => Queue m -> Event m Int
Q.enqueueCount Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.enqueueCountChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m Int)
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"enqueueZeroEntryCount" ResultId
enqueueZeroEntryCountId Queue m -> Event m Int
forall (m :: * -> *). MonadDES m => Queue m -> Event m Int
Q.enqueueZeroEntryCount Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.enqueueZeroEntryCountChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m (SamplingStats Double))
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueWaitTime" ResultId
queueWaitTimeId Queue m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadDES m =>
Queue m -> Event m (SamplingStats Double)
Q.queueWaitTime Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueWaitTimeChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m (SamplingStats Double))
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueNonZeroEntryWaitTime" ResultId
queueNonZeroEntryWaitTimeId Queue m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadDES m =>
Queue m -> Event m (SamplingStats Double)
Q.queueNonZeroEntryWaitTime Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueNonZeroEntryWaitTimeChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m Double)
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueRate" ResultId
queueRateId Queue m -> Event m Double
forall (m :: * -> *). MonadDES m => Queue m -> Event m Double
Q.queueRate Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueRateChanged_ ] }

-- | Return the summary by the specified queue.
queueResultSummary :: MonadDES m =>
                      ResultContainer (Q.Queue m) m
                      -- ^ the queue container
                      -> ResultSource m
queueResultSummary :: ResultContainer (Queue m) m -> ResultSource m
queueResultSummary ResultContainer (Queue m) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Queue m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Queue m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Queue m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
queueId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Queue m) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Queue m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (Queue m) m -> ResultSource m
queueResultSummary ResultContainer (Queue m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m (TimingStats Int))
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueContentStats" ResultId
queueContentStatsId Queue m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadDES m =>
Queue m -> Event m (TimingStats Int)
Q.queueContentStats Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueContentChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m Int)
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"enqueueCount" ResultId
enqueueCountId Queue m -> Event m Int
forall (m :: * -> *). MonadDES m => Queue m -> Event m Int
Q.enqueueCount Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.enqueueCountChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m Int)
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"enqueueZeroEntryCount" ResultId
enqueueZeroEntryCountId Queue m -> Event m Int
forall (m :: * -> *). MonadDES m => Queue m -> Event m Int
Q.enqueueZeroEntryCount Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.enqueueZeroEntryCountChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m (SamplingStats Double))
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueWaitTime" ResultId
queueWaitTimeId Queue m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadDES m =>
Queue m -> Event m (SamplingStats Double)
Q.queueWaitTime Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueWaitTimeChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m (SamplingStats Double))
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueNonZeroEntryWaitTime" ResultId
queueNonZeroEntryWaitTimeId Queue m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadDES m =>
Queue m -> Event m (SamplingStats Double)
Q.queueNonZeroEntryWaitTime Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueNonZeroEntryWaitTimeChanged_,
      ResultContainer (Queue m) m
-> ResultName
-> ResultId
-> (Queue m -> Event m Double)
-> (Queue m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m) m
c ResultName
"queueRate" ResultId
queueRateId Queue m -> Event m Double
forall (m :: * -> *). MonadDES m => Queue m -> Event m Double
Q.queueRate Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueRateChanged_ ] }

-- | Return a source by the specified facility.
facilityResultSource :: MonadDES m =>
                        ResultContainer (Facility m a) m
                        -- ^ the facility container
                        -> ResultSource m
facilityResultSource :: ResultContainer (Facility m a) m -> ResultSource m
facilityResultSource ResultContainer (Facility m a) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Facility m a) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Facility m a) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Facility m a) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Facility m a) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
facilityId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Facility m a) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Facility m a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Facility m a) m -> ResultSource m
forall (m :: * -> *) a.
MonadDES m =>
ResultContainer (Facility m a) m -> ResultSource m
facilityResultSummary ResultContainer (Facility m a) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m Int)
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"queueCount" ResultId
facilityQueueCountId Facility m a -> Event m Int
forall (m :: * -> *) a. MonadDES m => Facility m a -> Event m Int
facilityQueueCount Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityQueueCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (TimingStats Int))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"queueCountStats" ResultId
facilityQueueCountStatsId Facility m a -> Event m (TimingStats Int)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (TimingStats Int)
facilityQueueCountStats Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityQueueCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m Double)
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"totalWaitTime" ResultId
facilityTotalWaitTimeId Facility m a -> Event m Double
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m Double
facilityTotalWaitTime Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityWaitTimeChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (SamplingStats Double))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"waitTime" ResultId
facilityWaitTimeId Facility m a -> Event m (SamplingStats Double)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (SamplingStats Double)
facilityWaitTime Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityWaitTimeChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m Double)
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"totalHoldingTime" ResultId
facilityTotalHoldingTimeId Facility m a -> Event m Double
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m Double
facilityTotalHoldingTime Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityHoldingTimeChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (SamplingStats Double))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"holdingTime" ResultId
facilityHoldingTimeId Facility m a -> Event m (SamplingStats Double)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (SamplingStats Double)
facilityHoldingTime Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityHoldingTimeChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m Bool)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Facility m a) m
c ResultName
"interrupted" ResultId
facilityInterruptedId Facility m a -> Event m Bool
forall (m :: * -> *) a. MonadDES m => Facility m a -> Event m Bool
facilityInterrupted,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m Int)
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"count" ResultId
facilityCountId Facility m a -> Event m Int
forall (m :: * -> *) a. MonadDES m => Facility m a -> Event m Int
facilityCount Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (TimingStats Int))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"countStats" ResultId
facilityCountStatsId Facility m a -> Event m (TimingStats Int)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (TimingStats Int)
facilityCountStats Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m Int)
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"captureCount" ResultId
facilityCaptureCountId Facility m a -> Event m Int
forall (m :: * -> *) a. MonadDES m => Facility m a -> Event m Int
facilityCaptureCount Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityCaptureCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m Int)
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"utilisationCount" ResultId
facilityUtilisationCountId Facility m a -> Event m Int
forall (m :: * -> *) a. MonadDES m => Facility m a -> Event m Int
facilityUtilisationCount Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityUtilisationCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (TimingStats Int))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"utilisationCountStats" ResultId
facilityUtilisationCountStatsId Facility m a -> Event m (TimingStats Int)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (TimingStats Int)
facilityUtilisationCountStats Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityUtilisationCountChanged_ ] }

-- | Return a summary by the specified facility.
facilityResultSummary :: MonadDES m =>
                         ResultContainer (Facility m a) m
                         -- ^ the facility container
                         -> ResultSource m
facilityResultSummary :: ResultContainer (Facility m a) m -> ResultSource m
facilityResultSummary ResultContainer (Facility m a) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Facility m a) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Facility m a) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Facility m a) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Facility m a) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
facilityId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Facility m a) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Facility m a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Facility m a) m -> ResultSource m
forall (m :: * -> *) a.
MonadDES m =>
ResultContainer (Facility m a) m -> ResultSource m
facilityResultSummary ResultContainer (Facility m a) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (TimingStats Int))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"queueCountStats" ResultId
facilityQueueCountStatsId Facility m a -> Event m (TimingStats Int)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (TimingStats Int)
facilityQueueCountStats Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityQueueCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (SamplingStats Double))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"waitTime" ResultId
facilityWaitTimeId Facility m a -> Event m (SamplingStats Double)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (SamplingStats Double)
facilityWaitTime Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityWaitTimeChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (SamplingStats Double))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"holdingTime" ResultId
facilityHoldingTimeId Facility m a -> Event m (SamplingStats Double)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (SamplingStats Double)
facilityHoldingTime Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityHoldingTimeChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (TimingStats Int))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"countStats" ResultId
facilityCountStatsId Facility m a -> Event m (TimingStats Int)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (TimingStats Int)
facilityCountStats Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m Int)
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"captureCount" ResultId
facilityCaptureCountId Facility m a -> Event m Int
forall (m :: * -> *) a. MonadDES m => Facility m a -> Event m Int
facilityCaptureCount Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityCaptureCountChanged_,
      ResultContainer (Facility m a) m
-> ResultName
-> ResultId
-> (Facility m a -> Event m (TimingStats Int))
-> (Facility m a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Facility m a) m
c ResultName
"utilisationCountStats" ResultId
facilityUtilisationCountStatsId Facility m a -> Event m (TimingStats Int)
forall (m :: * -> *) a.
MonadDES m =>
Facility m a -> Event m (TimingStats Int)
facilityUtilisationCountStats Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityUtilisationCountChanged_ ] }

-- | Return a source by the specified storage.
storageResultSource :: MonadDES m
                       => ResultContainer (Storage m) m
                       -- ^ the storage container
                       -> ResultSource m
storageResultSource :: ResultContainer (Storage m) m -> ResultSource m
storageResultSource ResultContainer (Storage m) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Storage m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Storage m) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Storage m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Storage m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
storageId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Storage m) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Storage m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Storage m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (Storage m) m -> ResultSource m
storageResultSummary ResultContainer (Storage m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Storage m) m
-> ResultName -> ResultId -> (Storage m -> Int) -> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Storage m) m
c ResultName
"capacity" ResultId
storageCapacityId Storage m -> Int
forall (m :: * -> *). Storage m -> Int
storageCapacity,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Bool)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Storage m) m
c ResultName
"empty" ResultId
storageEmptyId Storage m -> Event m Bool
forall (m :: * -> *). MonadDES m => Storage m -> Event m Bool
storageEmpty,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Bool)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Storage m) m
c ResultName
"full" ResultId
storageFullId Storage m -> Event m Bool
forall (m :: * -> *). MonadDES m => Storage m -> Event m Bool
storageFull,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Int)
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"queueCount" ResultId
storageQueueCountId Storage m -> Event m Int
forall (m :: * -> *). MonadDES m => Storage m -> Event m Int
storageQueueCount Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageQueueCountChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m (TimingStats Int))
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"queueCountStats" ResultId
storageQueueCountStatsId Storage m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadDES m =>
Storage m -> Event m (TimingStats Int)
storageQueueCountStats Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageQueueCountChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Double)
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"totalWaitTime" ResultId
storageTotalWaitTimeId Storage m -> Event m Double
forall (m :: * -> *). MonadDES m => Storage m -> Event m Double
storageTotalWaitTime Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageWaitTimeChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m (SamplingStats Double))
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"waitTime" ResultId
storageWaitTimeId Storage m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadDES m =>
Storage m -> Event m (SamplingStats Double)
storageWaitTime Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageWaitTimeChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Storage m) m
c ResultName
"averageHoldingTime" ResultId
storageAverageHoldingTimeId Storage m -> Event m Double
forall (m :: * -> *). MonadDES m => Storage m -> Event m Double
storageAverageHoldingTime,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Int)
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"content" ResultId
storageContentId Storage m -> Event m Int
forall (m :: * -> *). MonadDES m => Storage m -> Event m Int
storageContent Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageContentChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m (TimingStats Int))
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"contentStats" ResultId
storageContentStatsId Storage m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadDES m =>
Storage m -> Event m (TimingStats Int)
storageContentStats Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageContentChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Int)
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"useCount" ResultId
storageUseCountId Storage m -> Event m Int
forall (m :: * -> *). MonadDES m => Storage m -> Event m Int
storageUseCount Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageUseCountChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Int)
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"usedContent" ResultId
storageUsedContentId Storage m -> Event m Int
forall (m :: * -> *). MonadDES m => Storage m -> Event m Int
storageUsedContent Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageUsedContentChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Int)
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"utilisationCount" ResultId
storageUtilisationCountId Storage m -> Event m Int
forall (m :: * -> *). MonadDES m => Storage m -> Event m Int
storageUtilisationCount Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageUtilisationCountChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m (TimingStats Int))
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"utilisationCountStats" ResultId
storageUtilisationCountStatsId Storage m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadDES m =>
Storage m -> Event m (TimingStats Int)
storageUtilisationCountStats Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageUtilisationCountChanged_ ] }

-- | Return a summary by the specified storage.
storageResultSummary :: MonadDES m
                        => ResultContainer (Storage m) m
                        -- ^ the storage container
                        -> ResultSource m
storageResultSummary :: ResultContainer (Storage m) m -> ResultSource m
storageResultSummary ResultContainer (Storage m) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Storage m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Storage m) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Storage m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Storage m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
storageId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Storage m) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Storage m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Storage m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (Storage m) m -> ResultSource m
storageResultSummary ResultContainer (Storage m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Storage m) m
-> ResultName -> ResultId -> (Storage m -> Int) -> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Storage m) m
c ResultName
"capacity" ResultId
storageCapacityId Storage m -> Int
forall (m :: * -> *). Storage m -> Int
storageCapacity,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m (TimingStats Int))
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"queueCountStats" ResultId
storageQueueCountStatsId Storage m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadDES m =>
Storage m -> Event m (TimingStats Int)
storageQueueCountStats Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageQueueCountChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m (SamplingStats Double))
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"waitTime" ResultId
storageWaitTimeId Storage m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadDES m =>
Storage m -> Event m (SamplingStats Double)
storageWaitTime Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageWaitTimeChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Storage m) m
c ResultName
"averageHoldingTime" ResultId
storageAverageHoldingTimeId Storage m -> Event m Double
forall (m :: * -> *). MonadDES m => Storage m -> Event m Double
storageAverageHoldingTime,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m (TimingStats Int))
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"contentStats" ResultId
storageContentStatsId Storage m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadDES m =>
Storage m -> Event m (TimingStats Int)
storageContentStats Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageContentChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Int)
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"useCount" ResultId
storageUseCountId Storage m -> Event m Int
forall (m :: * -> *). MonadDES m => Storage m -> Event m Int
storageUseCount Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageUseCountChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m Int)
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"usedContent" ResultId
storageUsedContentId Storage m -> Event m Int
forall (m :: * -> *). MonadDES m => Storage m -> Event m Int
storageUsedContent Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageUsedContentChanged_,
      ResultContainer (Storage m) m
-> ResultName
-> ResultId
-> (Storage m -> Event m (TimingStats Int))
-> (Storage m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Storage m) m
c ResultName
"utilisationCountStats" ResultId
storageUtilisationCountStatsId Storage m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadDES m =>
Storage m -> Event m (TimingStats Int)
storageUtilisationCountStats Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageUtilisationCountChanged_ ] }

instance MonadDES m => ResultProvider (Q.Queue m) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Queue m
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Queue m
m =
    ResultContainer (Queue m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (Queue m) m -> ResultSource m
queueResultSource (ResultContainer (Queue m) m -> ResultSource m)
-> ResultContainer (Queue m) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Queue m
-> ResultSignal m
-> ResultContainer (Queue m) m
forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Queue m
m (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Queue m -> Signal m ()
forall (m :: * -> *). MonadDES m => Queue m -> Signal m ()
Q.queueChanged_ Queue m
m)

instance MonadDES m => ResultProvider (Facility m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Facility m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Facility m a
m =
    ResultContainer (Facility m a) m -> ResultSource m
forall (m :: * -> *) a.
MonadDES m =>
ResultContainer (Facility m a) m -> ResultSource m
facilityResultSource (ResultContainer (Facility m a) m -> ResultSource m)
-> ResultContainer (Facility m a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Facility m a
-> ResultSignal m
-> ResultContainer (Facility m a) m
forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Facility m a
m (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Facility m a -> Signal m ()
forall (m :: * -> *) a. MonadDES m => Facility m a -> Signal m ()
facilityChanged_ Facility m a
m)

instance MonadDES m => ResultProvider (Storage m) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Storage m
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Storage m
m =
    ResultContainer (Storage m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (Storage m) m -> ResultSource m
storageResultSource (ResultContainer (Storage m) m -> ResultSource m)
-> ResultContainer (Storage m) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Storage m
-> ResultSignal m
-> ResultContainer (Storage m) m
forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Storage m
m (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Storage m -> Signal m ()
forall (m :: * -> *). MonadDES m => Storage m -> Signal m ()
storageChanged_ Storage m
m)