{-# LANGUAGE FlexibleContexts, FlexibleInstances, UndecidableInstances, ExistentialQuantification, MultiParamTypeClasses, FunctionalDependencies #-}

-- |
-- Module     : Simulation.Aivika.Trans.Results
-- Copyright  : Copyright (c) 2009-2017, David Sorokin <david.sorokin@gmail.com>
-- License    : BSD3
-- Maintainer : David Sorokin <david.sorokin@gmail.com>
-- Stability  : experimental
-- Tested with: GHC 8.0.1
--
-- The module allows exporting the simulation results from the model.
--
module Simulation.Aivika.Trans.Results
       (-- * Definitions Focused on Modeling
        Results,
        ResultTransform,
        ResultName,
        ResultProvider(..),
        results,
        expandResults,
        resultSummary,
        resultByName,
        resultByProperty,
        resultById,
        resultByIndex,
        resultBySubscript,
        ResultComputing(..),
        ResultListWithSubscript(..),
        ResultArrayWithSubscript(..),
        ResultVectorWithSubscript(..),
        -- * Definitions Focused on Using the Library
        ResultValue(..),
        resultsToIntValues,
        resultsToIntListValues,
        resultsToIntStatsValues,
        resultsToIntStatsEitherValues,
        resultsToIntTimingStatsValues,
        resultsToDoubleValues,
        resultsToDoubleListValues,
        resultsToDoubleStatsValues,
        resultsToDoubleStatsEitherValues,
        resultsToDoubleTimingStatsValues,
        resultsToStringValues,
        ResultPredefinedSignals(..),
        newResultPredefinedSignals,
        resultSignal,
        pureResultSignal,
        -- * Definitions Focused on Extending the Library 
        ResultSourceMap,
        ResultSource(..),
        ResultItem(..),
        ResultItemable(..),
        resultItemAsIntStatsEitherValue,
        resultItemAsDoubleStatsEitherValue,
        resultItemToIntValue,
        resultItemToIntListValue,
        resultItemToIntStatsValue,
        resultItemToIntStatsEitherValue,
        resultItemToIntTimingStatsValue,
        resultItemToDoubleValue,
        resultItemToDoubleListValue,
        resultItemToDoubleStatsValue,
        resultItemToDoubleStatsEitherValue,
        resultItemToDoubleTimingStatsValue,
        resultItemToStringValue,
        ResultObject(..),
        ResultProperty(..),
        ResultVector(..),
        memoResultVectorSignal,
        memoResultVectorSummary,
        ResultSeparator(..),
        ResultContainer(..),
        resultContainerPropertySource,
        resultContainerConstProperty,
        resultContainerIntegProperty,
        resultContainerProperty,
        resultContainerMapProperty,
        resultValueToContainer,
        resultContainerToValue,
        ResultData,
        ResultSignal(..),
        maybeResultSignal,
        textResultSource,
        timeResultSource,
        resultSourceToIntValues,
        resultSourceToIntListValues,
        resultSourceToIntStatsValues,
        resultSourceToIntStatsEitherValues,
        resultSourceToIntTimingStatsValues,
        resultSourceToDoubleValues,
        resultSourceToDoubleListValues,
        resultSourceToDoubleStatsValues,
        resultSourceToDoubleStatsEitherValues,
        resultSourceToDoubleTimingStatsValues,
        resultSourceToStringValues,
        resultSourceMap,
        resultSourceList,
        composeResults,
        computeResultValue) where

import Control.Monad
import Control.Monad.Trans

import qualified Data.Map as M
import qualified Data.Array as A
import qualified Data.Vector as V

import Data.Ix
import Data.Maybe
import Data.Monoid hiding ((<>))
import Data.Semigroup (Semigroup(..))

import Simulation.Aivika.Trans.Parameter
import Simulation.Aivika.Trans.Simulation
import Simulation.Aivika.Trans.Dynamics
import Simulation.Aivika.Trans.Event
import Simulation.Aivika.Trans.Signal
import Simulation.Aivika.Trans.Statistics
import Simulation.Aivika.Trans.Statistics.Accumulator
import Simulation.Aivika.Trans.Ref
import qualified Simulation.Aivika.Trans.Ref.Base as B
import Simulation.Aivika.Trans.Var
import Simulation.Aivika.Trans.QueueStrategy
import qualified Simulation.Aivika.Trans.Queue as Q
import qualified Simulation.Aivika.Trans.Queue.Infinite as IQ
import Simulation.Aivika.Trans.Arrival
import Simulation.Aivika.Trans.Server
import Simulation.Aivika.Trans.Activity
import Simulation.Aivika.Trans.Operation
import Simulation.Aivika.Trans.Results.Locale.Types
import Simulation.Aivika.Trans.SD
import Simulation.Aivika.Trans.DES
import Simulation.Aivika.Trans.Resource
import qualified Simulation.Aivika.Trans.Resource.Preemption as PR

-- | Represents a provider of the simulation results. It is usually something, or
-- an array of something, or a list of such values which can be simulated to get data.
class MonadDES m => ResultProvider p m | p -> m where
  
  -- | Return the source of simulation results by the specified name, description and provider. 
  resultSource :: ResultName -> ResultDescription -> p -> ResultSource m
  resultSource ResultName
name ResultName
descr = forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName
name] ResultId
i [ResultId
i]
    where i :: ResultId
i = (UserDefinedResult -> ResultId
UserDefinedResultId forall a b. (a -> b) -> a -> b
$ ResultName -> ResultName -> ResultName -> UserDefinedResult
UserDefinedResult ResultName
name ResultName
descr ResultName
title)
          title :: ResultName
title = ResultName -> ResultName
resultNameToTitle ResultName
name
  
  -- | Return the source of simulation results by the specified name, description, title and provider. 
  resultSource3 :: ResultName -> ResultDescription -> ResultDescription -> p -> ResultSource m
  resultSource3 ResultName
name ResultName
descr ResultName
title = forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName
name] ResultId
i [ResultId
i]
    where i :: ResultId
i = (UserDefinedResult -> ResultId
UserDefinedResultId forall a b. (a -> b) -> a -> b
$ ResultName -> ResultName -> ResultName -> UserDefinedResult
UserDefinedResult ResultName
name ResultName
descr ResultName
title)

  -- | Return the source of simulation results by the specified name, its name path,
  -- identifier, the corresponding indentifier path and provider. 
  resultSource' :: ResultName -> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m

-- | It associates the result sources with their names.
type ResultSourceMap m = M.Map ResultName (ResultSource m)

-- | Encapsulates the result source.
data ResultSource m = ResultItemSource (ResultItem m)
                      -- ^ The source consisting of a single item.
                    | ResultObjectSource (ResultObject m)
                      -- ^ An object-like source.
                    | ResultVectorSource (ResultVector m)
                      -- ^ A vector-like structure.
                    | ResultSeparatorSource ResultSeparator
                      -- ^ This is a separator text.

-- | The simulation results represented by a single item.
data ResultItem m = forall a. ResultItemable a => ResultItem (a m)

-- | Represents a type class for actual representing the items.
class ResultItemable a where

  -- | The item name.
  resultItemName :: a m -> ResultName
  
  -- | The item name path.
  resultItemNamePath :: a m -> [ResultName]
  
  -- | The item identifier.
  resultItemId :: a m -> ResultId
  
  -- | The item identifier path.
  resultItemIdPath :: a m -> [ResultId]

  -- | Whether the item emits a signal.
  resultItemSignal :: MonadDES m => a m -> ResultSignal m

  -- | Return an expanded version of the item, for example,
  -- when the statistics item is exanded to an object
  -- having the corresponded properties for count, average,
  -- deviation, minimum, maximum and so on.
  resultItemExpansion :: MonadDES m => a m -> ResultSource m
  
  -- | Return usually a short version of the item, i.e. its summary,
  -- but values of some data types such as statistics can be
  -- implicitly expanded to an object with the corresponded
  -- properties.
  resultItemSummary :: MonadDES m => a m -> ResultSource m
  
  -- | Try to return integer numbers in time points.
  resultItemAsIntValue :: MonadDES m => a m -> Maybe (ResultValue Int m)

  -- | Try to return lists of integer numbers in time points. 
  resultItemAsIntListValue :: MonadDES m => a m -> Maybe (ResultValue [Int] m)

  -- | Try to return statistics based on integer numbers.
  resultItemAsIntStatsValue :: MonadDES m => a m -> Maybe (ResultValue (SamplingStats Int) m)

  -- | Try to return timing statistics based on integer numbers.
  resultItemAsIntTimingStatsValue :: MonadDES m => a m -> Maybe (ResultValue (TimingStats Int) m)

  -- | Try to return double numbers in time points.
  resultItemAsDoubleValue :: MonadDES m => a m -> Maybe (ResultValue Double m)
  
  -- | Try to return lists of double numbers in time points. 
  resultItemAsDoubleListValue :: MonadDES m => a m -> Maybe (ResultValue [Double] m)

  -- | Try to return statistics based on double numbers.
  resultItemAsDoubleStatsValue :: MonadDES m => a m -> Maybe (ResultValue (SamplingStats Double) m)

  -- | Try to return timing statistics based on integer numbers.
  resultItemAsDoubleTimingStatsValue :: MonadDES m => a m -> Maybe (ResultValue (TimingStats Double) m)

  -- | Try to return string representations in time points.
  resultItemAsStringValue :: MonadDES m => a m -> Maybe (ResultValue String m)

-- | Try to return a version optimised for fast aggregation of the statistics based on integer numbers.
resultItemAsIntStatsEitherValue :: (MonadDES m, ResultItemable a) => a m -> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
resultItemAsIntStatsEitherValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
resultItemAsIntStatsEitherValue a m
x =
  case Maybe (ResultValue Int m)
x1 of
    Just ResultValue Int m
a1 -> forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a b. a -> Either a b
Left ResultValue Int m
a1
    Maybe (ResultValue Int m)
Nothing ->
      case Maybe (ResultValue (SamplingStats Int) m)
x2 of
        Just ResultValue (SamplingStats Int) m
a2 -> forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a b. b -> Either a b
Right ResultValue (SamplingStats Int) m
a2
        Maybe (ResultValue (SamplingStats Int) m)
Nothing -> forall a. Maybe a
Nothing
  where
    x1 :: Maybe (ResultValue Int m)
x1 = forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue Int m)
resultItemAsIntValue a m
x
    x2 :: Maybe (ResultValue (SamplingStats Int) m)
x2 = forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue a m
x

-- | Try to return a version optimised for fast aggregation of the statistics based on double floating point numbers.
resultItemAsDoubleStatsEitherValue :: (MonadDES m, ResultItemable a) => a m -> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
resultItemAsDoubleStatsEitherValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
resultItemAsDoubleStatsEitherValue a m
x =
  case Maybe (ResultValue Double m)
x1 of
    Just ResultValue Double m
a1 -> forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a b. a -> Either a b
Left ResultValue Double m
a1
    Maybe (ResultValue Double m)
Nothing ->
      case Maybe (ResultValue (SamplingStats Double) m)
x2 of
        Just ResultValue (SamplingStats Double) m
a2 -> forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a b. b -> Either a b
Right ResultValue (SamplingStats Double) m
a2
        Maybe (ResultValue (SamplingStats Double) m)
Nothing -> forall a. Maybe a
Nothing
  where
    x1 :: Maybe (ResultValue Double m)
x1 = forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue a m
x
    x2 :: Maybe (ResultValue (SamplingStats Double) m)
x2 = forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue a m
x

-- | Return integer numbers in time points.
resultItemToIntValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue Int m
resultItemToIntValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue Int m
resultItemToIntValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue Int m)
resultItemAsIntValue a m
x of
    Just ResultValue Int m
a -> ResultValue Int m
a
    Maybe (ResultValue Int m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of integer numbers: resultItemToIntValue"

-- | Return lists of integer numbers in time points. 
resultItemToIntListValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue [Int] m
resultItemToIntListValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue [Int] m
resultItemToIntListValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue a m
x of
    Just ResultValue [Int] m
a -> ResultValue [Int] m
a
    Maybe (ResultValue [Int] m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of lists of integer numbers: resultItemToIntListValue"

-- | Return statistics based on integer numbers.
resultItemToIntStatsValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue (SamplingStats Int) m
resultItemToIntStatsValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (SamplingStats Int) m
resultItemToIntStatsValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue a m
x of
    Just ResultValue (SamplingStats Int) m
a -> ResultValue (SamplingStats Int) m
a
    Maybe (ResultValue (SamplingStats Int) m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of statistics based on integer numbers: resultItemToIntStatsValue"

-- | Return a version optimised for fast aggregation of the statistics based on integer numbers.
resultItemToIntStatsEitherValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue (Either Int (SamplingStats Int)) m
resultItemToIntStatsEitherValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (Either Int (SamplingStats Int)) m
resultItemToIntStatsEitherValue a m
x =
  case forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
resultItemAsIntStatsEitherValue a m
x of
    Just ResultValue (Either Int (SamplingStats Int)) m
a -> ResultValue (Either Int (SamplingStats Int)) m
a
    Maybe (ResultValue (Either Int (SamplingStats Int)) m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as an optimised source of statistics based on integer numbers: resultItemToIntStatsEitherValue"

-- | Return timing statistics based on integer numbers.
resultItemToIntTimingStatsValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue (TimingStats Int) m
resultItemToIntTimingStatsValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (TimingStats Int) m
resultItemToIntTimingStatsValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue a m
x of
    Just ResultValue (TimingStats Int) m
a -> ResultValue (TimingStats Int) m
a
    Maybe (ResultValue (TimingStats Int) m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of timing statistics based on integer numbers: resultItemToIntTimingStatsValue"

-- | Return double numbers in time points.
resultItemToDoubleValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue Double m
resultItemToDoubleValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue Double m
resultItemToDoubleValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue a m
x of
    Just ResultValue Double m
a -> ResultValue Double m
a
    Maybe (ResultValue Double m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of double-precision floating-point numbers: resultItemToDoubleValue"
  
-- | Return lists of double numbers in time points. 
resultItemToDoubleListValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue [Double] m
resultItemToDoubleListValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue [Double] m
resultItemToDoubleListValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue a m
x of
    Just ResultValue [Double] m
a -> ResultValue [Double] m
a
    Maybe (ResultValue [Double] m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of lists of double-precision floating-point numbers: resultItemToDoubleListValue"

-- | Return statistics based on double numbers.
resultItemToDoubleStatsValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue (SamplingStats Double) m
resultItemToDoubleStatsValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (SamplingStats Double) m
resultItemToDoubleStatsValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue a m
x of
    Just ResultValue (SamplingStats Double) m
a -> ResultValue (SamplingStats Double) m
a
    Maybe (ResultValue (SamplingStats Double) m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of statistics based on double-precision floating-point numbers: resultItemToDoubleStatsValue"

-- | Return a version optimised for fast aggregation of the statistics based on double floating point numbers.
resultItemToDoubleStatsEitherValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue (Either Double (SamplingStats Double)) m
resultItemToDoubleStatsEitherValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (Either Double (SamplingStats Double)) m
resultItemToDoubleStatsEitherValue a m
x =
  case forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
resultItemAsDoubleStatsEitherValue a m
x of
    Just ResultValue (Either Double (SamplingStats Double)) m
a -> ResultValue (Either Double (SamplingStats Double)) m
a
    Maybe (ResultValue (Either Double (SamplingStats Double)) m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as an optimised source of statistics based on double-precision floating-point numbers: resultItemToDoubleStatsEitherValue"

-- | Return timing statistics based on integer numbers.
resultItemToDoubleTimingStatsValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue (TimingStats Double) m
resultItemToDoubleTimingStatsValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (TimingStats Double) m
resultItemToDoubleTimingStatsValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue a m
x of
    Just ResultValue (TimingStats Double) m
a -> ResultValue (TimingStats Double) m
a
    Maybe (ResultValue (TimingStats Double) m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of timing statistics based on double-precision floating-point numbers: resultItemToDoubleTimingStatsValue"

-- | Return string representations in time points.
resultItemToStringValue :: (MonadDES m, ResultItemable a) => a m -> ResultValue String m
resultItemToStringValue :: forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue ResultName m
resultItemToStringValue a m
x =
  case forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue a m
x of
    Just ResultValue ResultName m
a -> ResultValue ResultName m
a
    Maybe (ResultValue ResultName m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x forall a. [a] -> [a] -> [a]
++
      ResultName
" as a source of strings: resultItemToStringValue"

-- | The simulation results represented by an object having properties.
data ResultObject m =
  ResultObject { forall (m :: * -> *). ResultObject m -> ResultName
resultObjectName :: ResultName,
                 -- ^ The object name.
                 forall (m :: * -> *). ResultObject m -> ResultId
resultObjectId :: ResultId,
                 -- ^ The object identifier.
                 forall (m :: * -> *). ResultObject m -> ResultId
resultObjectTypeId :: ResultId,
                 -- ^ The object type identifier.
                 forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties :: [ResultProperty m],
                 -- ^ The object properties.
                 forall (m :: * -> *). ResultObject m -> ResultSignal m
resultObjectSignal :: ResultSignal m,
                 -- ^ A combined signal if present.
                 forall (m :: * -> *). ResultObject m -> ResultSource m
resultObjectSummary :: ResultSource m
                 -- ^ A short version of the object, i.e. its summary.
               }

-- | The object property containing the simulation results.
data ResultProperty m =
  ResultProperty { forall (m :: * -> *). ResultProperty m -> ResultName
resultPropertyLabel :: ResultName,
                   -- ^ The property short label.
                   forall (m :: * -> *). ResultProperty m -> ResultId
resultPropertyId :: ResultId,
                   -- ^ The property identifier.
                   forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource :: ResultSource m
                   -- ^ The simulation results supplied by the property.
                 }

-- | The simulation results represented by a vector.
data ResultVector m =
  ResultVector { forall (m :: * -> *). ResultVector m -> ResultName
resultVectorName :: ResultName,
                 -- ^ The vector name.
                 forall (m :: * -> *). ResultVector m -> ResultId
resultVectorId :: ResultId,
                 -- ^ The vector identifier.
                 forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems :: A.Array Int (ResultSource m),
                 -- ^ The results supplied by the vector items.
                 forall (m :: * -> *). ResultVector m -> Array Int ResultName
resultVectorSubscript :: A.Array Int ResultName,
                 -- ^ The subscript used as a suffix to create item names.
                 forall (m :: * -> *). ResultVector m -> ResultSignal m
resultVectorSignal :: ResultSignal m,
                 -- ^ A combined signal if present.
                 forall (m :: * -> *). ResultVector m -> ResultSource m
resultVectorSummary :: ResultSource m
                 -- ^ A short version of the vector, i.e. summary.
               }

-- | Calculate the result vector signal and memoize it in a new vector.
memoResultVectorSignal :: MonadDES m => ResultVector m -> ResultVector m
memoResultVectorSignal :: forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSignal ResultVector m
x =
  ResultVector m
x { resultVectorSignal :: ResultSignal m
resultVectorSignal =
         forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr forall a. Semigroup a => a -> a -> a
(<>) forall a. Monoid a => a
mempty forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSignal m
resultSourceSignal forall a b. (a -> b) -> a -> b
$ forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
x }

-- | Calculate the result vector summary and memoize it in a new vector.
memoResultVectorSummary :: MonadDES m => ResultVector m -> ResultVector m
memoResultVectorSummary :: forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSummary ResultVector m
x =
  ResultVector m
x { resultVectorSummary :: ResultSource m
resultVectorSummary =
         forall (m :: * -> *). ResultVector m -> ResultSource m
ResultVectorSource forall a b. (a -> b) -> a -> b
$
         ResultVector m
x { resultVectorItems :: Array Int (ResultSource m)
resultVectorItems =
                forall i e. Ix i => (i, i) -> [(i, e)] -> Array i e
A.array (Int, Int)
bnds [(Int
i, forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
resultSourceSummary ResultSource m
e) | (Int
i, ResultSource m
e) <- [(Int, ResultSource m)]
ies] } }
  where
    arr :: Array Int (ResultSource m)
arr  = forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
x
    bnds :: (Int, Int)
bnds = forall i e. Array i e -> (i, i)
A.bounds Array Int (ResultSource m)
arr
    ies :: [(Int, ResultSource m)]
ies  = forall i e. Ix i => Array i e -> [(i, e)]
A.assocs Array Int (ResultSource m)
arr

-- | It separates the simulation results when printing.
data ResultSeparator =
  ResultSeparator { ResultSeparator -> ResultName
resultSeparatorText :: String
                    -- ^ The separator text.
                  }

-- | A parameterised value that actually represents a generalised result item that have no parametric type.
data ResultValue e m =
  ResultValue { forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName :: ResultName,
                -- ^ The value name.
                forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath :: [ResultName],
                -- ^ The value name path.
                forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId :: ResultId,
                -- ^ The value identifier.
                forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath :: [ResultId],
                -- ^ The value identifier path.
                forall e (m :: * -> *). ResultValue e m -> ResultData e m
resultValueData :: ResultData e m,
                -- ^ Simulation data supplied by the value.
                forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal :: ResultSignal m
                -- ^ Whether the value emits a signal when changing simulation data.
              }

-- | Map the result value according the specfied function.
mapResultValue :: MonadDES m => (a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue :: forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue a -> b
f ResultValue a m
x = ResultValue a m
x { resultValueData :: ResultData b m
resultValueData = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f (forall e (m :: * -> *). ResultValue e m -> ResultData e m
resultValueData ResultValue a m
x) }

-- | Transform the result value.
apResultValue :: MonadDES m => ResultData (a -> b) m -> ResultValue a m -> ResultValue b m
apResultValue :: forall (m :: * -> *) a b.
MonadDES m =>
ResultData (a -> b) m -> ResultValue a m -> ResultValue b m
apResultValue ResultData (a -> b) m
f ResultValue a m
x = ResultValue a m
x { resultValueData :: ResultData b m
resultValueData = forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
ap ResultData (a -> b) m
f (forall e (m :: * -> *). ResultValue e m -> ResultData e m
resultValueData ResultValue a m
x) }

-- | A container of the simulation results such as queue, server or array.
data ResultContainer e m =
  ResultContainer { forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName :: ResultName,
                    -- ^ The container name.
                    forall e (m :: * -> *). ResultContainer e m -> [ResultName]
resultContainerNamePath :: [ResultName],
                    -- ^ The container name path.
                    forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId :: ResultId,
                    -- ^ The container identifier.
                    forall e (m :: * -> *). ResultContainer e m -> [ResultId]
resultContainerIdPath :: [ResultId],
                    -- ^ The container identifier path.
                    forall e (m :: * -> *). ResultContainer e m -> e
resultContainerData :: e,
                    -- ^ The container data.
                    forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal :: ResultSignal m
                    -- ^ Whether the container emits a signal when changing simulation data.
                  }

mapResultContainer :: (a -> b) -> ResultContainer a m -> ResultContainer b m
mapResultContainer :: forall a b (m :: * -> *).
(a -> b) -> ResultContainer a m -> ResultContainer b m
mapResultContainer a -> b
f ResultContainer a m
x = ResultContainer a m
x { resultContainerData :: b
resultContainerData = a -> b
f (forall e (m :: * -> *). ResultContainer e m -> e
resultContainerData ResultContainer a m
x) }

-- | Create a new property source by the specified container.
resultContainerPropertySource :: ResultItemable (ResultValue b)
                                 => ResultContainer a m
                                 -- ^ the container
                                 -> ResultName
                                 -- ^ the property label
                                 -> ResultId
                                 -- ^ the property identifier
                                 -> (a -> ResultData b m)
                                 -- ^ get the specified data from the container
                                 -> (a -> ResultSignal m)
                                 -- ^ get the data signal from the container
                                 -> ResultSource m
resultContainerPropertySource :: forall b a (m :: * -> *).
ResultItemable (ResultValue b) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> ResultData b m)
-> (a -> ResultSignal m)
-> ResultSource m
resultContainerPropertySource ResultContainer a m
cont ResultName
name ResultId
i a -> ResultData b m
f a -> ResultSignal m
g =
  forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$
  forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$
  ResultValue {
    resultValueName :: ResultName
resultValueName   = (forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer a m
cont) forall a. [a] -> [a] -> [a]
++ ResultName
"." forall a. [a] -> [a] -> [a]
++ ResultName
name,
    resultValueNamePath :: [ResultName]
resultValueNamePath = (forall e (m :: * -> *). ResultContainer e m -> [ResultName]
resultContainerNamePath ResultContainer a m
cont) forall a. [a] -> [a] -> [a]
++ [ResultName
name],
    resultValueId :: ResultId
resultValueId     = ResultId
i,
    resultValueIdPath :: [ResultId]
resultValueIdPath = (forall e (m :: * -> *). ResultContainer e m -> [ResultId]
resultContainerIdPath ResultContainer a m
cont) forall a. [a] -> [a] -> [a]
++ [ResultId
i],
    resultValueData :: ResultData b m
resultValueData   = a -> ResultData b m
f (forall e (m :: * -> *). ResultContainer e m -> e
resultContainerData ResultContainer a m
cont),
    resultValueSignal :: ResultSignal m
resultValueSignal = a -> ResultSignal m
g (forall e (m :: * -> *). ResultContainer e m -> e
resultContainerData ResultContainer a m
cont) }

-- | Create a constant property by the specified container.
resultContainerConstProperty :: (MonadDES m,
                                 ResultItemable (ResultValue b))
                                => ResultContainer a m
                                -- ^ the container
                                -> ResultName
                                -- ^ the property label
                                -> ResultId
                                -- ^ the property identifier
                                -> (a -> b)
                                -- ^ get the specified data from the container
                                -> ResultProperty m
resultContainerConstProperty :: forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer a m
cont ResultName
name ResultId
i a -> b
f =
  ResultProperty {
    resultPropertyLabel :: ResultName
resultPropertyLabel = ResultName
name,
    resultPropertyId :: ResultId
resultPropertyId = ResultId
i,
    resultPropertySource :: ResultSource m
resultPropertySource =
      forall b a (m :: * -> *).
ResultItemable (ResultValue b) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> ResultData b m)
-> (a -> ResultSignal m)
-> ResultSource m
resultContainerPropertySource ResultContainer a m
cont ResultName
name ResultId
i (forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> b
f) (forall a b. a -> b -> a
const forall (m :: * -> *). ResultSignal m
EmptyResultSignal) }
  
-- | Create by the specified container a property that changes in the integration time points, or it is supposed to be such one.
resultContainerIntegProperty :: (MonadDES m,
                                 ResultItemable (ResultValue b))
                                => ResultContainer a m
                                -- ^ the container
                                -> ResultName
                                -- ^ the property label
                                -> ResultId
                                -- ^ the property identifier
                                -> (a -> Event m b)
                                -- ^ get the specified data from the container
                                -> ResultProperty m
resultContainerIntegProperty :: forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer a m
cont ResultName
name ResultId
i a -> Event m b
f =
  ResultProperty {
    resultPropertyLabel :: ResultName
resultPropertyLabel = ResultName
name,
    resultPropertyId :: ResultId
resultPropertyId = ResultId
i,
    resultPropertySource :: ResultSource m
resultPropertySource =
      forall b a (m :: * -> *).
ResultItemable (ResultValue b) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> ResultData b m)
-> (a -> ResultSignal m)
-> ResultSource m
resultContainerPropertySource ResultContainer a m
cont ResultName
name ResultId
i a -> Event m b
f (forall a b. a -> b -> a
const forall (m :: * -> *). ResultSignal m
UnknownResultSignal) }
  
-- | Create a property by the specified container.
resultContainerProperty :: (MonadDES m,
                            ResultItemable (ResultValue b))
                           => ResultContainer a m
                           -- ^ the container
                           -> ResultName
                           -- ^ the property label
                           -> ResultId
                           -- ^ the property identifier
                           -> (a -> Event m b)
                           -- ^ get the specified data from the container
                           -> (a -> Signal m ())
                           -- ^ get a signal triggered when changing data.
                           -> ResultProperty m
resultContainerProperty :: 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 a m
cont ResultName
name ResultId
i a -> Event m b
f a -> Signal m ()
g =                     
  ResultProperty {
    resultPropertyLabel :: ResultName
resultPropertyLabel = ResultName
name,
    resultPropertyId :: ResultId
resultPropertyId = ResultId
i,
    resultPropertySource :: ResultSource m
resultPropertySource =
      forall b a (m :: * -> *).
ResultItemable (ResultValue b) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> ResultData b m)
-> (a -> ResultSignal m)
-> ResultSource m
resultContainerPropertySource ResultContainer a m
cont ResultName
name ResultId
i a -> Event m b
f (forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Signal m ()
g) }

-- | Create by the specified container a mapped property which is recomputed each time again and again.
resultContainerMapProperty :: (MonadDES m,
                               ResultItemable (ResultValue b))
                              => ResultContainer (ResultData a m) m
                              -- ^ the container
                              -> ResultName
                              -- ^ the property label
                              -> ResultId
                              -- ^ the property identifier
                              -> (a -> b)
                              -- ^ recompute the specified data
                              -> ResultProperty m
resultContainerMapProperty :: forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData a m) m
cont ResultName
name ResultId
i a -> b
f =                     
  ResultProperty {
    resultPropertyLabel :: ResultName
resultPropertyLabel = ResultName
name,
    resultPropertyId :: ResultId
resultPropertyId = ResultId
i,
    resultPropertySource :: ResultSource m
resultPropertySource =
      forall b a (m :: * -> *).
ResultItemable (ResultValue b) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> ResultData b m)
-> (a -> ResultSignal m)
-> ResultSource m
resultContainerPropertySource ResultContainer (ResultData a m) m
cont ResultName
name ResultId
i (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (ResultData a m) m
cont) }

-- | Convert the result value to a container with the specified object identifier. 
resultValueToContainer :: ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer :: forall a (m :: * -> *).
ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer ResultValue a m
x =
  ResultContainer {
    resultContainerName :: ResultName
resultContainerName   = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue a m
x,
    resultContainerNamePath :: [ResultName]
resultContainerNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath ResultValue a m
x,
    resultContainerId :: ResultId
resultContainerId     = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue a m
x,
    resultContainerIdPath :: [ResultId]
resultContainerIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath ResultValue a m
x,
    resultContainerData :: ResultData a m
resultContainerData   = forall e (m :: * -> *). ResultValue e m -> ResultData e m
resultValueData ResultValue a m
x,
    resultContainerSignal :: ResultSignal m
resultContainerSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue a m
x }

-- | Convert the result container to a value.
resultContainerToValue :: ResultContainer (ResultData a m) m -> ResultValue a m
resultContainerToValue :: forall a (m :: * -> *).
ResultContainer (ResultData a m) m -> ResultValue a m
resultContainerToValue ResultContainer (ResultData a m) m
x =
  ResultValue {
    resultValueName :: ResultName
resultValueName   = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (ResultData a m) m
x,
    resultValueNamePath :: [ResultName]
resultValueNamePath = forall e (m :: * -> *). ResultContainer e m -> [ResultName]
resultContainerNamePath ResultContainer (ResultData a m) m
x,
    resultValueId :: ResultId
resultValueId     = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (ResultData a m) m
x,
    resultValueIdPath :: [ResultId]
resultValueIdPath = forall e (m :: * -> *). ResultContainer e m -> [ResultId]
resultContainerIdPath ResultContainer (ResultData a m) m
x,
    resultValueData :: ResultData a m
resultValueData   = forall e (m :: * -> *). ResultContainer e m -> e
resultContainerData ResultContainer (ResultData a m) m
x,
    resultValueSignal :: ResultSignal m
resultValueSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (ResultData a m) m
x }

-- | Represents the very simulation results.
type ResultData e m = Event m e

-- | Convert the timing statistics data to its normalised sampling-based representation.
normTimingStatsData :: (TimingData a, Monad m) => ResultData (TimingStats a -> SamplingStats a) m
normTimingStatsData :: forall a (m :: * -> *).
(TimingData a, Monad m) =>
ResultData (TimingStats a -> SamplingStats a) m
normTimingStatsData =
  do Int
n <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics forall (m :: * -> *). Monad m => Dynamics m Int
integIteration
     forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall a. TimingData a => Int -> TimingStats a -> SamplingStats a
normTimingStats (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
n)

-- | Whether an object containing the results emits a signal notifying about change of data.
data ResultSignal m = EmptyResultSignal
                      -- ^ There is no signal at all.
                    | UnknownResultSignal
                      -- ^ The signal is unknown, but the entity probably changes.
                    | ResultSignal (Signal m ())
                      -- ^ When the signal is precisely specified.
                    | ResultSignalMix (Signal m ())
                      -- ^ When the specified signal was combined with unknown signal.

instance MonadDES m => Semigroup (ResultSignal m) where

  <> :: ResultSignal m -> ResultSignal m -> ResultSignal m
(<>) ResultSignal m
EmptyResultSignal ResultSignal m
z = ResultSignal m
z

  (<>) ResultSignal m
UnknownResultSignal ResultSignal m
EmptyResultSignal = forall (m :: * -> *). ResultSignal m
UnknownResultSignal
  (<>) ResultSignal m
UnknownResultSignal ResultSignal m
UnknownResultSignal = forall (m :: * -> *). ResultSignal m
UnknownResultSignal
  (<>) ResultSignal m
UnknownResultSignal (ResultSignal Signal m ()
x) = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix Signal m ()
x
  (<>) ResultSignal m
UnknownResultSignal z :: ResultSignal m
z@(ResultSignalMix Signal m ()
x) = ResultSignal m
z

  (<>) z :: ResultSignal m
z@(ResultSignal Signal m ()
x) ResultSignal m
EmptyResultSignal = ResultSignal m
z
  (<>) (ResultSignal Signal m ()
x) ResultSignal m
UnknownResultSignal = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix Signal m ()
x
  (<>) (ResultSignal Signal m ()
x) (ResultSignal Signal m ()
y) = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m ()
x forall a. Semigroup a => a -> a -> a
<> Signal m ()
y)
  (<>) (ResultSignal Signal m ()
x) (ResultSignalMix Signal m ()
y) = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix (Signal m ()
x forall a. Semigroup a => a -> a -> a
<> Signal m ()
y)

  (<>) z :: ResultSignal m
z@(ResultSignalMix Signal m ()
x) ResultSignal m
EmptyResultSignal = ResultSignal m
z
  (<>) z :: ResultSignal m
z@(ResultSignalMix Signal m ()
x) ResultSignal m
UnknownResultSignal = ResultSignal m
z
  (<>) (ResultSignalMix Signal m ()
x) (ResultSignal Signal m ()
y) = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix (Signal m ()
x forall a. Semigroup a => a -> a -> a
<> Signal m ()
y)
  (<>) (ResultSignalMix Signal m ()
x) (ResultSignalMix Signal m ()
y) = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix (Signal m ()
x forall a. Semigroup a => a -> a -> a
<> Signal m ()
y)

instance MonadDES m => Monoid (ResultSignal m) where

  mempty :: ResultSignal m
mempty = forall (m :: * -> *). ResultSignal m
EmptyResultSignal

  mappend :: ResultSignal m -> ResultSignal m -> ResultSignal m
mappend = forall a. Semigroup a => a -> a -> a
(<>)

-- | Construct a new result signal by the specified optional pure signal.
maybeResultSignal :: Maybe (Signal m ()) -> ResultSignal m
maybeResultSignal :: forall (m :: * -> *). Maybe (Signal m ()) -> ResultSignal m
maybeResultSignal (Just Signal m ()
x) = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal Signal m ()
x
maybeResultSignal Maybe (Signal m ())
Nothing  = forall (m :: * -> *). ResultSignal m
EmptyResultSignal

instance ResultItemable (ResultValue Int) where

  resultItemName :: forall (m :: * -> *). ResultValue Int m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue Int m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue Int m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue Int m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a. a -> Maybe a
Just
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall (m :: * -> *) a. Monad m => a -> m a
return
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. SamplingData a => a -> SamplingStats a
returnSamplingStats
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a b. (Integral a, Num b) => a -> b
fromIntegral
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue (forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral)
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue (forall a. SamplingData a => a -> SamplingStats a
returnSamplingStats forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (Integral a, Num b) => a -> b
fromIntegral)
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show

  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue Int m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue Double) where

  resultItemName :: forall (m :: * -> *). ResultValue Double m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue Double m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue Double m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue Double m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  
  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a. a -> Maybe a
Just
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall (m :: * -> *) a. Monad m => a -> m a
return
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m
-> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. SamplingData a => a -> SamplingStats a
returnSamplingStats
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show
  
  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue Double m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue [Int]) where

  resultItemName :: forall (m :: * -> *). ResultValue [Int] m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue [Int] m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue [Int] m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue [Int] m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a. a -> Maybe a
Just
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. SamplingData a => [a] -> SamplingStats a
listSamplingStats
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (Integral a, Num b) => a -> b
fromIntegral)
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue (SamplingStats Int -> SamplingStats Double
fromIntSamplingStats forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. SamplingData a => [a] -> SamplingStats a
listSamplingStats)
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show
  
  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Int] m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue [Double]) where

  resultItemName :: forall (m :: * -> *). ResultValue [Double] m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue [Double] m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue [Double] m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue [Double] m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  
  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a. a -> Maybe a
Just
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m
-> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. SamplingData a => [a] -> SamplingStats a
listSamplingStats
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m
-> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show
  
  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue [Double] m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue (SamplingStats Int)) where

  resultItemName :: forall (m :: * -> *).
ResultValue (SamplingStats Int) m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *).
ResultValue (SamplingStats Int) m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue (SamplingStats Int) m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *).
ResultValue (SamplingStats Int) m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m
-> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a. a -> Maybe a
Just
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m
-> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m
-> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue SamplingStats Int -> SamplingStats Double
fromIntSamplingStats
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m
-> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m
-> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show
  
  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m -> ResultSource m
resultItemExpansion = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSource
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Int) m -> ResultSource m
resultItemSummary = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSummary

instance ResultItemable (ResultValue (SamplingStats Double)) where

  resultItemName :: forall (m :: * -> *).
ResultValue (SamplingStats Double) m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *).
ResultValue (SamplingStats Double) m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *).
ResultValue (SamplingStats Double) m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *).
ResultValue (SamplingStats Double) m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m
-> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m
-> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  
  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m
-> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m
-> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m
-> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a. a -> Maybe a
Just
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m
-> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m
-> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show
  
  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m -> ResultSource m
resultItemExpansion = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSource
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue (SamplingStats Double) m -> ResultSource m
resultItemSummary = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSummary

instance ResultItemable (ResultValue (TimingStats Int)) where

  resultItemName :: forall (m :: * -> *). ResultValue (TimingStats Int) m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *).
ResultValue (TimingStats Int) m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue (TimingStats Int) m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue (TimingStats Int) m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m
-> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
ResultData (a -> b) m -> ResultValue a m -> ResultValue b m
apResultValue forall a (m :: * -> *).
(TimingData a, Monad m) =>
ResultData (TimingStats a -> SamplingStats a) m
normTimingStatsData
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m
-> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a. a -> Maybe a
Just

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m
-> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue SamplingStats Int -> SamplingStats Double
fromIntSamplingStats forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
ResultData (a -> b) m -> ResultValue a m -> ResultValue b m
apResultValue forall a (m :: * -> *).
(TimingData a, Monad m) =>
ResultData (TimingStats a -> SamplingStats a) m
normTimingStatsData
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m
-> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue TimingStats Int -> TimingStats Double
fromIntTimingStats

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show
  
  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m -> ResultSource m
resultItemExpansion = forall (m :: * -> *) a.
(MonadDES m, TimingData a, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSource
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Int) m -> ResultSource m
resultItemSummary = forall (m :: * -> *) a.
(MonadDES m, TimingData a,
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSummary

instance ResultItemable (ResultValue  (TimingStats Double)) where

  resultItemName :: forall (m :: * -> *).
ResultValue (TimingStats Double) m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *).
ResultValue (TimingStats Double) m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *).
ResultValue (TimingStats Double) m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *).
ResultValue (TimingStats Double) m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m
-> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m
-> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m
-> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m
-> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
ResultData (a -> b) m -> ResultValue a m -> ResultValue b m
apResultValue forall a (m :: * -> *).
(TimingData a, Monad m) =>
ResultData (TimingStats a -> SamplingStats a) m
normTimingStatsData
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m
-> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a. a -> Maybe a
Just

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m
-> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show
  
  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m -> ResultSource m
resultItemExpansion = forall (m :: * -> *) a.
(MonadDES m, TimingData a, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSource
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue (TimingStats Double) m -> ResultSource m
resultItemSummary = forall (m :: * -> *) a.
(MonadDES m, TimingData a,
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSummary

instance ResultItemable (ResultValue Bool) where

  resultItemName :: forall (m :: * -> *). ResultValue Bool m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue Bool m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue Bool m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue Bool m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show

  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue Bool m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue String) where

  resultItemName :: forall (m :: * -> *). ResultValue ResultName m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue ResultName m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue ResultName m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue ResultName m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m
-> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m
-> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m
-> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just

  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue ResultName m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue ()) where

  resultItemName :: forall (m :: * -> *). ResultValue () m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue () m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue () m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue () m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show

  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue () m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue FCFS) where

  resultItemName :: forall (m :: * -> *). ResultValue FCFS m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue FCFS m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue FCFS m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue FCFS m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show

  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue FCFS m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue LCFS) where

  resultItemName :: forall (m :: * -> *). ResultValue LCFS m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue LCFS m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue LCFS m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue LCFS m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show

  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue LCFS m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue SIRO) where

  resultItemName :: forall (m :: * -> *). ResultValue SIRO m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *). ResultValue SIRO m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue SIRO m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue SIRO m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show

  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue SIRO m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

instance ResultItemable (ResultValue StaticPriorities) where

  resultItemName :: forall (m :: * -> *). ResultValue StaticPriorities m -> ResultName
resultItemName = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: forall (m :: * -> *).
ResultValue StaticPriorities m -> [ResultName]
resultItemNamePath = forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: forall (m :: * -> *). ResultValue StaticPriorities m -> ResultId
resultItemId = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: forall (m :: * -> *). ResultValue StaticPriorities m -> [ResultId]
resultItemIdPath = forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m -> ResultSignal m
resultItemSignal = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m -> Maybe (ResultValue Int m)
resultItemAsIntValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m
-> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m
-> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsDoubleValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleListValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m -> Maybe (ResultValue [Double] m)
resultItemAsDoubleListValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m
-> Maybe (ResultValue (SamplingStats Double) m)
resultItemAsDoubleStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing
  resultItemAsDoubleTimingStatsValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m
-> Maybe (ResultValue (TimingStats Double) m)
resultItemAsDoubleTimingStatsValue = forall a b. a -> b -> a
const forall a. Maybe a
Nothing

  resultItemAsStringValue :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = forall a. a -> Maybe a
Just forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Show a => a -> ResultName
show

  resultItemExpansion :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m -> ResultSource m
resultItemExpansion = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem
  resultItemSummary :: forall (m :: * -> *).
MonadDES m =>
ResultValue StaticPriorities m -> ResultSource m
resultItemSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem

-- | Flatten the result source.
flattenResultSource :: ResultSource m -> [ResultItem m]
flattenResultSource :: forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource (ResultItemSource ResultItem m
x) = [ResultItem m
x]
flattenResultSource (ResultObjectSource ResultObject m
x) =
  forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource) forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties ResultObject m
x
flattenResultSource (ResultVectorSource ResultVector m
x) =
  forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource forall a b. (a -> b) -> a -> b
$ forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
x
flattenResultSource (ResultSeparatorSource ResultSeparator
x) = []

-- | Return the result source name.
resultSourceName :: ResultSource m -> ResultName
resultSourceName :: forall (m :: * -> *). ResultSource m -> ResultName
resultSourceName (ResultItemSource (ResultItem a m
x)) = forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x
resultSourceName (ResultObjectSource ResultObject m
x) = forall (m :: * -> *). ResultObject m -> ResultName
resultObjectName ResultObject m
x
resultSourceName (ResultVectorSource ResultVector m
x) = forall (m :: * -> *). ResultVector m -> ResultName
resultVectorName ResultVector m
x
resultSourceName (ResultSeparatorSource ResultSeparator
x) = []

-- | Expand the result source returning a more detailed version expanding the properties as possible.
expandResultSource :: MonadDES m => ResultSource m -> ResultSource m
expandResultSource :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
expandResultSource (ResultItemSource (ResultItem a m
x)) = forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> ResultSource m
resultItemExpansion a m
x
expandResultSource (ResultObjectSource ResultObject m
x) =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject m
x { resultObjectProperties :: [ResultProperty m]
resultObjectProperties =
         forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties ResultObject m
x) forall a b. (a -> b) -> a -> b
$ \ResultProperty m
p ->
         ResultProperty m
p { resultPropertySource :: ResultSource m
resultPropertySource = forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
expandResultSource (forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource ResultProperty m
p) } }
expandResultSource (ResultVectorSource ResultVector m
x) =
  forall (m :: * -> *). ResultVector m -> ResultSource m
ResultVectorSource forall a b. (a -> b) -> a -> b
$
  ResultVector m
x { resultVectorItems :: Array Int (ResultSource m)
resultVectorItems =
         forall i e. Ix i => (i, i) -> [(i, e)] -> Array i e
A.array (Int, Int)
bnds [(Int
i, forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
expandResultSource ResultSource m
e) | (Int
i, ResultSource m
e) <- [(Int, ResultSource m)]
ies] }
    where arr :: Array Int (ResultSource m)
arr  = forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
x
          bnds :: (Int, Int)
bnds = forall i e. Array i e -> (i, i)
A.bounds Array Int (ResultSource m)
arr
          ies :: [(Int, ResultSource m)]
ies  = forall i e. Ix i => Array i e -> [(i, e)]
A.assocs Array Int (ResultSource m)
arr
expandResultSource z :: ResultSource m
z@(ResultSeparatorSource ResultSeparator
x) = ResultSource m
z

-- | Return a summarised and usually more short version of the result source expanding the main properties or excluding auxiliary properties if required.
resultSourceSummary :: MonadDES m => ResultSource m -> ResultSource m
resultSourceSummary :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
resultSourceSummary (ResultItemSource (ResultItem a m
x)) = forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> ResultSource m
resultItemSummary a m
x
resultSourceSummary (ResultObjectSource ResultObject m
x) = forall (m :: * -> *). ResultObject m -> ResultSource m
resultObjectSummary ResultObject m
x
resultSourceSummary (ResultVectorSource ResultVector m
x) = forall (m :: * -> *). ResultVector m -> ResultSource m
resultVectorSummary ResultVector m
x
resultSourceSummary z :: ResultSource m
z@(ResultSeparatorSource ResultSeparator
x) = ResultSource m
z

-- | Return a signal emitted by the source.
resultSourceSignal :: MonadDES m => ResultSource m -> ResultSignal m
resultSourceSignal :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSignal m
resultSourceSignal (ResultItemSource (ResultItem a m
x)) = forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> ResultSignal m
resultItemSignal a m
x
resultSourceSignal (ResultObjectSource ResultObject m
x) = forall (m :: * -> *). ResultObject m -> ResultSignal m
resultObjectSignal ResultObject m
x
resultSourceSignal (ResultVectorSource ResultVector m
x) = forall (m :: * -> *). ResultVector m -> ResultSignal m
resultVectorSignal ResultVector m
x
resultSourceSignal (ResultSeparatorSource ResultSeparator
x) = forall (m :: * -> *). ResultSignal m
EmptyResultSignal

-- | Represent the result source as integer numbers.
resultSourceToIntValues :: MonadDES m => ResultSource m -> [ResultValue Int m]
resultSourceToIntValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue Int m]
resultSourceToIntValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue Int m
resultItemToIntValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as lists of integer numbers.
resultSourceToIntListValues :: MonadDES m => ResultSource m -> [ResultValue [Int] m]
resultSourceToIntListValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue [Int] m]
resultSourceToIntListValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue [Int] m
resultItemToIntListValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as statistics based on integer numbers.
resultSourceToIntStatsValues :: MonadDES m => ResultSource m -> [ResultValue (SamplingStats Int) m]
resultSourceToIntStatsValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (SamplingStats Int) m]
resultSourceToIntStatsValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (SamplingStats Int) m
resultItemToIntStatsValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as statistics based on integer numbers and optimised for fast aggregation.
resultSourceToIntStatsEitherValues :: MonadDES m => ResultSource m -> [ResultValue (Either Int (SamplingStats Int)) m]
resultSourceToIntStatsEitherValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (Either Int (SamplingStats Int)) m]
resultSourceToIntStatsEitherValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (Either Int (SamplingStats Int)) m
resultItemToIntStatsEitherValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as timing statistics based on integer numbers.
resultSourceToIntTimingStatsValues :: MonadDES m => ResultSource m -> [ResultValue (TimingStats Int) m]
resultSourceToIntTimingStatsValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (TimingStats Int) m]
resultSourceToIntTimingStatsValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (TimingStats Int) m
resultItemToIntTimingStatsValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as double floating point numbers.
resultSourceToDoubleValues :: MonadDES m => ResultSource m -> [ResultValue Double m]
resultSourceToDoubleValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue Double m]
resultSourceToDoubleValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue Double m
resultItemToDoubleValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as lists of double floating point numbers.
resultSourceToDoubleListValues :: MonadDES m => ResultSource m -> [ResultValue [Double] m]
resultSourceToDoubleListValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue [Double] m]
resultSourceToDoubleListValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue [Double] m
resultItemToDoubleListValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as statistics based on double floating point numbers.
resultSourceToDoubleStatsValues :: MonadDES m => ResultSource m -> [ResultValue (SamplingStats Double) m]
resultSourceToDoubleStatsValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (SamplingStats Double) m]
resultSourceToDoubleStatsValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (SamplingStats Double) m
resultItemToDoubleStatsValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as statistics based on double floating point numbers and optimised for fast aggregation.
resultSourceToDoubleStatsEitherValues :: MonadDES m => ResultSource m -> [ResultValue (Either Double (SamplingStats Double)) m]
resultSourceToDoubleStatsEitherValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m
-> [ResultValue (Either Double (SamplingStats Double)) m]
resultSourceToDoubleStatsEitherValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (Either Double (SamplingStats Double)) m
resultItemToDoubleStatsEitherValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as timing statistics based on double floating point numbers.
resultSourceToDoubleTimingStatsValues :: MonadDES m => ResultSource m -> [ResultValue (TimingStats Double) m]
resultSourceToDoubleTimingStatsValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (TimingStats Double) m]
resultSourceToDoubleTimingStatsValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (TimingStats Double) m
resultItemToDoubleTimingStatsValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | Represent the result source as string values.
resultSourceToStringValues :: MonadDES m => ResultSource m -> [ResultValue String m]
resultSourceToStringValues :: forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue ResultName m]
resultSourceToStringValues = forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue ResultName m
resultItemToStringValue a m
x) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

-- | It contains the results of simulation.
data Results m =
  Results { forall (m :: * -> *). Results m -> ResultSourceMap m
resultSourceMap :: ResultSourceMap m,
            -- ^ The sources of simulation results as a map of associated names.
            forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList :: [ResultSource m]
            -- ^ The sources of simulation results as an ordered list.
          }

-- | It transforms the results of simulation.
type ResultTransform m = Results m -> Results m

-- | It representes the predefined signals provided by every simulation model.
data ResultPredefinedSignals m =
  ResultPredefinedSignals { forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInIntegTimes :: Signal m Double,
                            -- ^ The signal triggered in the integration time points.
                            forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInStartTime :: Signal m Double,
                            -- ^ The signal triggered in the start time.
                            forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInStopTime :: Signal m Double
                            -- ^ The signal triggered in the stop time.
                          }

-- | Create the predefined signals provided by every simulation model.
newResultPredefinedSignals :: MonadDES m => Simulation m (ResultPredefinedSignals m)
newResultPredefinedSignals :: forall (m :: * -> *).
MonadDES m =>
Simulation m (ResultPredefinedSignals m)
newResultPredefinedSignals = forall (m :: * -> *) a. Dynamics m a -> Simulation m a
runDynamicsInStartTime forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
EventQueueing m =>
EventProcessing -> Event m a -> Dynamics m a
runEventWith EventProcessing
EarlierEvents Event m (ResultPredefinedSignals m)
d where
  d :: Event m (ResultPredefinedSignals m)
d = do Signal m Double
signalInIntegTimes <- forall (m :: * -> *). MonadDES m => Event m (Signal m Double)
newSignalInIntegTimes
         Signal m Double
signalInStartTime  <- forall (m :: * -> *). MonadDES m => Event m (Signal m Double)
newSignalInStartTime
         Signal m Double
signalInStopTime   <- forall (m :: * -> *). MonadDES m => Event m (Signal m Double)
newSignalInStopTime
         forall (m :: * -> *) a. Monad m => a -> m a
return ResultPredefinedSignals { resultSignalInIntegTimes :: Signal m Double
resultSignalInIntegTimes = Signal m Double
signalInIntegTimes,
                                          resultSignalInStartTime :: Signal m Double
resultSignalInStartTime  = Signal m Double
signalInStartTime,
                                          resultSignalInStopTime :: Signal m Double
resultSignalInStopTime   = Signal m Double
signalInStopTime }

instance Semigroup (Results m) where

  Results m
x <> :: Results m -> Results m -> Results m
<> Results m
y = forall (m :: * -> *). [ResultSource m] -> Results m
results forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList Results m
x forall a. Semigroup a => a -> a -> a
<> forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList Results m
y

instance Monoid (Results m) where

  mempty :: Results m
mempty  = forall (m :: * -> *). [ResultSource m] -> Results m
results forall a. Monoid a => a
mempty
  mappend :: Results m -> Results m -> Results m
mappend = forall a. Semigroup a => a -> a -> a
(<>)

-- | Prepare the simulation results.
results :: [ResultSource m] -> Results m
results :: forall (m :: * -> *). [ResultSource m] -> Results m
results [ResultSource m]
ms =
  Results { resultSourceMap :: ResultSourceMap m
resultSourceMap  = forall k a. Ord k => [(k, a)] -> Map k a
M.fromList forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (\ResultSource m
x -> (forall (m :: * -> *). ResultSource m -> ResultName
resultSourceName ResultSource m
x, ResultSource m
x)) [ResultSource m]
ms,
            resultSourceList :: [ResultSource m]
resultSourceList = [ResultSource m]
ms }

-- | Represent the results as integer numbers.
resultsToIntValues :: MonadDES m => Results m -> [ResultValue Int m]
resultsToIntValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue Int m]
resultsToIntValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue Int m]
resultSourceToIntValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as lists of integer numbers.
resultsToIntListValues :: MonadDES m => Results m -> [ResultValue [Int] m]
resultsToIntListValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue [Int] m]
resultsToIntListValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue [Int] m]
resultSourceToIntListValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as statistics based on integer numbers.
resultsToIntStatsValues :: MonadDES m => Results m -> [ResultValue (SamplingStats Int) m]
resultsToIntStatsValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue (SamplingStats Int) m]
resultsToIntStatsValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (SamplingStats Int) m]
resultSourceToIntStatsValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as statistics based on integer numbers and optimised for fast aggregation.
resultsToIntStatsEitherValues :: MonadDES m => Results m -> [ResultValue (Either Int (SamplingStats Int)) m]
resultsToIntStatsEitherValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue (Either Int (SamplingStats Int)) m]
resultsToIntStatsEitherValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (Either Int (SamplingStats Int)) m]
resultSourceToIntStatsEitherValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as timing statistics based on integer numbers.
resultsToIntTimingStatsValues :: MonadDES m => Results m -> [ResultValue (TimingStats Int) m]
resultsToIntTimingStatsValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue (TimingStats Int) m]
resultsToIntTimingStatsValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (TimingStats Int) m]
resultSourceToIntTimingStatsValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as double floating point numbers.
resultsToDoubleValues :: MonadDES m => Results m -> [ResultValue Double m]
resultsToDoubleValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue Double m]
resultsToDoubleValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue Double m]
resultSourceToDoubleValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as lists of double floating point numbers.
resultsToDoubleListValues :: MonadDES m => Results m -> [ResultValue [Double] m]
resultsToDoubleListValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue [Double] m]
resultsToDoubleListValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue [Double] m]
resultSourceToDoubleListValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as statistics based on double floating point numbers.
resultsToDoubleStatsValues :: MonadDES m => Results m -> [ResultValue (SamplingStats Double) m]
resultsToDoubleStatsValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue (SamplingStats Double) m]
resultsToDoubleStatsValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (SamplingStats Double) m]
resultSourceToDoubleStatsValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as statistics based on double floating point numbers and optimised for fast aggregation.
resultsToDoubleStatsEitherValues :: MonadDES m => Results m -> [ResultValue (Either Double (SamplingStats Double)) m]
resultsToDoubleStatsEitherValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue (Either Double (SamplingStats Double)) m]
resultsToDoubleStatsEitherValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m
-> [ResultValue (Either Double (SamplingStats Double)) m]
resultSourceToDoubleStatsEitherValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as timing statistics based on double floating point numbers.
resultsToDoubleTimingStatsValues :: MonadDES m => Results m -> [ResultValue (TimingStats Double) m]
resultsToDoubleTimingStatsValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue (TimingStats Double) m]
resultsToDoubleTimingStatsValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (TimingStats Double) m]
resultSourceToDoubleTimingStatsValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as string values.
resultsToStringValues :: MonadDES m => Results m -> [ResultValue String m]
resultsToStringValues :: forall (m :: * -> *).
MonadDES m =>
Results m -> [ResultValue ResultName m]
resultsToStringValues = forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue ResultName m]
resultSourceToStringValues forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Return a signal emitted by the specified results.
resultSignal :: MonadDES m => Results m -> ResultSignal m
resultSignal :: forall (m :: * -> *). MonadDES m => Results m -> ResultSignal m
resultSignal = forall a. Monoid a => [a] -> a
mconcat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSignal m
resultSourceSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Return an expanded version of the simulation results expanding the properties as possible, which
-- takes place for expanding statistics to show the count, average, deviation, minimum, maximum etc.
-- as separate values.
expandResults :: MonadDES m => ResultTransform m
expandResults :: forall (m :: * -> *). MonadDES m => ResultTransform m
expandResults = forall (m :: * -> *). [ResultSource m] -> Results m
results forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
expandResultSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Return a short version of the simulation results, i.e. their summary, expanding the main properties
-- or excluding auxiliary properties if required.
resultSummary :: MonadDES m => ResultTransform m
resultSummary :: forall (m :: * -> *). MonadDES m => ResultTransform m
resultSummary = forall (m :: * -> *). [ResultSource m] -> Results m
results forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
resultSourceSummary forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Take a result by its name.
resultByName :: ResultName -> ResultTransform m
resultByName :: forall (m :: * -> *). ResultName -> ResultTransform m
resultByName ResultName
name Results m
rs =
  case forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup ResultName
name (forall (m :: * -> *). Results m -> ResultSourceMap m
resultSourceMap Results m
rs) of
    Just ResultSource m
x -> forall (m :: * -> *). [ResultSource m] -> Results m
results [ResultSource m
x]
    Maybe (ResultSource m)
Nothing ->
      forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
      ResultName
"Not found result source with name " forall a. [a] -> [a] -> [a]
++ ResultName
name forall a. [a] -> [a] -> [a]
++
      ResultName
": resultByName"

-- | Take a result from the object with the specified property label,
-- but it is more preferrable to refer to the property by its 'ResultId'
-- identifier with help of the 'resultById' function.
resultByProperty :: ResultName -> ResultTransform m
resultByProperty :: forall (m :: * -> *). ResultName -> ResultTransform m
resultByProperty ResultName
label Results m
rs = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (m :: * -> *).
(ResultSource m -> [ResultSource m]) -> ResultTransform m
composeResults Results m
rs forall {m :: * -> *}. ResultSource m -> [ResultSource m]
loop
  where
    loop :: ResultSource m -> [ResultSource m]
loop ResultSource m
x =
      case ResultSource m
x of
        ResultObjectSource ResultObject m
s ->
          let ps :: [ResultProperty m]
ps =
                forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. (a -> Bool) -> [a] -> [a]
filter (forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties ResultObject m
s) forall a b. (a -> b) -> a -> b
$ \ResultProperty m
p ->
                forall (m :: * -> *). ResultProperty m -> ResultName
resultPropertyLabel ResultProperty m
p forall a. Eq a => a -> a -> Bool
== ResultName
label
          in case [ResultProperty m]
ps of
            [] ->
              forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
              ResultName
"Not found property " forall a. [a] -> [a] -> [a]
++ ResultName
label forall a. [a] -> [a] -> [a]
++
              ResultName
" for object " forall a. [a] -> [a] -> [a]
++ forall (m :: * -> *). ResultObject m -> ResultName
resultObjectName ResultObject m
s forall a. [a] -> [a] -> [a]
++
              ResultName
": resultByProperty"
            [ResultProperty m]
ps ->
              forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource [ResultProperty m]
ps
        ResultVectorSource ResultVector m
s ->
          forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultSource m]
loop forall a b. (a -> b) -> a -> b
$ forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
s
        ResultSource m
x ->
          forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
          ResultName
"Result source " forall a. [a] -> [a] -> [a]
++ forall (m :: * -> *). ResultSource m -> ResultName
resultSourceName ResultSource m
x forall a. [a] -> [a] -> [a]
++
          ResultName
" is neither object, nor vector " forall a. [a] -> [a] -> [a]
++
          ResultName
": resultByProperty"

-- | Take a result from the object with the specified identifier. It can identify
-- an item, object property, the object iself, vector or its elements.
resultById :: ResultId -> ResultTransform m
resultById :: forall (m :: * -> *). ResultId -> ResultTransform m
resultById ResultId
i Results m
rs = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (m :: * -> *).
(ResultSource m -> [ResultSource m]) -> ResultTransform m
composeResults Results m
rs forall {m :: * -> *}. ResultSource m -> [ResultSource m]
loop
  where
    loop :: ResultSource m -> [ResultSource m]
loop ResultSource m
x =
      case ResultSource m
x of
        ResultItemSource (ResultItem a m
s) ->
          if forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultId
resultItemId a m
s forall a. Eq a => a -> a -> Bool
== ResultId
i
          then [ResultSource m
x]
          else forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
               ResultName
"Expected to find item with Id = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> ResultName
show ResultId
i forall a. [a] -> [a] -> [a]
++
               ResultName
", while the item " forall a. [a] -> [a] -> [a]
++ forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
s forall a. [a] -> [a] -> [a]
++
               ResultName
" has actual Id = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> ResultName
show (forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultId
resultItemId a m
s) forall a. [a] -> [a] -> [a]
++
               ResultName
": resultById"
        ResultObjectSource ResultObject m
s ->
          if forall (m :: * -> *). ResultObject m -> ResultId
resultObjectId ResultObject m
s forall a. Eq a => a -> a -> Bool
== ResultId
i
          then [ResultSource m
x]
          else let ps :: [ResultProperty m]
ps =
                     forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. (a -> Bool) -> [a] -> [a]
filter (forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties ResultObject m
s) forall a b. (a -> b) -> a -> b
$ \ResultProperty m
p ->
                     forall (m :: * -> *). ResultProperty m -> ResultId
resultPropertyId ResultProperty m
p forall a. Eq a => a -> a -> Bool
== ResultId
i
               in case [ResultProperty m]
ps of
                 [] ->
                   forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
                   ResultName
"Not found property with Id = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> ResultName
show ResultId
i forall a. [a] -> [a] -> [a]
++
                   ResultName
" for object " forall a. [a] -> [a] -> [a]
++ forall (m :: * -> *). ResultObject m -> ResultName
resultObjectName ResultObject m
s forall a. [a] -> [a] -> [a]
++
                   ResultName
" that has actual Id = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> ResultName
show (forall (m :: * -> *). ResultObject m -> ResultId
resultObjectId ResultObject m
s) forall a. [a] -> [a] -> [a]
++
                   ResultName
": resultById"
                 [ResultProperty m]
ps ->
                   forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource [ResultProperty m]
ps
        ResultVectorSource ResultVector m
s ->
          if forall (m :: * -> *). ResultVector m -> ResultId
resultVectorId ResultVector m
s forall a. Eq a => a -> a -> Bool
== ResultId
i
          then [ResultSource m
x]
          else forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultSource m]
loop forall a b. (a -> b) -> a -> b
$ forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
s
        ResultSource m
x ->
          forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
          ResultName
"Result source " forall a. [a] -> [a] -> [a]
++ forall (m :: * -> *). ResultSource m -> ResultName
resultSourceName ResultSource m
x forall a. [a] -> [a] -> [a]
++
          ResultName
" is neither item, nor object, nor vector " forall a. [a] -> [a] -> [a]
++
          ResultName
": resultById"

-- | Take a result from the vector by the specified integer index.
resultByIndex :: Int -> ResultTransform m
resultByIndex :: forall (m :: * -> *). Int -> ResultTransform m
resultByIndex Int
index Results m
rs = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (m :: * -> *).
(ResultSource m -> [ResultSource m]) -> ResultTransform m
composeResults Results m
rs forall {m :: * -> *}. ResultSource m -> [ResultSource m]
loop
  where
    loop :: ResultSource m -> [ResultSource m]
loop ResultSource m
x =
      case ResultSource m
x of
        ResultVectorSource ResultVector m
s ->
          [forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
s forall i e. Ix i => Array i e -> i -> e
A.! Int
index] 
        ResultSource m
x ->
          forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
          ResultName
"Result source " forall a. [a] -> [a] -> [a]
++ forall (m :: * -> *). ResultSource m -> ResultName
resultSourceName ResultSource m
x forall a. [a] -> [a] -> [a]
++
          ResultName
" is not vector " forall a. [a] -> [a] -> [a]
++
          ResultName
": resultByIndex"

-- | Take a result from the vector by the specified string subscript.
resultBySubscript :: ResultName -> ResultTransform m
resultBySubscript :: forall (m :: * -> *). ResultName -> ResultTransform m
resultBySubscript ResultName
subscript Results m
rs = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (m :: * -> *).
(ResultSource m -> [ResultSource m]) -> ResultTransform m
composeResults Results m
rs forall {m :: * -> *}. ResultSource m -> [ResultSource m]
loop
  where
    loop :: ResultSource m -> [ResultSource m]
loop ResultSource m
x =
      case ResultSource m
x of
        ResultVectorSource ResultVector m
s ->
          let ys :: [ResultSource m]
ys = forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
s
              zs :: [ResultName]
zs = forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). ResultVector m -> Array Int ResultName
resultVectorSubscript ResultVector m
s
              ps :: [(ResultSource m, ResultName)]
ps =
                forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. (a -> Bool) -> [a] -> [a]
filter (forall a b. [a] -> [b] -> [(a, b)]
zip [ResultSource m]
ys [ResultName]
zs) forall a b. (a -> b) -> a -> b
$ \(ResultSource m
y, ResultName
z) ->
                ResultName
z forall a. Eq a => a -> a -> Bool
== ResultName
subscript
          in case [(ResultSource m, ResultName)]
ps of
            [] ->
              forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
              ResultName
"Not found subscript " forall a. [a] -> [a] -> [a]
++ ResultName
subscript forall a. [a] -> [a] -> [a]
++
              ResultName
" for vector " forall a. [a] -> [a] -> [a]
++ forall (m :: * -> *). ResultVector m -> ResultName
resultVectorName ResultVector m
s forall a. [a] -> [a] -> [a]
++
              ResultName
": resultBySubscript"
            [(ResultSource m, ResultName)]
ps ->
              forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ResultSource m, ResultName)]
ps
        ResultSource m
x ->
          forall a. HasCallStack => ResultName -> a
error forall a b. (a -> b) -> a -> b
$
          ResultName
"Result source " forall a. [a] -> [a] -> [a]
++ forall (m :: * -> *). ResultSource m -> ResultName
resultSourceName ResultSource m
x forall a. [a] -> [a] -> [a]
++
          ResultName
" is not vector " forall a. [a] -> [a] -> [a]
++
          ResultName
": resultBySubscript"

-- | Compose the results using the specified transformation function.
composeResults :: (ResultSource m -> [ResultSource m]) -> ResultTransform m
composeResults :: forall (m :: * -> *).
(ResultSource m -> [ResultSource m]) -> ResultTransform m
composeResults ResultSource m -> [ResultSource m]
f =
  forall (m :: * -> *). [ResultSource m] -> Results m
results forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultSource m]
f forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Concatenate the results using the specified list of transformation functions.
concatResults :: [ResultTransform m] -> ResultTransform m
concatResults :: forall (m :: * -> *). [ResultTransform m] -> ResultTransform m
concatResults [ResultTransform m]
trs Results m
rs =
  forall (m :: * -> *). [ResultSource m] -> Results m
results forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (\ResultTransform m
tr -> forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList forall a b. (a -> b) -> a -> b
$ ResultTransform m
tr Results m
rs) [ResultTransform m]
trs

-- | Append the results using the specified transformation functions.
appendResults :: ResultTransform m -> ResultTransform m -> ResultTransform m
appendResults :: forall (m :: * -> *).
ResultTransform m -> ResultTransform m -> ResultTransform m
appendResults ResultTransform m
x ResultTransform m
y =
  forall (m :: * -> *). [ResultTransform m] -> ResultTransform m
concatResults [ResultTransform m
x, ResultTransform m
y]

-- | Return a pure signal as a result of combination of the predefined signals
-- with the specified result signal usually provided by the sources.
--
-- The signal returned is triggered when the source signal is triggered.
-- The pure signal is also triggered in the integration time points
-- if the source signal is unknown or it was combined with any unknown signal.
pureResultSignal :: MonadDES m => ResultPredefinedSignals m -> ResultSignal m -> Signal m ()
pureResultSignal :: forall (m :: * -> *).
MonadDES m =>
ResultPredefinedSignals m -> ResultSignal m -> Signal m ()
pureResultSignal ResultPredefinedSignals m
rs ResultSignal m
EmptyResultSignal =
  forall (f :: * -> *) a. Functor f => f a -> f ()
void (forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInStartTime ResultPredefinedSignals m
rs)
pureResultSignal ResultPredefinedSignals m
rs ResultSignal m
UnknownResultSignal =
  forall (f :: * -> *) a. Functor f => f a -> f ()
void (forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInIntegTimes ResultPredefinedSignals m
rs)
pureResultSignal ResultPredefinedSignals m
rs (ResultSignal Signal m ()
s) =
  forall (f :: * -> *) a. Functor f => f a -> f ()
void (forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInStartTime ResultPredefinedSignals m
rs) forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. Functor f => f a -> f ()
void (forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInStopTime ResultPredefinedSignals m
rs) forall a. Semigroup a => a -> a -> a
<> Signal m ()
s
pureResultSignal ResultPredefinedSignals m
rs (ResultSignalMix Signal m ()
s) =
  forall (f :: * -> *) a. Functor f => f a -> f ()
void (forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInIntegTimes ResultPredefinedSignals m
rs) forall a. Semigroup a => a -> a -> a
<> Signal m ()
s

-- | Represents a computation that can return the simulation data.
class MonadDES m => ResultComputing t m where

  -- | Compute data with the results of simulation.
  computeResultData :: t m a -> ResultData a m

  -- | Return the signal triggered when data change if such a signal exists.
  computeResultSignal :: t m a -> ResultSignal m

-- | Return a new result value by the specified name, identifier and computation.
computeResultValue :: ResultComputing t m
                      => ResultName
                      -- ^ the result name
                      -> [ResultName]
                      -- ^ the result name path
                      -> ResultId
                      -- ^ the result identifier
                      -> [ResultId]
                      -- ^ the result identifier path
                      -> t m a
                      -- ^ the result computation
                      -> ResultValue a m
computeResultValue :: forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is t m a
m =
  ResultValue {
    resultValueName :: ResultName
resultValueName   = ResultName
name,
    resultValueNamePath :: [ResultName]
resultValueNamePath = [ResultName]
names,
    resultValueId :: ResultId
resultValueId     = ResultId
i,
    resultValueIdPath :: [ResultId]
resultValueIdPath = [ResultId]
is,
    resultValueData :: ResultData a m
resultValueData   = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
t m a -> ResultData a m
computeResultData t m a
m,
    resultValueSignal :: ResultSignal m
resultValueSignal = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
t m a -> ResultSignal m
computeResultSignal t m a
m }

instance MonadDES m => ResultComputing Parameter m where

  computeResultData :: forall a. Parameter m a -> ResultData a m
computeResultData = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ParameterLift t m =>
Parameter m a -> t m a
liftParameter
  computeResultSignal :: forall a. Parameter m a -> ResultSignal m
computeResultSignal = forall a b. a -> b -> a
const forall (m :: * -> *). ResultSignal m
UnknownResultSignal

instance MonadDES m => ResultComputing Simulation m where

  computeResultData :: forall a. Simulation m a -> ResultData a m
computeResultData = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
SimulationLift t m =>
Simulation m a -> t m a
liftSimulation
  computeResultSignal :: forall a. Simulation m a -> ResultSignal m
computeResultSignal = forall a b. a -> b -> a
const forall (m :: * -> *). ResultSignal m
UnknownResultSignal

instance MonadDES m => ResultComputing Dynamics m where

  computeResultData :: forall a. Dynamics m a -> ResultData a m
computeResultData = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics
  computeResultSignal :: forall a. Dynamics m a -> ResultSignal m
computeResultSignal = forall a b. a -> b -> a
const forall (m :: * -> *). ResultSignal m
UnknownResultSignal

instance MonadDES m => ResultComputing Event m where

  computeResultData :: forall a. Event m a -> Event m a
computeResultData = forall a. a -> a
id
  computeResultSignal :: forall a. Event m a -> ResultSignal m
computeResultSignal = forall a b. a -> b -> a
const forall (m :: * -> *). ResultSignal m
UnknownResultSignal

instance MonadDES m => ResultComputing Ref m where

  computeResultData :: forall a. Ref m a -> ResultData a m
computeResultData = forall (m :: * -> *) a. MonadDES m => Ref m a -> Event m a
readRef
  computeResultSignal :: forall a. Ref m a -> ResultSignal m
computeResultSignal = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. MonadDES m => Ref m a -> Signal m ()
refChanged_

instance MonadDES m => ResultComputing B.Ref m where

  computeResultData :: forall a. Ref m a -> ResultData a m
computeResultData = forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
B.readRef
  computeResultSignal :: forall a. Ref m a -> ResultSignal m
computeResultSignal = forall a b. a -> b -> a
const forall (m :: * -> *). ResultSignal m
UnknownResultSignal

instance MonadVar m => ResultComputing Var m where

  computeResultData :: forall a. Var m a -> ResultData a m
computeResultData = forall (m :: * -> *) a. MonadVar m => Var m a -> ResultData a m
readVar
  computeResultSignal :: forall a. Var m a -> ResultSignal m
computeResultSignal = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a.
(MonadVar m, MonadDES m) =>
Var m a -> Signal m ()
varChanged_

instance MonadDES m => ResultComputing Signalable m where

  computeResultData :: forall a. Signalable m a -> ResultData a m
computeResultData = forall (m :: * -> *) a. Signalable m a -> Event m a
readSignalable
  computeResultSignal :: forall a. Signalable m a -> ResultSignal m
computeResultSignal = forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. Signalable m a -> Signal m ()
signalableChanged_
      
-- | Return a source by the specified statistics.
samplingStatsResultSource :: (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultValue (SamplingStats a) m
                             -- ^ the statistics
                             -> ResultSource m
samplingStatsResultSource :: forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSource ResultValue (SamplingStats a) m
x =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName      = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (SamplingStats a) m
x,
    resultObjectId :: ResultId
resultObjectId        = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (SamplingStats a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
SamplingStatsId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (SamplingStats a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSummary ResultValue (SamplingStats a) m
x,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingStats a) m) m
c ResultName
"count" ResultId
SamplingStatsCountId forall a. SamplingStats a -> Int
samplingStatsCount,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingStats a) m) m
c ResultName
"mean" ResultId
SamplingStatsMeanId forall a. SamplingStats a -> Double
samplingStatsMean,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingStats a) m) m
c ResultName
"mean2" ResultId
SamplingStatsMean2Id forall a. SamplingStats a -> Double
samplingStatsMean2,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingStats a) m) m
c ResultName
"std" ResultId
SamplingStatsDeviationId forall a. SamplingStats a -> Double
samplingStatsDeviation,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingStats a) m) m
c ResultName
"var" ResultId
SamplingStatsVarianceId forall a. SamplingStats a -> Double
samplingStatsVariance,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingStats a) m) m
c ResultName
"min" ResultId
SamplingStatsMinId forall a. SamplingStats a -> a
samplingStatsMin,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingStats a) m) m
c ResultName
"max" ResultId
SamplingStatsMaxId forall a. SamplingStats a -> a
samplingStatsMax ] }
  where
    c :: ResultContainer (ResultData (SamplingStats a) m) m
c = forall a (m :: * -> *).
ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer ResultValue (SamplingStats a) m
x

-- | Return the summary by the specified statistics.
samplingStatsResultSummary :: (MonadDES m,
                               ResultItemable (ResultValue (SamplingStats a)))
                              => ResultValue (SamplingStats a) m
                              -- ^ the statistics
                              -> ResultSource m
samplingStatsResultSummary :: forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue ResultName m
resultItemToStringValue 
  
-- | Return a source by the specified timing statistics.
timingStatsResultSource :: (MonadDES m,
                            TimingData a,
                            ResultItemable (ResultValue a),
                            ResultItemable (ResultValue (TimingStats a)))
                           => ResultValue (TimingStats a) m
                           -- ^ the statistics
                           -> ResultSource m
timingStatsResultSource :: forall (m :: * -> *) a.
(MonadDES m, TimingData a, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSource ResultValue (TimingStats a) m
x =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName      = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (TimingStats a) m
x,
    resultObjectId :: ResultId
resultObjectId        = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (TimingStats a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
TimingStatsId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (TimingStats a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = forall (m :: * -> *) a.
(MonadDES m, TimingData a,
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSummary ResultValue (TimingStats a) m
x,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"count" ResultId
TimingStatsCountId forall a. TimingStats a -> Int
timingStatsCount,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"mean" ResultId
TimingStatsMeanId forall a. TimingData a => TimingStats a -> Double
timingStatsMean,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"std" ResultId
TimingStatsDeviationId forall a. TimingData a => TimingStats a -> Double
timingStatsDeviation,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"var" ResultId
TimingStatsVarianceId forall a. TimingData a => TimingStats a -> Double
timingStatsVariance,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"min" ResultId
TimingStatsMinId forall a. TimingStats a -> a
timingStatsMin,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"max" ResultId
TimingStatsMaxId forall a. TimingStats a -> a
timingStatsMax,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"minTime" ResultId
TimingStatsMinTimeId forall a. TimingStats a -> Double
timingStatsMinTime,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"maxTime" ResultId
TimingStatsMaxTimeId forall a. TimingStats a -> Double
timingStatsMaxTime,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"startTime" ResultId
TimingStatsStartTimeId forall a. TimingStats a -> Double
timingStatsStartTime,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"lastTime" ResultId
TimingStatsLastTimeId forall a. TimingStats a -> Double
timingStatsLastTime,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"sum" ResultId
TimingStatsSumId forall a. TimingStats a -> Double
timingStatsSum,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingStats a) m) m
c ResultName
"sum2" ResultId
TimingStatsSum2Id forall a. TimingStats a -> Double
timingStatsSum2 ] }
  where
    c :: ResultContainer (ResultData (TimingStats a) m) m
c = forall a (m :: * -> *).
ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer ResultValue (TimingStats a) m
x

-- | Return the summary by the specified timing statistics.
timingStatsResultSummary :: (MonadDES m,
                             TimingData a,
                             ResultItemable (ResultValue (TimingStats a)))
                            => ResultValue (TimingStats a) m 
                            -- ^ the statistics
                            -> ResultSource m
timingStatsResultSummary :: forall (m :: * -> *) a.
(MonadDES m, TimingData a,
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSummary = forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue ResultName m
resultItemToStringValue
  
-- | Return a source by the specified counter.
samplingCounterResultSource :: (MonadDES m,
                                ResultItemable (ResultValue a),
                                ResultItemable (ResultValue (SamplingStats a)))
                               => ResultValue (SamplingCounter a) m
                               -- ^ the counter
                               -> ResultSource m
samplingCounterResultSource :: forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource ResultValue (SamplingCounter a) m
x =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName      = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (SamplingCounter a) m
x,
    resultObjectId :: ResultId
resultObjectId        = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (SamplingCounter a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
SamplingCounterId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (SamplingCounter a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSummary ResultValue (SamplingCounter a) m
x,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingCounter a) m) m
c ResultName
"value" ResultId
SamplingCounterValueId forall a. SamplingCounter a -> a
samplingCounterValue,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingCounter a) m) m
c ResultName
"stats" ResultId
SamplingCounterStatsId forall a. SamplingCounter a -> SamplingStats a
samplingCounterStats ] }
  where
    c :: ResultContainer (ResultData (SamplingCounter a) m) m
c = forall a (m :: * -> *).
ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer ResultValue (SamplingCounter a) m
x
      
-- | Return a source by the specified counter.
samplingCounterResultSummary :: (MonadDES m,
                                 ResultItemable (ResultValue a),
                                 ResultItemable (ResultValue (SamplingStats a)))
                                => ResultValue (SamplingCounter a) m
                                -- ^ the counter
                                -> ResultSource m
samplingCounterResultSummary :: forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSummary ResultValue (SamplingCounter a) m
x =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName      = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (SamplingCounter a) m
x,
    resultObjectId :: ResultId
resultObjectId        = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (SamplingCounter a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
SamplingCounterId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (SamplingCounter a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSummary ResultValue (SamplingCounter a) m
x,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingCounter a) m) m
c ResultName
"value" ResultId
SamplingCounterValueId forall a. SamplingCounter a -> a
samplingCounterValue,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (SamplingCounter a) m) m
c ResultName
"stats" ResultId
SamplingCounterStatsId forall a. SamplingCounter a -> SamplingStats a
samplingCounterStats ] }
  where
    c :: ResultContainer (ResultData (SamplingCounter a) m) m
c = forall a (m :: * -> *).
ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer ResultValue (SamplingCounter a) m
x
      
-- | Return a source by the specified counter.
timingCounterResultSource :: (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultValue (TimingCounter a) m
                             -- ^ the counter
                             -> ResultSource m
timingCounterResultSource :: forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource ResultValue (TimingCounter a) m
x =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName      = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (TimingCounter a) m
x,
    resultObjectId :: ResultId
resultObjectId        = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (TimingCounter a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
TimingCounterId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (TimingCounter a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSummary ResultValue (TimingCounter a) m
x,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingCounter a) m) m
c ResultName
"value" ResultId
TimingCounterValueId forall a. TimingCounter a -> a
timingCounterValue,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingCounter a) m) m
c ResultName
"stats" ResultId
TimingCounterStatsId forall a. TimingCounter a -> TimingStats a
timingCounterStats ] }
  where
    c :: ResultContainer (ResultData (TimingCounter a) m) m
c = forall a (m :: * -> *).
ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer ResultValue (TimingCounter a) m
x
      
-- | Return a source by the specified counter.
timingCounterResultSummary :: (MonadDES m,
                               ResultItemable (ResultValue a),
                               ResultItemable (ResultValue (TimingStats a)))
                              => ResultValue (TimingCounter a) m
                              -- ^ the counter
                              -> ResultSource m
timingCounterResultSummary :: forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSummary ResultValue (TimingCounter a) m
x =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName      = forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (TimingCounter a) m
x,
    resultObjectId :: ResultId
resultObjectId        = forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (TimingCounter a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
TimingCounterId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (TimingCounter a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSummary ResultValue (TimingCounter a) m
x,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingCounter a) m) m
c ResultName
"value" ResultId
TimingCounterValueId forall a. TimingCounter a -> a
timingCounterValue,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer (ResultData a m) m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerMapProperty ResultContainer (ResultData (TimingCounter a) m) m
c ResultName
"stats" ResultId
TimingCounterStatsId forall a. TimingCounter a -> TimingStats a
timingCounterStats ] }
  where
    c :: ResultContainer (ResultData (TimingCounter a) m) m
c = forall a (m :: * -> *).
ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer ResultValue (TimingCounter a) m
x
  
-- | Return a source by the specified finite queue.
queueResultSource :: (MonadDES m,
                      Show si, Show sm, Show so,
                      ResultItemable (ResultValue si),
                      ResultItemable (ResultValue sm),
                      ResultItemable (ResultValue so))
                     => ResultContainer (Q.Queue m si sm so a) m
                     -- ^ the queue container
                     -> ResultSource m
queueResultSource :: forall (m :: * -> *) si sm so a.
(MonadDES m, Show si, Show sm, Show so,
 ResultItemable (ResultValue si), ResultItemable (ResultValue sm),
 ResultItemable (ResultValue so)) =>
ResultContainer (Queue m si sm so a) m -> ResultSource m
queueResultSource ResultContainer (Queue m si sm so a) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m si sm so a) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Queue m si sm so a) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
FiniteQueueId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m si sm so a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) si sm so a.
(MonadDES m, Show si, Show sm, Show so) =>
ResultContainer (Queue m si sm so a) m -> ResultSource m
queueResultSummary ResultContainer (Queue m si sm so a) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueStrategy" ResultId
EnqueueStrategyId forall (m :: * -> *) si sm so a. Queue m si sm so a -> si
Q.enqueueStrategy,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueStoringStrategy" ResultId
EnqueueStoringStrategyId forall (m :: * -> *) si sm so a. Queue m si sm so a -> sm
Q.enqueueStoringStrategy,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueStrategy" ResultId
DequeueStrategyId forall (m :: * -> *) si sm so a. Queue m si sm so a -> so
Q.dequeueStrategy,
      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 si sm so a) m
c ResultName
"queueNull" ResultId
QueueNullId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Bool
Q.queueNull forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueNullChanged_,
      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 si sm so a) m
c ResultName
"queueFull" ResultId
QueueFullId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Bool
Q.queueFull forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueFullChanged_,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueMaxCount" ResultId
QueueMaxCountId forall (m :: * -> *) si sm so a. Queue m si sm so a -> Int
Q.queueMaxCount,
      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 si sm so a) m
c ResultName
"queueCount" ResultId
QueueCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.queueCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueCountChanged_,
      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 si sm so a) m
c ResultName
"queueCountStats" ResultId
QueueCountStatsId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (TimingStats Int)
Q.queueCountStats forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueCountChanged_,
      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 si sm so a) m
c ResultName
"enqueueCount" ResultId
EnqueueCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueCountChanged_,
      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 si sm so a) m
c ResultName
"enqueueLostCount" ResultId
EnqueueLostCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueLostCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueLostCountChanged_,
      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 si sm so a) m
c ResultName
"enqueueStoreCount" ResultId
EnqueueStoreCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueStoreCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueStoreCountChanged_,
      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 si sm so a) m
c ResultName
"dequeueCount" ResultId
DequeueCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.dequeueCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueCountChanged_,
      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 si sm so a) m
c ResultName
"dequeueExtractCount" ResultId
DequeueExtractCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.dequeueExtractCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueExtractCountChanged_,
      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 si sm so a) m
c ResultName
"queueLoadFactor" ResultId
QueueLoadFactorId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.queueLoadFactor forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueLoadFactorChanged_,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueRate" ResultId
EnqueueRateId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.enqueueRate,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueStoreRate" ResultId
EnqueueStoreRateId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.enqueueStoreRate,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueRate" ResultId
DequeueRateId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.dequeueRate,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueExtractRate" ResultId
DequeueExtractRateId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.dequeueExtractRate,
      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 si sm so a) m
c ResultName
"queueWaitTime" ResultId
QueueWaitTimeId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.queueWaitTime forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueWaitTimeChanged_,
      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 si sm so a) m
c ResultName
"queueTotalWaitTime" ResultId
QueueTotalWaitTimeId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.queueTotalWaitTime forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueTotalWaitTimeChanged_,
      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 si sm so a) m
c ResultName
"enqueueWaitTime" ResultId
EnqueueWaitTimeId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.enqueueWaitTime forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueWaitTimeChanged_,
      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 si sm so a) m
c ResultName
"dequeueWaitTime" ResultId
DequeueWaitTimeId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.dequeueWaitTime forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueWaitTimeChanged_,
      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 si sm so a) m
c ResultName
"queueRate" ResultId
QueueRateId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.queueRate forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueRateChanged_ ] }

-- | Return the summary by the specified finite queue.
queueResultSummary :: (MonadDES m,
                       Show si, Show sm, Show so)
                      => ResultContainer (Q.Queue m si sm so a) m
                      -- ^ the queue container
                      -> ResultSource m
queueResultSummary :: forall (m :: * -> *) si sm so a.
(MonadDES m, Show si, Show sm, Show so) =>
ResultContainer (Queue m si sm so a) m -> ResultSource m
queueResultSummary ResultContainer (Queue m si sm so a) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m si sm so a) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Queue m si sm so a) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
FiniteQueueId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m si sm so a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) si sm so a.
(MonadDES m, Show si, Show sm, Show so) =>
ResultContainer (Queue m si sm so a) m -> ResultSource m
queueResultSummary ResultContainer (Queue m si sm so a) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueMaxCount" ResultId
QueueMaxCountId forall (m :: * -> *) si sm so a. Queue m si sm so a -> Int
Q.queueMaxCount,
      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 si sm so a) m
c ResultName
"queueCountStats" ResultId
QueueCountStatsId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (TimingStats Int)
Q.queueCountStats forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueCountChanged_,
      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 si sm so a) m
c ResultName
"enqueueCount" ResultId
EnqueueCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueCountChanged_,
      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 si sm so a) m
c ResultName
"enqueueLostCount" ResultId
EnqueueLostCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueLostCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueLostCountChanged_,
      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 si sm so a) m
c ResultName
"enqueueStoreCount" ResultId
EnqueueStoreCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueStoreCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueStoreCountChanged_,
      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 si sm so a) m
c ResultName
"dequeueCount" ResultId
DequeueCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.dequeueCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueCountChanged_,
      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 si sm so a) m
c ResultName
"dequeueExtractCount" ResultId
DequeueExtractCountId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.dequeueExtractCount forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueExtractCountChanged_,
      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 si sm so a) m
c ResultName
"queueLoadFactor" ResultId
QueueLoadFactorId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.queueLoadFactor forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueLoadFactorChanged_,
      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 si sm so a) m
c ResultName
"queueWaitTime" ResultId
QueueWaitTimeId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.queueWaitTime forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueWaitTimeChanged_,
      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 si sm so a) m
c ResultName
"queueRate" ResultId
QueueRateId forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.queueRate forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueRateChanged_ ] }

-- | Return a source by the specified infinite queue.
infiniteQueueResultSource :: (MonadDES m,
                              Show sm, Show so,
                              ResultItemable (ResultValue sm),
                              ResultItemable (ResultValue so))
                             => ResultContainer (IQ.Queue m sm so a) m
                             -- ^ the queue container
                             -> ResultSource m
infiniteQueueResultSource :: forall (m :: * -> *) sm so a.
(MonadDES m, Show sm, Show so, ResultItemable (ResultValue sm),
 ResultItemable (ResultValue so)) =>
ResultContainer (Queue m sm so a) m -> ResultSource m
infiniteQueueResultSource ResultContainer (Queue m sm so a) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m sm so a) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Queue m sm so a) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
FiniteQueueId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m sm so a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) sm so a.
(MonadDES m, Show sm, Show so) =>
ResultContainer (Queue m sm so a) m -> ResultSource m
infiniteQueueResultSummary ResultContainer (Queue m sm so a) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Queue m sm so a) m
c ResultName
"enqueueStoringStrategy" ResultId
EnqueueStoringStrategyId forall (m :: * -> *) sm so a. Queue m sm so a -> sm
IQ.enqueueStoringStrategy,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueStrategy" ResultId
DequeueStrategyId forall (m :: * -> *) sm so a. Queue m sm so a -> so
IQ.dequeueStrategy,
      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 sm so a) m
c ResultName
"queueNull" ResultId
QueueNullId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Bool
IQ.queueNull forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueNullChanged_,
      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 sm so a) m
c ResultName
"queueCount" ResultId
QueueCountId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.queueCount forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueCountChanged_,
      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 sm so a) m
c ResultName
"queueCountStats" ResultId
QueueCountStatsId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (TimingStats Int)
IQ.queueCountStats forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueCountChanged_,
      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 sm so a) m
c ResultName
"enqueueStoreCount" ResultId
EnqueueStoreCountId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.enqueueStoreCount forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.enqueueStoreCountChanged_,
      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 sm so a) m
c ResultName
"dequeueCount" ResultId
DequeueCountId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.dequeueCount forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueCountChanged_,
      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 sm so a) m
c ResultName
"dequeueExtractCount" ResultId
DequeueExtractCountId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.dequeueExtractCount forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueExtractCountChanged_,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m sm so a) m
c ResultName
"enqueueStoreRate" ResultId
EnqueueStoreRateId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.enqueueStoreRate,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueRate" ResultId
DequeueRateId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.dequeueRate,
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueExtractRate" ResultId
DequeueExtractRateId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.dequeueExtractRate,
      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 sm so a) m
c ResultName
"queueWaitTime" ResultId
QueueWaitTimeId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (SamplingStats Double)
IQ.queueWaitTime forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueWaitTimeChanged_,
      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 sm so a) m
c ResultName
"dequeueWaitTime" ResultId
DequeueWaitTimeId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (SamplingStats Double)
IQ.dequeueWaitTime forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueWaitTimeChanged_,
      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 sm so a) m
c ResultName
"queueRate" ResultId
QueueRateId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.queueRate forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueRateChanged_ ] }

-- | Return the summary by the specified infinite queue.
infiniteQueueResultSummary :: (MonadDES m,
                               Show sm, Show so)
                              => ResultContainer (IQ.Queue m sm so a) m
                              -- ^ the queue container
                              -> ResultSource m
infiniteQueueResultSummary :: forall (m :: * -> *) sm so a.
(MonadDES m, Show sm, Show so) =>
ResultContainer (Queue m sm so a) m -> ResultSource m
infiniteQueueResultSummary ResultContainer (Queue m sm so a) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m sm so a) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Queue m sm so a) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
FiniteQueueId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m sm so a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) sm so a.
(MonadDES m, Show sm, Show so) =>
ResultContainer (Queue m sm so a) m -> ResultSource m
infiniteQueueResultSummary ResultContainer (Queue m sm so a) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 sm so a) m
c ResultName
"queueCountStats" ResultId
QueueCountStatsId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (TimingStats Int)
IQ.queueCountStats forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueCountChanged_,
      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 sm so a) m
c ResultName
"enqueueStoreCount" ResultId
EnqueueStoreCountId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.enqueueStoreCount forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.enqueueStoreCountChanged_,
      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 sm so a) m
c ResultName
"dequeueCount" ResultId
DequeueCountId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.dequeueCount forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueCountChanged_,
      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 sm so a) m
c ResultName
"dequeueExtractCount" ResultId
DequeueExtractCountId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.dequeueExtractCount forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueExtractCountChanged_,
      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 sm so a) m
c ResultName
"queueWaitTime" ResultId
QueueWaitTimeId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (SamplingStats Double)
IQ.queueWaitTime forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueWaitTimeChanged_,
      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 sm so a) m
c ResultName
"queueRate" ResultId
QueueRateId forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.queueRate forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueRateChanged_ ] }
  
-- | Return a source by the specified arrival timer.
arrivalTimerResultSource :: MonadDES m
                            => ResultContainer (ArrivalTimer m) m
                            -- ^ the arrival timer container
                            -> ResultSource m
arrivalTimerResultSource :: forall (m :: * -> *).
MonadDES m =>
ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSource ResultContainer (ArrivalTimer m) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (ArrivalTimer m) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (ArrivalTimer m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ArrivalTimerId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (ArrivalTimer m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *).
MonadDES m =>
ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSummary ResultContainer (ArrivalTimer m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (ArrivalTimer m) m
c ResultName
"processingTime" ResultId
ArrivalProcessingTimeId forall (m :: * -> *).
MonadDES m =>
ArrivalTimer m -> Event m (SamplingStats Double)
arrivalProcessingTime forall (m :: * -> *). MonadDES m => ArrivalTimer m -> Signal m ()
arrivalProcessingTimeChanged_ ] }

-- | Return the summary by the specified arrival timer.
arrivalTimerResultSummary :: MonadDES m
                             => ResultContainer (ArrivalTimer m) m
                             -- ^ the arrival timer container
                             -> ResultSource m
arrivalTimerResultSummary :: forall (m :: * -> *).
MonadDES m =>
ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSummary ResultContainer (ArrivalTimer m) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (ArrivalTimer m) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (ArrivalTimer m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ArrivalTimerId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (ArrivalTimer m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *).
MonadDES m =>
ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSummary ResultContainer (ArrivalTimer m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (ArrivalTimer m) m
c ResultName
"processingTime" ResultId
ArrivalProcessingTimeId forall (m :: * -> *).
MonadDES m =>
ArrivalTimer m -> Event m (SamplingStats Double)
arrivalProcessingTime forall (m :: * -> *). MonadDES m => ArrivalTimer m -> Signal m ()
arrivalProcessingTimeChanged_ ] }

-- | Return a source by the specified server.
serverResultSource :: (MonadDES m,
                       Show s, ResultItemable (ResultValue s))
                      => ResultContainer (Server m s a b) m
                      -- ^ the server container
                      -> ResultSource m
serverResultSource :: forall (m :: * -> *) s a b.
(MonadDES m, Show s, ResultItemable (ResultValue s)) =>
ResultContainer (Server m s a b) m -> ResultSource m
serverResultSource ResultContainer (Server m s a b) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Server m s a b) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Server m s a b) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ServerId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Server m s a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) s a b.
MonadDES m =>
ResultContainer (Server m s a b) m -> ResultSource m
serverResultSummary ResultContainer (Server m s a b) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Server m s a b) m
c ResultName
"initState" ResultId
ServerInitStateId forall (m :: * -> *) s a b. Server m s a b -> s
serverInitState,
      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 (Server m s a b) m
c ResultName
"state" ResultId
ServerStateId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m s
serverState forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverStateChanged_,
      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 (Server m s a b) m
c ResultName
"totalInputWaitTime" ResultId
ServerTotalInputWaitTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalInputWaitTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalInputWaitTimeChanged_,
      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 (Server m s a b) m
c ResultName
"totalProcessingTime" ResultId
ServerTotalProcessingTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalProcessingTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalProcessingTimeChanged_,
      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 (Server m s a b) m
c ResultName
"totalOutputWaitTime" ResultId
ServerTotalOutputWaitTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalOutputWaitTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalOutputWaitTimeChanged_,
      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 (Server m s a b) m
c ResultName
"totalPreemptionTime" ResultId
ServerTotalPreemptionTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalPreemptionTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalPreemptionTimeChanged_,
      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 (Server m s a b) m
c ResultName
"inputWaitTime" ResultId
ServerInputWaitTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverInputWaitTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitTimeChanged_,
      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 (Server m s a b) m
c ResultName
"processingTime" ResultId
ServerProcessingTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverProcessingTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingTimeChanged_,
      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 (Server m s a b) m
c ResultName
"outputWaitTime" ResultId
ServerOutputWaitTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverOutputWaitTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitTimeChanged_,
      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 (Server m s a b) m
c ResultName
"preemptionTime" ResultId
ServerPreemptionTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverPreemptionTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionTimeChanged_,
      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 (Server m s a b) m
c ResultName
"inputWaitFactor" ResultId
ServerInputWaitFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverInputWaitFactor forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitFactorChanged_,
      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 (Server m s a b) m
c ResultName
"processingFactor" ResultId
ServerProcessingFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverProcessingFactor forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingFactorChanged_,
      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 (Server m s a b) m
c ResultName
"outputWaitFactor" ResultId
ServerOutputWaitFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverOutputWaitFactor forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitFactorChanged_,
      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 (Server m s a b) m
c ResultName
"preemptionFactor" ResultId
ServerPreemptionFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverPreemptionFactor forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionFactorChanged_ ] }

-- | Return the summary by the specified server.
serverResultSummary :: MonadDES m
                       => ResultContainer (Server m s a b) m
                       -- ^ the server container
                       -> ResultSource m
serverResultSummary :: forall (m :: * -> *) s a b.
MonadDES m =>
ResultContainer (Server m s a b) m -> ResultSource m
serverResultSummary ResultContainer (Server m s a b) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Server m s a b) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Server m s a b) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ServerId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Server m s a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) s a b.
MonadDES m =>
ResultContainer (Server m s a b) m -> ResultSource m
serverResultSummary ResultContainer (Server m s a b) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (Server m s a b) m
c ResultName
"inputWaitTime" ResultId
ServerInputWaitTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverInputWaitTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitTimeChanged_,
      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 (Server m s a b) m
c ResultName
"processingTime" ResultId
ServerProcessingTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverProcessingTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingTimeChanged_,
      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 (Server m s a b) m
c ResultName
"outputWaitTime" ResultId
ServerOutputWaitTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverOutputWaitTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitTimeChanged_,
      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 (Server m s a b) m
c ResultName
"preemptionTime" ResultId
ServerPreemptionTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverPreemptionTime forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionTimeChanged_,
      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 (Server m s a b) m
c ResultName
"inputWaitFactor" ResultId
ServerInputWaitFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverInputWaitFactor forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitFactorChanged_,
      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 (Server m s a b) m
c ResultName
"processingFactor" ResultId
ServerProcessingFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverProcessingFactor forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingFactorChanged_,
      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 (Server m s a b) m
c ResultName
"outputWaitFactor" ResultId
ServerOutputWaitFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverOutputWaitFactor forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitFactorChanged_,
      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 (Server m s a b) m
c ResultName
"preemptionFactor" ResultId
ServerPreemptionFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverPreemptionFactor forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionFactorChanged_ ] }

-- | Return a source by the specified activity.
activityResultSource :: (MonadDES m,
                         Show s, ResultItemable (ResultValue s))
                        => ResultContainer (Activity m s a b) m
                        -- ^ the activity container
                        -> ResultSource m
activityResultSource :: forall (m :: * -> *) s a b.
(MonadDES m, Show s, ResultItemable (ResultValue s)) =>
ResultContainer (Activity m s a b) m -> ResultSource m
activityResultSource ResultContainer (Activity m s a b) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Activity m s a b) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Activity m s a b) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ActivityId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Activity m s a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) s a b.
MonadDES m =>
ResultContainer (Activity m s a b) m -> ResultSource m
activityResultSummary ResultContainer (Activity m s a b) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer (Activity m s a b) m
c ResultName
"initState" ResultId
ActivityInitStateId forall (m :: * -> *) s a b. Activity m s a b -> s
activityInitState,
      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 (Activity m s a b) m
c ResultName
"state" ResultId
ActivityStateId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m s
activityState forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityStateChanged_,
      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 (Activity m s a b) m
c ResultName
"totalUtilisationTime" ResultId
ActivityTotalUtilisationTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityTotalUtilisationTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityTotalUtilisationTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"totalIdleTime" ResultId
ActivityTotalIdleTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityTotalIdleTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityTotalIdleTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"totalPreemptionTime" ResultId
ActivityTotalPreemptionTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityTotalPreemptionTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityTotalPreemptionTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"utilisationTime" ResultId
ActivityUtilisationTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityUtilisationTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityUtilisationTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"idleTime" ResultId
ActivityIdleTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityIdleTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityIdleTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"preemptionTime" ResultId
ActivityPreemptionTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityPreemptionTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityPreemptionTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"utilisationFactor" ResultId
ActivityUtilisationFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityUtilisationFactor forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityUtilisationFactorChanged_,
      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 (Activity m s a b) m
c ResultName
"idleFactor" ResultId
ActivityIdleFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityIdleFactor forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityIdleFactorChanged_,
      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 (Activity m s a b) m
c ResultName
"preemptionFactor" ResultId
ActivityPreemptionFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityPreemptionFactor forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityPreemptionFactorChanged_ ] }

-- | Return a summary by the specified activity.
activityResultSummary :: MonadDES m
                         => ResultContainer (Activity m s a b) m
                         -- ^ the activity container
                         -> ResultSource m
activityResultSummary :: forall (m :: * -> *) s a b.
MonadDES m =>
ResultContainer (Activity m s a b) m -> ResultSource m
activityResultSummary ResultContainer (Activity m s a b) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Activity m s a b) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Activity m s a b) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ActivityId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Activity m s a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) s a b.
MonadDES m =>
ResultContainer (Activity m s a b) m -> ResultSource m
activityResultSummary ResultContainer (Activity m s a b) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (Activity m s a b) m
c ResultName
"utilisationTime" ResultId
ActivityUtilisationTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityUtilisationTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityUtilisationTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"idleTime" ResultId
ActivityIdleTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityIdleTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityIdleTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"preemptionTime" ResultId
ActivityPreemptionTimeId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityPreemptionTime forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityPreemptionTimeChanged_,
      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 (Activity m s a b) m
c ResultName
"utilisationFactor" ResultId
ActivityUtilisationFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityUtilisationFactor forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityUtilisationFactorChanged_,
      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 (Activity m s a b) m
c ResultName
"idleFactor" ResultId
ActivityIdleFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityIdleFactor forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityIdleFactorChanged_,
      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 (Activity m s a b) m
c ResultName
"preemptionFactor" ResultId
ActivityPreemptionFactorId forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityPreemptionFactor forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityPreemptionFactorChanged_ ] }

-- | Return a source by the specified resource.
resourceResultSource :: (MonadDES m,
                         Show s, ResultItemable (ResultValue s))
                        => ResultContainer (Resource m s) m
                        -- ^ the resource container
                        -> ResultSource m
resourceResultSource :: forall (m :: * -> *) s.
(MonadDES m, Show s, ResultItemable (ResultValue s)) =>
ResultContainer (Resource m s) m -> ResultSource m
resourceResultSource ResultContainer (Resource m s) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Resource m s) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Resource m s) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ResourceId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Resource m s) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) s.
MonadDES m =>
ResultContainer (Resource m s) m -> ResultSource m
resourceResultSummary ResultContainer (Resource m s) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (Resource m s) m
c ResultName
"queueCount" ResultId
ResourceQueueCountId forall (m :: * -> *) s. MonadDES m => Resource m s -> Event m Int
resourceQueueCount forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceQueueCountChanged_,
      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 (Resource m s) m
c ResultName
"queueCountStats" ResultId
ResourceQueueCountStatsId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceQueueCountStats forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceQueueCountChanged_,
      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 (Resource m s) m
c ResultName
"totalWaitTime" ResultId
ResourceTotalWaitTimeId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m Double
resourceTotalWaitTime forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceWaitTimeChanged_,
      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 (Resource m s) m
c ResultName
"waitTime" ResultId
ResourceWaitTimeId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (SamplingStats Double)
resourceWaitTime forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceWaitTimeChanged_,
      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 (Resource m s) m
c ResultName
"count" ResultId
ResourceCountId forall (m :: * -> *) s. MonadDES m => Resource m s -> Event m Int
resourceCount forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceCountChanged_,
      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 (Resource m s) m
c ResultName
"countStats" ResultId
ResourceCountStatsId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceCountStats forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceCountChanged_,
      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 (Resource m s) m
c ResultName
"utilisationCount" ResultId
ResourceUtilisationCountId forall (m :: * -> *) s. MonadDES m => Resource m s -> Event m Int
resourceUtilisationCount forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceUtilisationCountChanged_,
      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 (Resource m s) m
c ResultName
"utilisationCountStats" ResultId
ResourceUtilisationCountStatsId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceUtilisationCountStats forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceUtilisationCountChanged_ ] }

-- | Return a summary by the specified resource.
resourceResultSummary :: MonadDES m
                         => ResultContainer (Resource m s) m
                         -- ^ the resource container
                         -> ResultSource m
resourceResultSummary :: forall (m :: * -> *) s.
MonadDES m =>
ResultContainer (Resource m s) m -> ResultSource m
resourceResultSummary ResultContainer (Resource m s) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Resource m s) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Resource m s) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ResourceId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Resource m s) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) s.
MonadDES m =>
ResultContainer (Resource m s) m -> ResultSource m
resourceResultSummary ResultContainer (Resource m s) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (Resource m s) m
c ResultName
"queueCountStats" ResultId
ResourceQueueCountStatsId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceQueueCountStats forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceQueueCountChanged_,
      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 (Resource m s) m
c ResultName
"waitTime" ResultId
ResourceWaitTimeId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (SamplingStats Double)
resourceWaitTime forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceWaitTimeChanged_,
      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 (Resource m s) m
c ResultName
"countStats" ResultId
ResourceCountStatsId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceCountStats forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceCountChanged_,
      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 (Resource m s) m
c ResultName
"utilisationCountStats" ResultId
ResourceUtilisationCountStatsId forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceUtilisationCountStats forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceUtilisationCountChanged_ ] }

-- | Return a source by the specified resource.
preemptibleResourceResultSource :: PR.MonadResource m
                                   => ResultContainer (PR.Resource m) m
                                   -- ^ the resource container
                                   -> ResultSource m
preemptibleResourceResultSource :: forall (m :: * -> *).
MonadResource m =>
ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSource ResultContainer (Resource m) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Resource m) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Resource m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ResourceId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Resource m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *).
MonadResource m =>
ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSummary ResultContainer (Resource m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (Resource m) m
c ResultName
"queueCount" ResultId
ResourceQueueCountId forall (m :: * -> *). MonadResource m => Resource m -> Event m Int
PR.resourceQueueCount forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceQueueCountChanged_,
      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 (Resource m) m
c ResultName
"queueCountStats" ResultId
ResourceQueueCountStatsId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceQueueCountStats forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceQueueCountChanged_,
      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 (Resource m) m
c ResultName
"totalWaitTime" ResultId
ResourceTotalWaitTimeId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m Double
PR.resourceTotalWaitTime forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceWaitTimeChanged_,
      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 (Resource m) m
c ResultName
"waitTime" ResultId
ResourceWaitTimeId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (SamplingStats Double)
PR.resourceWaitTime forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceWaitTimeChanged_,
      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 (Resource m) m
c ResultName
"count" ResultId
ResourceCountId forall (m :: * -> *). MonadResource m => Resource m -> Event m Int
PR.resourceCount forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceCountChanged_,
      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 (Resource m) m
c ResultName
"countStats" ResultId
ResourceCountStatsId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceCountStats forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceCountChanged_,
      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 (Resource m) m
c ResultName
"utilisationCount" ResultId
ResourceUtilisationCountId forall (m :: * -> *). MonadResource m => Resource m -> Event m Int
PR.resourceUtilisationCount forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceUtilisationCountChanged_,
      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 (Resource m) m
c ResultName
"utilisationCountStats" ResultId
ResourceUtilisationCountStatsId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceUtilisationCountStats forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceUtilisationCountChanged_ ] }

-- | Return a summary by the specified resource.
preemptibleResourceResultSummary :: PR.MonadResource m
                                    => ResultContainer (PR.Resource m) m
                                    -- ^ the resource container
                                    -> ResultSource m
preemptibleResourceResultSummary :: forall (m :: * -> *).
MonadResource m =>
ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSummary ResultContainer (Resource m) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Resource m) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Resource m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ResourceId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Resource m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *).
MonadResource m =>
ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSummary ResultContainer (Resource m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (Resource m) m
c ResultName
"queueCountStats" ResultId
ResourceQueueCountStatsId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceQueueCountStats forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceQueueCountChanged_,
      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 (Resource m) m
c ResultName
"waitTime" ResultId
ResourceWaitTimeId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (SamplingStats Double)
PR.resourceWaitTime forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceWaitTimeChanged_,
      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 (Resource m) m
c ResultName
"countStats" ResultId
ResourceCountStatsId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceCountStats forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceCountChanged_,
      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 (Resource m) m
c ResultName
"utilisationCountStats" ResultId
ResourceUtilisationCountStatsId forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceUtilisationCountStats forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceUtilisationCountChanged_ ] }

-- | Return a source by the specified operation.
operationResultSource :: MonadDES m
                         => ResultContainer (Operation m a b) m
                         -- ^ the operation container
                         -> ResultSource m
operationResultSource :: forall (m :: * -> *) a b.
MonadDES m =>
ResultContainer (Operation m a b) m -> ResultSource m
operationResultSource ResultContainer (Operation m a b) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Operation m a b) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Operation m a b) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
OperationId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Operation m a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) a b.
MonadDES m =>
ResultContainer (Operation m a b) m -> ResultSource m
operationResultSummary ResultContainer (Operation m a b) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (Operation m a b) m
c ResultName
"totalUtilisationTime" ResultId
OperationTotalUtilisationTimeId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationTotalUtilisationTime forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationTotalUtilisationTimeChanged_,
      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 (Operation m a b) m
c ResultName
"totalPreemptionTime" ResultId
OperationTotalPreemptionTimeId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationTotalPreemptionTime forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationTotalPreemptionTimeChanged_,
      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 (Operation m a b) m
c ResultName
"utilisationTime" ResultId
OperationUtilisationTimeId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m (SamplingStats Double)
operationUtilisationTime forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationUtilisationTimeChanged_,
      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 (Operation m a b) m
c ResultName
"preemptionTime" ResultId
OperationPreemptionTimeId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m (SamplingStats Double)
operationPreemptionTime forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationPreemptionTimeChanged_,
      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 (Operation m a b) m
c ResultName
"utilisationFactor" ResultId
OperationUtilisationFactorId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationUtilisationFactor forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationUtilisationFactorChanged_,
      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 (Operation m a b) m
c ResultName
"preemptionFactor" ResultId
OperationPreemptionFactorId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationPreemptionFactor forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationPreemptionFactorChanged_ ] }

-- | Return a summary by the specified operation.
operationResultSummary :: MonadDES m
                          => ResultContainer (Operation m a b) m
                          -- ^ the operation container
                          -> ResultSource m
operationResultSummary :: forall (m :: * -> *) a b.
MonadDES m =>
ResultContainer (Operation m a b) m -> ResultSource m
operationResultSummary ResultContainer (Operation m a b) m
c =
  forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource forall a b. (a -> b) -> a -> b
$
  ResultObject {
    resultObjectName :: ResultName
resultObjectName = forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Operation m a b) m
c,
    resultObjectId :: ResultId
resultObjectId = forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Operation m a b) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
OperationId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Operation m a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = forall (m :: * -> *) a b.
MonadDES m =>
ResultContainer (Operation m a b) m -> ResultSource m
operationResultSummary ResultContainer (Operation m a b) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      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 (Operation m a b) m
c ResultName
"utilisationTime" ResultId
OperationUtilisationTimeId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m (SamplingStats Double)
operationUtilisationTime forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationUtilisationTimeChanged_,
      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 (Operation m a b) m
c ResultName
"preemptionTime" ResultId
OperationPreemptionTimeId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m (SamplingStats Double)
operationPreemptionTime forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationPreemptionTimeChanged_,
      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 (Operation m a b) m
c ResultName
"utilisationFactor" ResultId
OperationUtilisationFactorId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationUtilisationFactor forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationUtilisationFactorChanged_,
      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 (Operation m a b) m
c ResultName
"preemptionFactor" ResultId
OperationPreemptionFactorId forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationPreemptionFactor forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationPreemptionFactorChanged_ ] }

-- | Return an arbitrary text as a separator source.
textResultSource :: String -> ResultSource m
textResultSource :: forall (m :: * -> *). ResultName -> ResultSource m
textResultSource ResultName
text =
  forall (m :: * -> *). ResultSeparator -> ResultSource m
ResultSeparatorSource forall a b. (a -> b) -> a -> b
$
  ResultSeparator { resultSeparatorText :: ResultName
resultSeparatorText = ResultName
text }

-- | Return the source of the modeling time.
timeResultSource :: MonadDES m => ResultSource m
timeResultSource :: forall (m :: * -> *). MonadDES m => ResultSource m
timeResultSource = forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
"t" [ResultName
"t"] ResultId
TimeId [ResultId
TimeId] forall (m :: * -> *). Monad m => Dynamics m Double
time
                         
-- | Make an integer subscript
intSubscript :: Int -> ResultName
intSubscript :: Int -> ResultName
intSubscript Int
i = ResultName
"[" forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> ResultName
show Int
i forall a. [a] -> [a] -> [a]
++ ResultName
"]"

instance {-# OVERLAPPABLE #-} (MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (Parameter m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m a
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m a
m

instance {-# OVERLAPPABLE #-} (MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (Simulation m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m a
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m a
m

instance {-# OVERLAPPABLE #-} (MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (Dynamics m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m a
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m a
m

instance {-# OVERLAPPABLE #-} (MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (Event m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m a
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m a
m

instance {-# OVERLAPPABLE #-} (MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (Ref m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m a
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m a
m

instance {-# OVERLAPPABLE #-} (MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (B.Ref m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m a
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m a
m

instance {-# OVERLAPPABLE #-} (MonadDES m, MonadVar m, ResultItemable (ResultValue a)) => ResultProvider (Var m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m a
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m a
m

instance {-# OVERLAPPABLE #-} (MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (Signalable m a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m a
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m a
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultProvider (Parameter m (SamplingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m (SamplingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m (SamplingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m (SamplingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultProvider (Simulation m (SamplingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m (SamplingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m (SamplingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m (SamplingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultProvider (Dynamics m (SamplingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m (SamplingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m (SamplingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m (SamplingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultProvider (Event m (SamplingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m (SamplingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m (SamplingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m (SamplingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultProvider (Ref m (SamplingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (SamplingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (SamplingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (SamplingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultProvider (B.Ref m (SamplingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (SamplingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (SamplingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (SamplingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              MonadVar m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultProvider (Var m (SamplingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m (SamplingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m (SamplingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m (SamplingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (SamplingStats a)))
                             => ResultProvider (Signalable m (SamplingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m (SamplingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m (SamplingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m (SamplingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultProvider (Parameter m (TimingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m (TimingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m (TimingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m (TimingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultProvider (Simulation m (TimingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m (TimingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m (TimingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m (TimingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultProvider (Dynamics m (TimingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m (TimingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m (TimingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m (TimingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultProvider (Event m (TimingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m (TimingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m (TimingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m (TimingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultProvider (Ref m (TimingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (TimingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (TimingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (TimingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultProvider (B.Ref m (TimingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (TimingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (TimingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (TimingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              MonadVar m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultProvider (Var m (TimingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m (TimingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m (TimingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m (TimingCounter a)
m

instance {-# OVERLAPPING #-} (MonadDES m,
                              ResultItemable (ResultValue a),
                              ResultItemable (ResultValue (TimingStats a)))
                             => ResultProvider (Signalable m (TimingCounter a)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m (TimingCounter a)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m (TimingCounter a)
m =
    forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m (TimingCounter a)
m

instance ResultProvider p m => ResultProvider [p] m where

  resultSource' :: ResultName
-> [ResultName] -> ResultId -> [ResultId] -> [p] -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is [p]
m =
    forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is forall a b. (a -> b) -> a -> b
$ forall p. [p] -> [ResultName] -> ResultListWithSubscript p
ResultListWithSubscript [p]
m [ResultName]
subscript where
      subscript :: [ResultName]
subscript = forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd forall a b. (a -> b) -> a -> b
$ forall a b. [a] -> [b] -> [(a, b)]
zip [p]
m forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Int -> ResultName
intSubscript [Int
0..]

instance (Show i, Ix i, ResultProvider p m) => ResultProvider (A.Array i p) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Array i p
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Array i p
m =
    forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is forall a b. (a -> b) -> a -> b
$ forall p. [p] -> [ResultName] -> ResultListWithSubscript p
ResultListWithSubscript [p]
items [ResultName]
subscript where
      items :: [p]
items = forall i e. Array i e -> [e]
A.elems Array i p
m
      subscript :: [ResultName]
subscript = forall a b. (a -> b) -> [a] -> [b]
map (\i
i -> ResultName
"[" forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> ResultName
show i
i forall a. [a] -> [a] -> [a]
++ ResultName
"]") (forall i e. Ix i => Array i e -> [i]
A.indices Array i p
m)

instance ResultProvider p m => ResultProvider (V.Vector p) m where
  
  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Vector p
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Vector p
m =
    forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is forall a b. (a -> b) -> a -> b
$ forall p.
Vector p -> Vector ResultName -> ResultVectorWithSubscript p
ResultVectorWithSubscript Vector p
m Vector ResultName
subscript where
      subscript :: Vector ResultName
subscript = forall a b. (Int -> a -> b) -> Vector a -> Vector b
V.imap (\Int
i p
x -> Int -> ResultName
intSubscript Int
i) Vector p
m

-- | Represents a list with the specified subscript.
data ResultListWithSubscript p =
  ResultListWithSubscript [p] [String]

-- | Represents an array with the specified subscript.
data ResultArrayWithSubscript i p =
  ResultArrayWithSubscript (A.Array i p) (A.Array i String)

-- | Represents a vector with the specified subscript.
data ResultVectorWithSubscript p =
  ResultVectorWithSubscript (V.Vector p) (V.Vector String)

instance ResultProvider p m => ResultProvider (ResultListWithSubscript p) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultListWithSubscript p
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is (ResultListWithSubscript [p]
xs [ResultName]
ys) =
    forall (m :: * -> *). ResultVector m -> ResultSource m
ResultVectorSource forall a b. (a -> b) -> a -> b
$
    forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSignal forall a b. (a -> b) -> a -> b
$
    forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSummary forall a b. (a -> b) -> a -> b
$
    ResultVector { resultVectorName :: ResultName
resultVectorName = ResultName
name,
                   resultVectorId :: ResultId
resultVectorId = ResultId
i,
                   resultVectorItems :: Array Int (ResultSource m)
resultVectorItems = Array Int (ResultSource m)
axs,
                   resultVectorSubscript :: Array Int ResultName
resultVectorSubscript = Array Int ResultName
ays,
                   resultVectorSignal :: ResultSignal m
resultVectorSignal = forall a. HasCallStack => a
undefined,
                   resultVectorSummary :: ResultSource m
resultVectorSummary = forall a. HasCallStack => a
undefined }
    where
      bnds :: (Int, Int)
bnds   = (Int
0, forall (t :: * -> *) a. Foldable t => t a -> Int
length [p]
xs forall a. Num a => a -> a -> a
- Int
1)
      axs :: Array Int (ResultSource m)
axs    = forall i e. Ix i => (i, i) -> [e] -> Array i e
A.listArray (Int, Int)
bnds [ResultSource m]
items
      ays :: Array Int ResultName
ays    = forall i e. Ix i => (i, i) -> [e] -> Array i e
A.listArray (Int, Int)
bnds [ResultName]
ys
      items :: [ResultSource m]
items  =
        forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a b. (a -> b) -> [a] -> [b]
map (forall a b. [a] -> [b] -> [(a, b)]
zip [ResultName]
ys [p]
xs) forall a b. (a -> b) -> a -> b
$ \(ResultName
y, p
x) ->
        let name' :: ResultName
name'  = ResultName
name forall a. [a] -> [a] -> [a]
++ ResultName
y
            names' :: [ResultName]
names' = [ResultName]
names forall a. [a] -> [a] -> [a]
++ [ResultName
y]
            i' :: ResultId
i'  = ResultName -> ResultId
VectorItemId ResultName
y
            is' :: [ResultId]
is' = [ResultId]
is forall a. [a] -> [a] -> [a]
++ [ResultId
i']
        in forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name' [ResultName]
names' ResultId
i' [ResultId]
is' p
x
      items' :: [ResultSource m]
items' = forall a b. (a -> b) -> [a] -> [b]
map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
resultSourceSummary [ResultSource m]
items

instance (Show i, Ix i, ResultProvider p m) => ResultProvider (ResultArrayWithSubscript i p) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultArrayWithSubscript i p
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is (ResultArrayWithSubscript Array i p
xs Array i ResultName
ys) =
    forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is forall a b. (a -> b) -> a -> b
$ forall p. [p] -> [ResultName] -> ResultListWithSubscript p
ResultListWithSubscript [p]
items [ResultName]
subscript where
      items :: [p]
items = forall i e. Array i e -> [e]
A.elems Array i p
xs
      subscript :: [ResultName]
subscript = forall i e. Array i e -> [e]
A.elems Array i ResultName
ys

instance ResultProvider p m => ResultProvider (ResultVectorWithSubscript p) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultVectorWithSubscript p
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is (ResultVectorWithSubscript Vector p
xs Vector ResultName
ys) =
    forall (m :: * -> *). ResultVector m -> ResultSource m
ResultVectorSource forall a b. (a -> b) -> a -> b
$
    forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSignal forall a b. (a -> b) -> a -> b
$
    forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSummary forall a b. (a -> b) -> a -> b
$
    ResultVector { resultVectorName :: ResultName
resultVectorName = ResultName
name,
                   resultVectorId :: ResultId
resultVectorId = ResultId
i,
                   resultVectorItems :: Array Int (ResultSource m)
resultVectorItems = Array Int (ResultSource m)
axs,
                   resultVectorSubscript :: Array Int ResultName
resultVectorSubscript = Array Int ResultName
ays,
                   resultVectorSignal :: ResultSignal m
resultVectorSignal = forall a. HasCallStack => a
undefined,
                   resultVectorSummary :: ResultSource m
resultVectorSummary = forall a. HasCallStack => a
undefined }
    where
      bnds :: (Int, Int)
bnds   = (Int
0, forall a. Vector a -> Int
V.length Vector p
xs forall a. Num a => a -> a -> a
- Int
1)
      axs :: Array Int (ResultSource m)
axs    = forall i e. Ix i => (i, i) -> [e] -> Array i e
A.listArray (Int, Int)
bnds (forall a. Vector a -> [a]
V.toList Vector (ResultSource m)
items)
      ays :: Array Int ResultName
ays    = forall i e. Ix i => (i, i) -> [e] -> Array i e
A.listArray (Int, Int)
bnds (forall a. Vector a -> [a]
V.toList Vector ResultName
ys)
      items :: Vector (ResultSource m)
items =
        forall a. Int -> (Int -> a) -> Vector a
V.generate (forall a. Vector a -> Int
V.length Vector p
xs) forall a b. (a -> b) -> a -> b
$ \Int
i ->
        let x :: p
x = Vector p
xs forall a. Vector a -> Int -> a
V.! Int
i
            y :: ResultName
y = Vector ResultName
ys forall a. Vector a -> Int -> a
V.! Int
i
            name' :: ResultName
name'  = ResultName
name forall a. [a] -> [a] -> [a]
++ ResultName
y
            names' :: [ResultName]
names' = [ResultName]
names forall a. [a] -> [a] -> [a]
++ [ResultName
y]
            i' :: ResultId
i'  = ResultName -> ResultId
VectorItemId ResultName
y
            is' :: [ResultId]
is' = [ResultId]
is forall a. [a] -> [a] -> [a]
++ [ResultId
i']
        in forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name' [ResultName]
names' ResultId
i' [ResultId]
is' p
x
      items' :: Vector (ResultSource m)
items' = forall a b. (a -> b) -> Vector a -> Vector b
V.map forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
resultSourceSummary Vector (ResultSource m)
items

instance {-# OVERLAPPING #-} (Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Parameter m (A.Array i e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m (Array i e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m (Array i e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m (Array i e)
m

instance {-# OVERLAPPING #-} (Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Simulation m (A.Array i e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m (Array i e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m (Array i e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m (Array i e)
m

instance {-# OVERLAPPING #-} (Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Dynamics m (A.Array i e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m (Array i e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m (Array i e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m (Array i e)
m

instance {-# OVERLAPPING #-} (Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Event m (A.Array i e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m (Array i e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m (Array i e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m (Array i e)
m

instance {-# OVERLAPPING #-} (Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Ref m (A.Array i e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (Array i e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (Array i e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (Array i e)
m

instance {-# OVERLAPPING #-} (Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (B.Ref m (A.Array i e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (Array i e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (Array i e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (Array i e)
m

instance {-# OVERLAPPING #-} (Ix i, Show i, MonadDES m, MonadVar m, ResultItemable (ResultValue [e])) => ResultProvider (Var m (A.Array i e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m (Array i e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m (Array i e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m (Array i e)
m

instance {-# OVERLAPPING #-} (Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Signalable m (A.Array i e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m (Array i e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m (Array i e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall i e. Array i e -> [e]
A.elems forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m (Array i e)
m

instance {-# OVERLAPPING #-} (MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Parameter m (V.Vector e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m (Vector e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m (Vector e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Vector a -> [a]
V.toList forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Parameter m (Vector e)
m

instance {-# OVERLAPPING #-} (MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Simulation m (V.Vector e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m (Vector e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m (Vector e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Vector a -> [a]
V.toList forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Simulation m (Vector e)
m

instance {-# OVERLAPPING #-} (MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Dynamics m (V.Vector e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m (Vector e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m (Vector e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Vector a -> [a]
V.toList forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Dynamics m (Vector e)
m

instance {-# OVERLAPPING #-} (MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Event m (V.Vector e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m (Vector e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m (Vector e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Vector a -> [a]
V.toList forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Event m (Vector e)
m

instance {-# OVERLAPPING #-} (MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Ref m (V.Vector e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (Vector e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (Vector e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Vector a -> [a]
V.toList forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (Vector e)
m

instance {-# OVERLAPPING #-} (MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (B.Ref m (V.Vector e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (Vector e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (Vector e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Vector a -> [a]
V.toList forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Ref m (Vector e)
m

instance {-# OVERLAPPING #-} (MonadDES m, MonadVar m, ResultItemable (ResultValue [e])) => ResultProvider (Var m (V.Vector e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m (Vector e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m (Vector e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Vector a -> [a]
V.toList forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Var m (Vector e)
m

instance {-# OVERLAPPING #-} (MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Signalable m (V.Vector e)) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m (Vector e)
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m (Vector e)
m =
    forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue forall a. Vector a -> [a]
V.toList forall a b. (a -> b) -> a -> b
$ forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is Signalable m (Vector e)
m

instance (MonadDES m,
          Show si, Show sm, Show so,
          ResultItemable (ResultValue si),
          ResultItemable (ResultValue sm),
          ResultItemable (ResultValue so))
         => ResultProvider (Q.Queue m si sm so a) m where

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

instance (MonadDES m,
          Show sm, Show so,
          ResultItemable (ResultValue sm),
          ResultItemable (ResultValue so))
         => ResultProvider (IQ.Queue m sm so a) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Queue m sm so a
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Queue m sm so a
m =
    forall (m :: * -> *) sm so a.
(MonadDES m, Show sm, Show so, ResultItemable (ResultValue sm),
 ResultItemable (ResultValue so)) =>
ResultContainer (Queue m sm so a) m -> ResultSource m
infiniteQueueResultSource forall a b. (a -> b) -> a -> b
$ forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Queue m sm so a
m (forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueChanged_ Queue m sm so a
m)

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

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

instance (MonadDES m, Show s, ResultItemable (ResultValue s)) => ResultProvider (Server m s a b) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Server m s a b
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Server m s a b
m =
    forall (m :: * -> *) s a b.
(MonadDES m, Show s, ResultItemable (ResultValue s)) =>
ResultContainer (Server m s a b) m -> ResultSource m
serverResultSource forall a b. (a -> b) -> a -> b
$ forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Server m s a b
m (forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverChanged_ Server m s a b
m)

instance (MonadDES m, Show s, ResultItemable (ResultValue s)) => ResultProvider (Activity m s a b) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Activity m s a b
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Activity m s a b
m =
    forall (m :: * -> *) s a b.
(MonadDES m, Show s, ResultItemable (ResultValue s)) =>
ResultContainer (Activity m s a b) m -> ResultSource m
activityResultSource forall a b. (a -> b) -> a -> b
$ forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Activity m s a b
m (forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityChanged_ Activity m s a b
m)

instance (MonadDES m, Show s, ResultItemable (ResultValue s)) => ResultProvider (Resource m s) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Resource m s
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Resource m s
m =
    forall (m :: * -> *) s.
(MonadDES m, Show s, ResultItemable (ResultValue s)) =>
ResultContainer (Resource m s) m -> ResultSource m
resourceResultSource forall a b. (a -> b) -> a -> b
$ forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Resource m s
m (forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceChanged_ Resource m s
m)

instance PR.MonadResource m => ResultProvider (PR.Resource m) m where

  resultSource' :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Resource m
-> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is Resource m
m =
    forall (m :: * -> *).
MonadResource m =>
ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSource forall a b. (a -> b) -> a -> b
$ forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Resource m
m (forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceChanged_ Resource m
m)

instance MonadDES m => ResultProvider (Operation m a b) m where

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