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

-- |
-- 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 = ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
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 (UserDefinedResult -> ResultId) -> UserDefinedResult -> ResultId
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 = ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
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 (UserDefinedResult -> ResultId) -> UserDefinedResult -> ResultId
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 :: 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 -> ResultValue (Either Int (SamplingStats Int)) m
-> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
forall a. a -> Maybe a
Just (ResultValue (Either Int (SamplingStats Int)) m
 -> Maybe (ResultValue (Either Int (SamplingStats Int)) m))
-> ResultValue (Either Int (SamplingStats Int)) m
-> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
forall a b. (a -> b) -> a -> b
$ (Int -> Either Int (SamplingStats Int))
-> ResultValue Int m
-> ResultValue (Either Int (SamplingStats Int)) m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Int -> Either Int (SamplingStats Int)
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 -> ResultValue (Either Int (SamplingStats Int)) m
-> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
forall a. a -> Maybe a
Just (ResultValue (Either Int (SamplingStats Int)) m
 -> Maybe (ResultValue (Either Int (SamplingStats Int)) m))
-> ResultValue (Either Int (SamplingStats Int)) m
-> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
forall a b. (a -> b) -> a -> b
$ (SamplingStats Int -> Either Int (SamplingStats Int))
-> ResultValue (SamplingStats Int) m
-> ResultValue (Either Int (SamplingStats Int)) m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue SamplingStats Int -> Either Int (SamplingStats Int)
forall a b. b -> Either a b
Right ResultValue (SamplingStats Int) m
a2
        Maybe (ResultValue (SamplingStats Int) m)
Nothing -> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
forall a. Maybe a
Nothing
  where
    x1 :: Maybe (ResultValue Int m)
x1 = a m -> Maybe (ResultValue Int m)
forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue Int m)
resultItemAsIntValue a m
x
    x2 :: Maybe (ResultValue (SamplingStats Int) m)
x2 = a m -> Maybe (ResultValue (SamplingStats Int) m)
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 :: 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 -> ResultValue (Either Double (SamplingStats Double)) m
-> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
forall a. a -> Maybe a
Just (ResultValue (Either Double (SamplingStats Double)) m
 -> Maybe (ResultValue (Either Double (SamplingStats Double)) m))
-> ResultValue (Either Double (SamplingStats Double)) m
-> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
forall a b. (a -> b) -> a -> b
$ (Double -> Either Double (SamplingStats Double))
-> ResultValue Double m
-> ResultValue (Either Double (SamplingStats Double)) m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Double -> Either Double (SamplingStats Double)
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 -> ResultValue (Either Double (SamplingStats Double)) m
-> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
forall a. a -> Maybe a
Just (ResultValue (Either Double (SamplingStats Double)) m
 -> Maybe (ResultValue (Either Double (SamplingStats Double)) m))
-> ResultValue (Either Double (SamplingStats Double)) m
-> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
forall a b. (a -> b) -> a -> b
$ (SamplingStats Double -> Either Double (SamplingStats Double))
-> ResultValue (SamplingStats Double) m
-> ResultValue (Either Double (SamplingStats Double)) m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue SamplingStats Double -> Either Double (SamplingStats Double)
forall a b. b -> Either a b
Right ResultValue (SamplingStats Double) m
a2
        Maybe (ResultValue (SamplingStats Double) m)
Nothing -> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
forall a. Maybe a
Nothing
  where
    x1 :: Maybe (ResultValue Double m)
x1 = a m -> Maybe (ResultValue Double m)
forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> Maybe (ResultValue Double m)
resultItemAsDoubleValue a m
x
    x2 :: Maybe (ResultValue (SamplingStats Double) m)
x2 = a m -> Maybe (ResultValue (SamplingStats Double) m)
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 :: a m -> ResultValue Int m
resultItemToIntValue a m
x =
  case a m -> Maybe (ResultValue Int m)
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 ->
      ResultName -> ResultValue Int m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue Int m)
-> ResultName -> ResultValue Int m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue [Int] m
resultItemToIntListValue a m
x =
  case a m -> Maybe (ResultValue [Int] m)
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 ->
      ResultName -> ResultValue [Int] m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue [Int] m)
-> ResultName -> ResultValue [Int] m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue (SamplingStats Int) m
resultItemToIntStatsValue a m
x =
  case a m -> Maybe (ResultValue (SamplingStats Int) m)
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 ->
      ResultName -> ResultValue (SamplingStats Int) m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue (SamplingStats Int) m)
-> ResultName -> ResultValue (SamplingStats Int) m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue (Either Int (SamplingStats Int)) m
resultItemToIntStatsEitherValue a m
x =
  case a m -> Maybe (ResultValue (Either Int (SamplingStats Int)) m)
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 ->
      ResultName -> ResultValue (Either Int (SamplingStats Int)) m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue (Either Int (SamplingStats Int)) m)
-> ResultName -> ResultValue (Either Int (SamplingStats Int)) m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue (TimingStats Int) m
resultItemToIntTimingStatsValue a m
x =
  case a m -> Maybe (ResultValue (TimingStats Int) m)
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 ->
      ResultName -> ResultValue (TimingStats Int) m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue (TimingStats Int) m)
-> ResultName -> ResultValue (TimingStats Int) m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue Double m
resultItemToDoubleValue a m
x =
  case a m -> Maybe (ResultValue Double m)
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 ->
      ResultName -> ResultValue Double m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue Double m)
-> ResultName -> ResultValue Double m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue [Double] m
resultItemToDoubleListValue a m
x =
  case a m -> Maybe (ResultValue [Double] m)
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 ->
      ResultName -> ResultValue [Double] m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue [Double] m)
-> ResultName -> ResultValue [Double] m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue (SamplingStats Double) m
resultItemToDoubleStatsValue a m
x =
  case a m -> Maybe (ResultValue (SamplingStats Double) m)
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 ->
      ResultName -> ResultValue (SamplingStats Double) m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue (SamplingStats Double) m)
-> ResultName -> ResultValue (SamplingStats Double) m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue (Either Double (SamplingStats Double)) m
resultItemToDoubleStatsEitherValue a m
x =
  case a m -> Maybe (ResultValue (Either Double (SamplingStats Double)) m)
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 ->
      ResultName -> ResultValue (Either Double (SamplingStats Double)) m
forall a. HasCallStack => ResultName -> a
error (ResultName
 -> ResultValue (Either Double (SamplingStats Double)) m)
-> ResultName
-> ResultValue (Either Double (SamplingStats Double)) m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue (TimingStats Double) m
resultItemToDoubleTimingStatsValue a m
x =
  case a m -> Maybe (ResultValue (TimingStats Double) m)
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 ->
      ResultName -> ResultValue (TimingStats Double) m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue (TimingStats Double) m)
-> ResultName -> ResultValue (TimingStats Double) m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 :: a m -> ResultValue ResultName m
resultItemToStringValue a m
x =
  case a m -> Maybe (ResultValue ResultName m)
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 ->
      ResultName -> ResultValue ResultName m
forall a. HasCallStack => ResultName -> a
error (ResultName -> ResultValue ResultName m)
-> ResultName -> ResultValue ResultName m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Cannot represent " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x ResultName -> ResultName -> ResultName
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 { ResultObject m -> ResultName
resultObjectName :: ResultName,
                 -- ^ The object name.
                 ResultObject m -> ResultId
resultObjectId :: ResultId,
                 -- ^ The object identifier.
                 ResultObject m -> ResultId
resultObjectTypeId :: ResultId,
                 -- ^ The object type identifier.
                 ResultObject m -> [ResultProperty m]
resultObjectProperties :: [ResultProperty m],
                 -- ^ The object properties.
                 ResultObject m -> ResultSignal m
resultObjectSignal :: ResultSignal m,
                 -- ^ A combined signal if present.
                 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 { ResultProperty m -> ResultName
resultPropertyLabel :: ResultName,
                   -- ^ The property short label.
                   ResultProperty m -> ResultId
resultPropertyId :: ResultId,
                   -- ^ The property identifier.
                   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 { ResultVector m -> ResultName
resultVectorName :: ResultName,
                 -- ^ The vector name.
                 ResultVector m -> ResultId
resultVectorId :: ResultId,
                 -- ^ The vector identifier.
                 ResultVector m -> Array Int (ResultSource m)
resultVectorItems :: A.Array Int (ResultSource m),
                 -- ^ The results supplied by the vector items.
                 ResultVector m -> Array Int ResultName
resultVectorSubscript :: A.Array Int ResultName,
                 -- ^ The subscript used as a suffix to create item names.
                 ResultVector m -> ResultSignal m
resultVectorSignal :: ResultSignal m,
                 -- ^ A combined signal if present.
                 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 :: ResultVector m -> ResultVector m
memoResultVectorSignal ResultVector m
x =
  ResultVector m
x { resultVectorSignal :: ResultSignal m
resultVectorSignal =
         (ResultSignal m -> ResultSignal m -> ResultSignal m)
-> ResultSignal m -> [ResultSignal m] -> ResultSignal m
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr ResultSignal m -> ResultSignal m -> ResultSignal m
forall a. Semigroup a => a -> a -> a
(<>) ResultSignal m
forall a. Monoid a => a
mempty ([ResultSignal m] -> ResultSignal m)
-> [ResultSignal m] -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ (ResultSource m -> ResultSignal m)
-> [ResultSource m] -> [ResultSignal m]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> ResultSignal m
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSignal m
resultSourceSignal ([ResultSource m] -> [ResultSignal m])
-> [ResultSource m] -> [ResultSignal m]
forall a b. (a -> b) -> a -> b
$ Array Int (ResultSource m) -> [ResultSource m]
forall i e. Array i e -> [e]
A.elems (Array Int (ResultSource m) -> [ResultSource m])
-> Array Int (ResultSource m) -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$ ResultVector m -> Array Int (ResultSource m)
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 :: ResultVector m -> ResultVector m
memoResultVectorSummary ResultVector m
x =
  ResultVector m
x { resultVectorSummary :: ResultSource m
resultVectorSummary =
         ResultVector m -> ResultSource m
forall (m :: * -> *). ResultVector m -> ResultSource m
ResultVectorSource (ResultVector m -> ResultSource m)
-> ResultVector m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
         ResultVector m
x { resultVectorItems :: Array Int (ResultSource m)
resultVectorItems =
                (Int, Int) -> [(Int, ResultSource m)] -> Array Int (ResultSource m)
forall i e. Ix i => (i, i) -> [(i, e)] -> Array i e
A.array (Int, Int)
bnds [(Int
i, ResultSource m -> ResultSource m
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  = ResultVector m -> Array Int (ResultSource m)
forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
x
    bnds :: (Int, Int)
bnds = Array Int (ResultSource m) -> (Int, Int)
forall i e. Array i e -> (i, i)
A.bounds Array Int (ResultSource m)
arr
    ies :: [(Int, ResultSource m)]
ies  = Array Int (ResultSource m) -> [(Int, ResultSource m)]
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 { ResultValue e m -> ResultName
resultValueName :: ResultName,
                -- ^ The value name.
                ResultValue e m -> [ResultName]
resultValueNamePath :: [ResultName],
                -- ^ The value name path.
                ResultValue e m -> ResultId
resultValueId :: ResultId,
                -- ^ The value identifier.
                ResultValue e m -> [ResultId]
resultValueIdPath :: [ResultId],
                -- ^ The value identifier path.
                ResultValue e m -> ResultData e m
resultValueData :: ResultData e m,
                -- ^ Simulation data supplied by the value.
                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 :: (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 = (a -> b) -> Event m a -> ResultData b m
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f (ResultValue a m -> Event m a
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 :: 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 = ResultData (a -> b) m -> Event m a -> ResultData b m
forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
ap ResultData (a -> b) m
f (ResultValue a m -> Event m a
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 { ResultContainer e m -> ResultName
resultContainerName :: ResultName,
                    -- ^ The container name.
                    ResultContainer e m -> [ResultName]
resultContainerNamePath :: [ResultName],
                    -- ^ The container name path.
                    ResultContainer e m -> ResultId
resultContainerId :: ResultId,
                    -- ^ The container identifier.
                    ResultContainer e m -> [ResultId]
resultContainerIdPath :: [ResultId],
                    -- ^ The container identifier path.
                    ResultContainer e m -> e
resultContainerData :: e,
                    -- ^ The container data.
                    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 :: (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 (ResultContainer a m -> a
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 :: 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 =
  ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultValue b m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue b m -> ResultItem m)
-> ResultValue b m -> ResultItem m
forall a b. (a -> b) -> a -> b
$
  ResultValue :: forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultData e m
-> ResultSignal m
-> ResultValue e m
ResultValue {
    resultValueName :: ResultName
resultValueName   = (ResultContainer a m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer a m
cont) ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultName
"." ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultName
name,
    resultValueNamePath :: [ResultName]
resultValueNamePath = (ResultContainer a m -> [ResultName]
forall e (m :: * -> *). ResultContainer e m -> [ResultName]
resultContainerNamePath ResultContainer a m
cont) [ResultName] -> [ResultName] -> [ResultName]
forall a. [a] -> [a] -> [a]
++ [ResultName
name],
    resultValueId :: ResultId
resultValueId     = ResultId
i,
    resultValueIdPath :: [ResultId]
resultValueIdPath = (ResultContainer a m -> [ResultId]
forall e (m :: * -> *). ResultContainer e m -> [ResultId]
resultContainerIdPath ResultContainer a m
cont) [ResultId] -> [ResultId] -> [ResultId]
forall a. [a] -> [a] -> [a]
++ [ResultId
i],
    resultValueData :: ResultData b m
resultValueData   = a -> ResultData b m
f (ResultContainer a m -> a
forall e (m :: * -> *). ResultContainer e m -> e
resultContainerData ResultContainer a m
cont),
    resultValueSignal :: ResultSignal m
resultValueSignal = a -> ResultSignal m
g (ResultContainer a m -> a
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 :: ResultContainer a m
-> ResultName -> ResultId -> (a -> b) -> ResultProperty m
resultContainerConstProperty ResultContainer a m
cont ResultName
name ResultId
i a -> b
f =
  ResultProperty :: forall (m :: * -> *).
ResultName -> ResultId -> ResultSource m -> ResultProperty m
ResultProperty {
    resultPropertyLabel :: ResultName
resultPropertyLabel = ResultName
name,
    resultPropertyId :: ResultId
resultPropertyId = ResultId
i,
    resultPropertySource :: ResultSource m
resultPropertySource =
      ResultContainer a m
-> ResultName
-> ResultId
-> (a -> ResultData b m)
-> (a -> ResultSignal m)
-> ResultSource m
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 (b -> ResultData b m
forall (m :: * -> *) a. Monad m => a -> m a
return (b -> ResultData b m) -> (a -> b) -> a -> ResultData b m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> b
f) (ResultSignal m -> a -> ResultSignal m
forall a b. a -> b -> a
const ResultSignal m
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 :: 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 :: forall (m :: * -> *).
ResultName -> ResultId -> ResultSource m -> ResultProperty m
ResultProperty {
    resultPropertyLabel :: ResultName
resultPropertyLabel = ResultName
name,
    resultPropertyId :: ResultId
resultPropertyId = ResultId
i,
    resultPropertySource :: ResultSource m
resultPropertySource =
      ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> ResultSignal m)
-> ResultSource m
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 (ResultSignal m -> a -> ResultSignal m
forall a b. a -> b -> a
const ResultSignal m
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 :: 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 :: forall (m :: * -> *).
ResultName -> ResultId -> ResultSource m -> ResultProperty m
ResultProperty {
    resultPropertyLabel :: ResultName
resultPropertyLabel = ResultName
name,
    resultPropertyId :: ResultId
resultPropertyId = ResultId
i,
    resultPropertySource :: ResultSource m
resultPropertySource =
      ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> ResultSignal m)
-> ResultSource m
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 (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m)
-> (a -> Signal m ()) -> a -> ResultSignal m
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 :: 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 :: forall (m :: * -> *).
ResultName -> ResultId -> ResultSource m -> ResultProperty m
ResultProperty {
    resultPropertyLabel :: ResultName
resultPropertyLabel = ResultName
name,
    resultPropertyId :: ResultId
resultPropertyId = ResultId
i,
    resultPropertySource :: ResultSource m
resultPropertySource =
      ResultContainer (ResultData a m) m
-> ResultName
-> ResultId
-> (ResultData a m -> ResultData b m)
-> (ResultData a m -> ResultSignal m)
-> ResultSource m
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 ((a -> b) -> ResultData a m -> ResultData b m
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) (ResultSignal m -> ResultData a m -> ResultSignal m
forall a b. a -> b -> a
const (ResultSignal m -> ResultData a m -> ResultSignal m)
-> ResultSignal m -> ResultData a m -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ ResultContainer (ResultData a m) m -> ResultSignal m
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 :: ResultValue a m -> ResultContainer (ResultData a m) m
resultValueToContainer ResultValue a m
x =
  ResultContainer :: forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer {
    resultContainerName :: ResultName
resultContainerName   = ResultValue a m -> ResultName
forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue a m
x,
    resultContainerNamePath :: [ResultName]
resultContainerNamePath = ResultValue a m -> [ResultName]
forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath ResultValue a m
x,
    resultContainerId :: ResultId
resultContainerId     = ResultValue a m -> ResultId
forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue a m
x,
    resultContainerIdPath :: [ResultId]
resultContainerIdPath = ResultValue a m -> [ResultId]
forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath ResultValue a m
x,
    resultContainerData :: ResultData a m
resultContainerData   = ResultValue a m -> ResultData a m
forall e (m :: * -> *). ResultValue e m -> ResultData e m
resultValueData ResultValue a m
x,
    resultContainerSignal :: ResultSignal m
resultContainerSignal = ResultValue a m -> ResultSignal m
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 :: ResultContainer (ResultData a m) m -> ResultValue a m
resultContainerToValue ResultContainer (ResultData a m) m
x =
  ResultValue :: forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultData e m
-> ResultSignal m
-> ResultValue e m
ResultValue {
    resultValueName :: ResultName
resultValueName   = ResultContainer (ResultData a m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (ResultData a m) m
x,
    resultValueNamePath :: [ResultName]
resultValueNamePath = ResultContainer (ResultData a m) m -> [ResultName]
forall e (m :: * -> *). ResultContainer e m -> [ResultName]
resultContainerNamePath ResultContainer (ResultData a m) m
x,
    resultValueId :: ResultId
resultValueId     = ResultContainer (ResultData a m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (ResultData a m) m
x,
    resultValueIdPath :: [ResultId]
resultValueIdPath = ResultContainer (ResultData a m) m -> [ResultId]
forall e (m :: * -> *). ResultContainer e m -> [ResultId]
resultContainerIdPath ResultContainer (ResultData a m) m
x,
    resultValueData :: ResultData a m
resultValueData   = ResultContainer (ResultData a m) m -> ResultData a m
forall e (m :: * -> *). ResultContainer e m -> e
resultContainerData ResultContainer (ResultData a m) m
x,
    resultValueSignal :: ResultSignal m
resultValueSignal = ResultContainer (ResultData a m) m -> ResultSignal m
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 :: ResultData (TimingStats a -> SamplingStats a) m
normTimingStatsData =
  do Int
n <- Dynamics m Int -> Event m Int
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics Dynamics m Int
forall (m :: * -> *). Monad m => Dynamics m Int
integIteration
     (TimingStats a -> SamplingStats a)
-> ResultData (TimingStats a -> SamplingStats a) m
forall (m :: * -> *) a. Monad m => a -> m a
return ((TimingStats a -> SamplingStats a)
 -> ResultData (TimingStats a -> SamplingStats a) m)
-> (TimingStats a -> SamplingStats a)
-> ResultData (TimingStats a -> SamplingStats a) m
forall a b. (a -> b) -> a -> b
$ Int -> TimingStats a -> SamplingStats a
forall a. TimingData a => Int -> TimingStats a -> SamplingStats a
normTimingStats (Int -> Int
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 = ResultSignal m
forall (m :: * -> *). ResultSignal m
UnknownResultSignal
  (<>) ResultSignal m
UnknownResultSignal ResultSignal m
UnknownResultSignal = ResultSignal m
forall (m :: * -> *). ResultSignal m
UnknownResultSignal
  (<>) ResultSignal m
UnknownResultSignal (ResultSignal Signal m ()
x) = Signal m () -> ResultSignal m
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 = Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix Signal m ()
x
  (<>) (ResultSignal Signal m ()
x) (ResultSignal Signal m ()
y) = Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m ()
x Signal m () -> Signal m () -> Signal m ()
forall a. Semigroup a => a -> a -> a
<> Signal m ()
y)
  (<>) (ResultSignal Signal m ()
x) (ResultSignalMix Signal m ()
y) = Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix (Signal m ()
x Signal m () -> Signal m () -> Signal m ()
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) = Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix (Signal m ()
x Signal m () -> Signal m () -> Signal m ()
forall a. Semigroup a => a -> a -> a
<> Signal m ()
y)
  (<>) (ResultSignalMix Signal m ()
x) (ResultSignalMix Signal m ()
y) = Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignalMix (Signal m ()
x Signal m () -> Signal m () -> Signal m ()
forall a. Semigroup a => a -> a -> a
<> Signal m ()
y)

instance MonadDES m => Monoid (ResultSignal m) where

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

  mappend :: ResultSignal m -> ResultSignal m -> ResultSignal m
mappend = ResultSignal m -> ResultSignal m -> ResultSignal m
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 :: Maybe (Signal m ()) -> ResultSignal m
maybeResultSignal (Just Signal m ()
x) = Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal Signal m ()
x
maybeResultSignal Maybe (Signal m ())
Nothing  = ResultSignal m
forall (m :: * -> *). ResultSignal m
EmptyResultSignal

instance ResultItemable (ResultValue Int) where

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

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

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

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

instance ResultItemable (ResultValue Double) where

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

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

instance ResultItemable (ResultValue [Int]) where

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

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

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

instance ResultItemable (ResultValue [Double]) where

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

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

instance ResultItemable (ResultValue (SamplingStats Int)) where

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

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

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

instance ResultItemable (ResultValue (SamplingStats Double)) where

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

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

instance ResultItemable (ResultValue (TimingStats Int)) where

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

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

  resultItemAsStringValue :: ResultValue (TimingStats Int) m -> Maybe (ResultValue ResultName m)
resultItemAsStringValue = ResultValue ResultName m -> Maybe (ResultValue ResultName m)
forall a. a -> Maybe a
Just (ResultValue ResultName m -> Maybe (ResultValue ResultName m))
-> (ResultValue (TimingStats Int) m -> ResultValue ResultName m)
-> ResultValue (TimingStats Int) m
-> Maybe (ResultValue ResultName m)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (TimingStats Int -> ResultName)
-> ResultValue (TimingStats Int) m -> ResultValue ResultName m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue TimingStats Int -> ResultName
forall a. Show a => a -> ResultName
show
  
  resultItemExpansion :: ResultValue (TimingStats Int) m -> ResultSource m
resultItemExpansion = ResultValue (TimingStats Int) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, TimingData a, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSource
  resultItemSummary :: ResultValue (TimingStats Int) m -> ResultSource m
resultItemSummary = ResultValue (TimingStats Int) m -> ResultSource m
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 :: ResultValue (TimingStats Double) m -> ResultName
resultItemName = ResultValue (TimingStats Double) m -> ResultName
forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName
  resultItemNamePath :: ResultValue (TimingStats Double) m -> [ResultName]
resultItemNamePath = ResultValue (TimingStats Double) m -> [ResultName]
forall e (m :: * -> *). ResultValue e m -> [ResultName]
resultValueNamePath
  resultItemId :: ResultValue (TimingStats Double) m -> ResultId
resultItemId = ResultValue (TimingStats Double) m -> ResultId
forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId
  resultItemIdPath :: ResultValue (TimingStats Double) m -> [ResultId]
resultItemIdPath = ResultValue (TimingStats Double) m -> [ResultId]
forall e (m :: * -> *). ResultValue e m -> [ResultId]
resultValueIdPath
  resultItemSignal :: ResultValue (TimingStats Double) m -> ResultSignal m
resultItemSignal = ResultValue (TimingStats Double) m -> ResultSignal m
forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal
  
  resultItemAsIntValue :: ResultValue (TimingStats Double) m -> Maybe (ResultValue Int m)
resultItemAsIntValue = Maybe (ResultValue Int m)
-> ResultValue (TimingStats Double) m -> Maybe (ResultValue Int m)
forall a b. a -> b -> a
const Maybe (ResultValue Int m)
forall a. Maybe a
Nothing
  resultItemAsIntListValue :: ResultValue (TimingStats Double) m -> Maybe (ResultValue [Int] m)
resultItemAsIntListValue = Maybe (ResultValue [Int] m)
-> ResultValue (TimingStats Double) m
-> Maybe (ResultValue [Int] m)
forall a b. a -> b -> a
const Maybe (ResultValue [Int] m)
forall a. Maybe a
Nothing
  resultItemAsIntStatsValue :: ResultValue (TimingStats Double) m
-> Maybe (ResultValue (SamplingStats Int) m)
resultItemAsIntStatsValue = Maybe (ResultValue (SamplingStats Int) m)
-> ResultValue (TimingStats Double) m
-> Maybe (ResultValue (SamplingStats Int) m)
forall a b. a -> b -> a
const Maybe (ResultValue (SamplingStats Int) m)
forall a. Maybe a
Nothing
  resultItemAsIntTimingStatsValue :: ResultValue (TimingStats Double) m
-> Maybe (ResultValue (TimingStats Int) m)
resultItemAsIntTimingStatsValue = Maybe (ResultValue (TimingStats Int) m)
-> ResultValue (TimingStats Double) m
-> Maybe (ResultValue (TimingStats Int) m)
forall a b. a -> b -> a
const Maybe (ResultValue (TimingStats Int) m)
forall a. Maybe a
Nothing

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

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

instance ResultItemable (ResultValue Bool) where

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

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

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

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

instance ResultItemable (ResultValue String) where

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

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

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

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

instance ResultItemable (ResultValue ()) where

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

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

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

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

instance ResultItemable (ResultValue FCFS) where

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

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

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

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

instance ResultItemable (ResultValue LCFS) where

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

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

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

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

instance ResultItemable (ResultValue SIRO) where

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

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

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

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

instance ResultItemable (ResultValue StaticPriorities) where

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

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

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

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

-- | Flatten the result source.
flattenResultSource :: ResultSource m -> [ResultItem m]
flattenResultSource :: ResultSource m -> [ResultItem m]
flattenResultSource (ResultItemSource ResultItem m
x) = [ResultItem m
x]
flattenResultSource (ResultObjectSource ResultObject m
x) =
  [[ResultItem m]] -> [ResultItem m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultItem m]] -> [ResultItem m])
-> [[ResultItem m]] -> [ResultItem m]
forall a b. (a -> b) -> a -> b
$ (ResultProperty m -> [ResultItem m])
-> [ResultProperty m] -> [[ResultItem m]]
forall a b. (a -> b) -> [a] -> [b]
map (ResultSource m -> [ResultItem m]
forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource (ResultSource m -> [ResultItem m])
-> (ResultProperty m -> ResultSource m)
-> ResultProperty m
-> [ResultItem m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultProperty m -> ResultSource m
forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource) ([ResultProperty m] -> [[ResultItem m]])
-> [ResultProperty m] -> [[ResultItem m]]
forall a b. (a -> b) -> a -> b
$ ResultObject m -> [ResultProperty m]
forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties ResultObject m
x
flattenResultSource (ResultVectorSource ResultVector m
x) =
  [[ResultItem m]] -> [ResultItem m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultItem m]] -> [ResultItem m])
-> [[ResultItem m]] -> [ResultItem m]
forall a b. (a -> b) -> a -> b
$ (ResultSource m -> [ResultItem m])
-> [ResultSource m] -> [[ResultItem m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultItem m]
forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource ([ResultSource m] -> [[ResultItem m]])
-> [ResultSource m] -> [[ResultItem m]]
forall a b. (a -> b) -> a -> b
$ Array Int (ResultSource m) -> [ResultSource m]
forall i e. Array i e -> [e]
A.elems (Array Int (ResultSource m) -> [ResultSource m])
-> Array Int (ResultSource m) -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$ ResultVector m -> Array Int (ResultSource m)
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 :: ResultSource m -> ResultName
resultSourceName (ResultItemSource (ResultItem a m
x)) = a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
x
resultSourceName (ResultObjectSource ResultObject m
x) = ResultObject m -> ResultName
forall (m :: * -> *). ResultObject m -> ResultName
resultObjectName ResultObject m
x
resultSourceName (ResultVectorSource ResultVector m
x) = ResultVector m -> ResultName
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 :: ResultSource m -> ResultSource m
expandResultSource (ResultItemSource (ResultItem a m
x)) = a m -> ResultSource m
forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> ResultSource m
resultItemExpansion a m
x
expandResultSource (ResultObjectSource ResultObject m
x) =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject m
x { resultObjectProperties :: [ResultProperty m]
resultObjectProperties =
         ((ResultProperty m -> ResultProperty m)
 -> [ResultProperty m] -> [ResultProperty m])
-> [ResultProperty m]
-> (ResultProperty m -> ResultProperty m)
-> [ResultProperty m]
forall a b c. (a -> b -> c) -> b -> a -> c
flip (ResultProperty m -> ResultProperty m)
-> [ResultProperty m] -> [ResultProperty m]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (ResultObject m -> [ResultProperty m]
forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties ResultObject m
x) ((ResultProperty m -> ResultProperty m) -> [ResultProperty m])
-> (ResultProperty m -> ResultProperty m) -> [ResultProperty m]
forall a b. (a -> b) -> a -> b
$ \ResultProperty m
p ->
         ResultProperty m
p { resultPropertySource :: ResultSource m
resultPropertySource = ResultSource m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
expandResultSource (ResultProperty m -> ResultSource m
forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource ResultProperty m
p) } }
expandResultSource (ResultVectorSource ResultVector m
x) =
  ResultVector m -> ResultSource m
forall (m :: * -> *). ResultVector m -> ResultSource m
ResultVectorSource (ResultVector m -> ResultSource m)
-> ResultVector m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultVector m
x { resultVectorItems :: Array Int (ResultSource m)
resultVectorItems =
         (Int, Int) -> [(Int, ResultSource m)] -> Array Int (ResultSource m)
forall i e. Ix i => (i, i) -> [(i, e)] -> Array i e
A.array (Int, Int)
bnds [(Int
i, ResultSource m -> ResultSource m
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  = ResultVector m -> Array Int (ResultSource m)
forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
x
          bnds :: (Int, Int)
bnds = Array Int (ResultSource m) -> (Int, Int)
forall i e. Array i e -> (i, i)
A.bounds Array Int (ResultSource m)
arr
          ies :: [(Int, ResultSource m)]
ies  = Array Int (ResultSource m) -> [(Int, ResultSource m)]
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 :: ResultSource m -> ResultSource m
resultSourceSummary (ResultItemSource (ResultItem a m
x)) = a m -> ResultSource m
forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> ResultSource m
resultItemSummary a m
x
resultSourceSummary (ResultObjectSource ResultObject m
x) = ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
resultObjectSummary ResultObject m
x
resultSourceSummary (ResultVectorSource ResultVector m
x) = ResultVector m -> ResultSource m
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 :: ResultSource m -> ResultSignal m
resultSourceSignal (ResultItemSource (ResultItem a m
x)) = a m -> ResultSignal m
forall (a :: (* -> *) -> *) (m :: * -> *).
(ResultItemable a, MonadDES m) =>
a m -> ResultSignal m
resultItemSignal a m
x
resultSourceSignal (ResultObjectSource ResultObject m
x) = ResultObject m -> ResultSignal m
forall (m :: * -> *). ResultObject m -> ResultSignal m
resultObjectSignal ResultObject m
x
resultSourceSignal (ResultVectorSource ResultVector m
x) = ResultVector m -> ResultSignal m
forall (m :: * -> *). ResultVector m -> ResultSignal m
resultVectorSignal ResultVector m
x
resultSourceSignal (ResultSeparatorSource ResultSeparator
x) = ResultSignal m
forall (m :: * -> *). ResultSignal m
EmptyResultSignal

-- | Represent the result source as integer numbers.
resultSourceToIntValues :: MonadDES m => ResultSource m -> [ResultValue Int m]
resultSourceToIntValues :: ResultSource m -> [ResultValue Int m]
resultSourceToIntValues = (ResultItem m -> ResultValue Int m)
-> [ResultItem m] -> [ResultValue Int m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue Int m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue Int m
resultItemToIntValue a m
x) ([ResultItem m] -> [ResultValue Int m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue Int m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m -> [ResultValue [Int] m]
resultSourceToIntListValues = (ResultItem m -> ResultValue [Int] m)
-> [ResultItem m] -> [ResultValue [Int] m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue [Int] m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue [Int] m
resultItemToIntListValue a m
x) ([ResultItem m] -> [ResultValue [Int] m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue [Int] m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m -> [ResultValue (SamplingStats Int) m]
resultSourceToIntStatsValues = (ResultItem m -> ResultValue (SamplingStats Int) m)
-> [ResultItem m] -> [ResultValue (SamplingStats Int) m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue (SamplingStats Int) m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (SamplingStats Int) m
resultItemToIntStatsValue a m
x) ([ResultItem m] -> [ResultValue (SamplingStats Int) m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue (SamplingStats Int) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m -> [ResultValue (Either Int (SamplingStats Int)) m]
resultSourceToIntStatsEitherValues = (ResultItem m -> ResultValue (Either Int (SamplingStats Int)) m)
-> [ResultItem m]
-> [ResultValue (Either Int (SamplingStats Int)) m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue (Either Int (SamplingStats Int)) m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (Either Int (SamplingStats Int)) m
resultItemToIntStatsEitherValue a m
x) ([ResultItem m]
 -> [ResultValue (Either Int (SamplingStats Int)) m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue (Either Int (SamplingStats Int)) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m -> [ResultValue (TimingStats Int) m]
resultSourceToIntTimingStatsValues = (ResultItem m -> ResultValue (TimingStats Int) m)
-> [ResultItem m] -> [ResultValue (TimingStats Int) m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue (TimingStats Int) m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (TimingStats Int) m
resultItemToIntTimingStatsValue a m
x) ([ResultItem m] -> [ResultValue (TimingStats Int) m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue (TimingStats Int) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m -> [ResultValue Double m]
resultSourceToDoubleValues = (ResultItem m -> ResultValue Double m)
-> [ResultItem m] -> [ResultValue Double m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue Double m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue Double m
resultItemToDoubleValue a m
x) ([ResultItem m] -> [ResultValue Double m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue Double m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m -> [ResultValue [Double] m]
resultSourceToDoubleListValues = (ResultItem m -> ResultValue [Double] m)
-> [ResultItem m] -> [ResultValue [Double] m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue [Double] m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue [Double] m
resultItemToDoubleListValue a m
x) ([ResultItem m] -> [ResultValue [Double] m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue [Double] m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m -> [ResultValue (SamplingStats Double) m]
resultSourceToDoubleStatsValues = (ResultItem m -> ResultValue (SamplingStats Double) m)
-> [ResultItem m] -> [ResultValue (SamplingStats Double) m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue (SamplingStats Double) m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (SamplingStats Double) m
resultItemToDoubleStatsValue a m
x) ([ResultItem m] -> [ResultValue (SamplingStats Double) m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue (SamplingStats Double) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m
-> [ResultValue (Either Double (SamplingStats Double)) m]
resultSourceToDoubleStatsEitherValues = (ResultItem m
 -> ResultValue (Either Double (SamplingStats Double)) m)
-> [ResultItem m]
-> [ResultValue (Either Double (SamplingStats Double)) m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue (Either Double (SamplingStats Double)) m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (Either Double (SamplingStats Double)) m
resultItemToDoubleStatsEitherValue a m
x) ([ResultItem m]
 -> [ResultValue (Either Double (SamplingStats Double)) m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue (Either Double (SamplingStats Double)) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
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 :: ResultSource m -> [ResultValue (TimingStats Double) m]
resultSourceToDoubleTimingStatsValues = (ResultItem m -> ResultValue (TimingStats Double) m)
-> [ResultItem m] -> [ResultValue (TimingStats Double) m]
forall a b. (a -> b) -> [a] -> [b]
map (\(ResultItem a m
x) -> a m -> ResultValue (TimingStats Double) m
forall (m :: * -> *) (a :: (* -> *) -> *).
(MonadDES m, ResultItemable a) =>
a m -> ResultValue (TimingStats Double) m
resultItemToDoubleTimingStatsValue a m
x) ([ResultItem m] -> [ResultValue (TimingStats Double) m])
-> (ResultSource m -> [ResultItem m])
-> ResultSource m
-> [ResultValue (TimingStats Double) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultSource m -> [ResultItem m]
forall (m :: * -> *). ResultSource m -> [ResultItem m]
flattenResultSource

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

-- | It contains the results of simulation.
data Results m =
  Results { Results m -> ResultSourceMap m
resultSourceMap :: ResultSourceMap m,
            -- ^ The sources of simulation results as a map of associated names.
            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 { ResultPredefinedSignals m -> Signal m Double
resultSignalInIntegTimes :: Signal m Double,
                            -- ^ The signal triggered in the integration time points.
                            ResultPredefinedSignals m -> Signal m Double
resultSignalInStartTime :: Signal m Double,
                            -- ^ The signal triggered in the start time.
                            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 :: Simulation m (ResultPredefinedSignals m)
newResultPredefinedSignals = Dynamics m (ResultPredefinedSignals m)
-> Simulation m (ResultPredefinedSignals m)
forall (m :: * -> *) a. Dynamics m a -> Simulation m a
runDynamicsInStartTime (Dynamics m (ResultPredefinedSignals m)
 -> Simulation m (ResultPredefinedSignals m))
-> Dynamics m (ResultPredefinedSignals m)
-> Simulation m (ResultPredefinedSignals m)
forall a b. (a -> b) -> a -> b
$ EventProcessing
-> Event m (ResultPredefinedSignals m)
-> Dynamics m (ResultPredefinedSignals m)
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 <- Event m (Signal m Double)
forall (m :: * -> *). MonadDES m => Event m (Signal m Double)
newSignalInIntegTimes
         Signal m Double
signalInStartTime  <- Event m (Signal m Double)
forall (m :: * -> *). MonadDES m => Event m (Signal m Double)
newSignalInStartTime
         Signal m Double
signalInStopTime   <- Event m (Signal m Double)
forall (m :: * -> *). MonadDES m => Event m (Signal m Double)
newSignalInStopTime
         ResultPredefinedSignals m -> Event m (ResultPredefinedSignals m)
forall (m :: * -> *) a. Monad m => a -> m a
return ResultPredefinedSignals :: forall (m :: * -> *).
Signal m Double
-> Signal m Double -> Signal m Double -> ResultPredefinedSignals m
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 = [ResultSource m] -> Results m
forall (m :: * -> *). [ResultSource m] -> Results m
results ([ResultSource m] -> Results m) -> [ResultSource m] -> Results m
forall a b. (a -> b) -> a -> b
$ Results m -> [ResultSource m]
forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList Results m
x [ResultSource m] -> [ResultSource m] -> [ResultSource m]
forall a. Semigroup a => a -> a -> a
<> Results m -> [ResultSource m]
forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList Results m
y

instance Monoid (Results m) where

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

-- | Prepare the simulation results.
results :: [ResultSource m] -> Results m
results :: [ResultSource m] -> Results m
results [ResultSource m]
ms =
  Results :: forall (m :: * -> *).
ResultSourceMap m -> [ResultSource m] -> Results m
Results { resultSourceMap :: ResultSourceMap m
resultSourceMap  = [(ResultName, ResultSource m)] -> ResultSourceMap m
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([(ResultName, ResultSource m)] -> ResultSourceMap m)
-> [(ResultName, ResultSource m)] -> ResultSourceMap m
forall a b. (a -> b) -> a -> b
$ (ResultSource m -> (ResultName, ResultSource m))
-> [ResultSource m] -> [(ResultName, ResultSource m)]
forall a b. (a -> b) -> [a] -> [b]
map (\ResultSource m
x -> (ResultSource m -> ResultName
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 :: Results m -> [ResultValue Int m]
resultsToIntValues = [[ResultValue Int m]] -> [ResultValue Int m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue Int m]] -> [ResultValue Int m])
-> (Results m -> [[ResultValue Int m]])
-> Results m
-> [ResultValue Int m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> [ResultValue Int m])
-> [ResultSource m] -> [[ResultValue Int m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue Int m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue Int m]
resultSourceToIntValues ([ResultSource m] -> [[ResultValue Int m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue Int m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as lists of integer numbers.
resultsToIntListValues :: MonadDES m => Results m -> [ResultValue [Int] m]
resultsToIntListValues :: Results m -> [ResultValue [Int] m]
resultsToIntListValues = [[ResultValue [Int] m]] -> [ResultValue [Int] m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue [Int] m]] -> [ResultValue [Int] m])
-> (Results m -> [[ResultValue [Int] m]])
-> Results m
-> [ResultValue [Int] m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> [ResultValue [Int] m])
-> [ResultSource m] -> [[ResultValue [Int] m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue [Int] m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue [Int] m]
resultSourceToIntListValues ([ResultSource m] -> [[ResultValue [Int] m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue [Int] m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: Results m -> [ResultValue (SamplingStats Int) m]
resultsToIntStatsValues = [[ResultValue (SamplingStats Int) m]]
-> [ResultValue (SamplingStats Int) m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue (SamplingStats Int) m]]
 -> [ResultValue (SamplingStats Int) m])
-> (Results m -> [[ResultValue (SamplingStats Int) m]])
-> Results m
-> [ResultValue (SamplingStats Int) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> [ResultValue (SamplingStats Int) m])
-> [ResultSource m] -> [[ResultValue (SamplingStats Int) m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue (SamplingStats Int) m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (SamplingStats Int) m]
resultSourceToIntStatsValues ([ResultSource m] -> [[ResultValue (SamplingStats Int) m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue (SamplingStats Int) m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: Results m -> [ResultValue (Either Int (SamplingStats Int)) m]
resultsToIntStatsEitherValues = [[ResultValue (Either Int (SamplingStats Int)) m]]
-> [ResultValue (Either Int (SamplingStats Int)) m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue (Either Int (SamplingStats Int)) m]]
 -> [ResultValue (Either Int (SamplingStats Int)) m])
-> (Results m
    -> [[ResultValue (Either Int (SamplingStats Int)) m]])
-> Results m
-> [ResultValue (Either Int (SamplingStats Int)) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m
 -> [ResultValue (Either Int (SamplingStats Int)) m])
-> [ResultSource m]
-> [[ResultValue (Either Int (SamplingStats Int)) m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue (Either Int (SamplingStats Int)) m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (Either Int (SamplingStats Int)) m]
resultSourceToIntStatsEitherValues ([ResultSource m]
 -> [[ResultValue (Either Int (SamplingStats Int)) m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue (Either Int (SamplingStats Int)) m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: Results m -> [ResultValue (TimingStats Int) m]
resultsToIntTimingStatsValues = [[ResultValue (TimingStats Int) m]]
-> [ResultValue (TimingStats Int) m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue (TimingStats Int) m]]
 -> [ResultValue (TimingStats Int) m])
-> (Results m -> [[ResultValue (TimingStats Int) m]])
-> Results m
-> [ResultValue (TimingStats Int) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> [ResultValue (TimingStats Int) m])
-> [ResultSource m] -> [[ResultValue (TimingStats Int) m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue (TimingStats Int) m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (TimingStats Int) m]
resultSourceToIntTimingStatsValues ([ResultSource m] -> [[ResultValue (TimingStats Int) m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue (TimingStats Int) m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Represent the results as double floating point numbers.
resultsToDoubleValues :: MonadDES m => Results m -> [ResultValue Double m]
resultsToDoubleValues :: Results m -> [ResultValue Double m]
resultsToDoubleValues = [[ResultValue Double m]] -> [ResultValue Double m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue Double m]] -> [ResultValue Double m])
-> (Results m -> [[ResultValue Double m]])
-> Results m
-> [ResultValue Double m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> [ResultValue Double m])
-> [ResultSource m] -> [[ResultValue Double m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue Double m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue Double m]
resultSourceToDoubleValues ([ResultSource m] -> [[ResultValue Double m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue Double m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: Results m -> [ResultValue [Double] m]
resultsToDoubleListValues = [[ResultValue [Double] m]] -> [ResultValue [Double] m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue [Double] m]] -> [ResultValue [Double] m])
-> (Results m -> [[ResultValue [Double] m]])
-> Results m
-> [ResultValue [Double] m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> [ResultValue [Double] m])
-> [ResultSource m] -> [[ResultValue [Double] m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue [Double] m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue [Double] m]
resultSourceToDoubleListValues ([ResultSource m] -> [[ResultValue [Double] m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue [Double] m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: Results m -> [ResultValue (SamplingStats Double) m]
resultsToDoubleStatsValues = [[ResultValue (SamplingStats Double) m]]
-> [ResultValue (SamplingStats Double) m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue (SamplingStats Double) m]]
 -> [ResultValue (SamplingStats Double) m])
-> (Results m -> [[ResultValue (SamplingStats Double) m]])
-> Results m
-> [ResultValue (SamplingStats Double) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> [ResultValue (SamplingStats Double) m])
-> [ResultSource m] -> [[ResultValue (SamplingStats Double) m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue (SamplingStats Double) m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (SamplingStats Double) m]
resultSourceToDoubleStatsValues ([ResultSource m] -> [[ResultValue (SamplingStats Double) m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue (SamplingStats Double) m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: Results m -> [ResultValue (Either Double (SamplingStats Double)) m]
resultsToDoubleStatsEitherValues = [[ResultValue (Either Double (SamplingStats Double)) m]]
-> [ResultValue (Either Double (SamplingStats Double)) m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue (Either Double (SamplingStats Double)) m]]
 -> [ResultValue (Either Double (SamplingStats Double)) m])
-> (Results m
    -> [[ResultValue (Either Double (SamplingStats Double)) m]])
-> Results m
-> [ResultValue (Either Double (SamplingStats Double)) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m
 -> [ResultValue (Either Double (SamplingStats Double)) m])
-> [ResultSource m]
-> [[ResultValue (Either Double (SamplingStats Double)) m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m
-> [ResultValue (Either Double (SamplingStats Double)) m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m
-> [ResultValue (Either Double (SamplingStats Double)) m]
resultSourceToDoubleStatsEitherValues ([ResultSource m]
 -> [[ResultValue (Either Double (SamplingStats Double)) m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue (Either Double (SamplingStats Double)) m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: Results m -> [ResultValue (TimingStats Double) m]
resultsToDoubleTimingStatsValues = [[ResultValue (TimingStats Double) m]]
-> [ResultValue (TimingStats Double) m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultValue (TimingStats Double) m]]
 -> [ResultValue (TimingStats Double) m])
-> (Results m -> [[ResultValue (TimingStats Double) m]])
-> Results m
-> [ResultValue (TimingStats Double) m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> [ResultValue (TimingStats Double) m])
-> [ResultSource m] -> [[ResultValue (TimingStats Double) m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultValue (TimingStats Double) m]
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> [ResultValue (TimingStats Double) m]
resultSourceToDoubleTimingStatsValues ([ResultSource m] -> [[ResultValue (TimingStats Double) m]])
-> (Results m -> [ResultSource m])
-> Results m
-> [[ResultValue (TimingStats Double) m]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

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

-- | Return a signal emitted by the specified results.
resultSignal :: MonadDES m => Results m -> ResultSignal m
resultSignal :: Results m -> ResultSignal m
resultSignal = [ResultSignal m] -> ResultSignal m
forall a. Monoid a => [a] -> a
mconcat ([ResultSignal m] -> ResultSignal m)
-> (Results m -> [ResultSignal m]) -> Results m -> ResultSignal m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> ResultSignal m)
-> [ResultSource m] -> [ResultSignal m]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> ResultSignal m
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSignal m
resultSourceSignal ([ResultSource m] -> [ResultSignal m])
-> (Results m -> [ResultSource m]) -> Results m -> [ResultSignal m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: ResultTransform m
expandResults = [ResultSource m] -> Results m
forall (m :: * -> *). [ResultSource m] -> Results m
results ([ResultSource m] -> Results m)
-> (Results m -> [ResultSource m]) -> ResultTransform m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> ResultSource m)
-> [ResultSource m] -> [ResultSource m]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
expandResultSource ([ResultSource m] -> [ResultSource m])
-> (Results m -> [ResultSource m]) -> Results m -> [ResultSource m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
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 :: ResultTransform m
resultSummary = [ResultSource m] -> Results m
forall (m :: * -> *). [ResultSource m] -> Results m
results ([ResultSource m] -> Results m)
-> (Results m -> [ResultSource m]) -> ResultTransform m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ResultSource m -> ResultSource m)
-> [ResultSource m] -> [ResultSource m]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultSource m -> ResultSource m
resultSourceSummary ([ResultSource m] -> [ResultSource m])
-> (Results m -> [ResultSource m]) -> Results m -> [ResultSource m]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Results m -> [ResultSource m]
forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList

-- | Take a result by its name.
resultByName :: ResultName -> ResultTransform m
resultByName :: ResultName -> ResultTransform m
resultByName ResultName
name Results m
rs =
  case ResultName
-> Map ResultName (ResultSource m) -> Maybe (ResultSource m)
forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup ResultName
name (Results m -> Map ResultName (ResultSource m)
forall (m :: * -> *). Results m -> ResultSourceMap m
resultSourceMap Results m
rs) of
    Just ResultSource m
x -> [ResultSource m] -> Results m
forall (m :: * -> *). [ResultSource m] -> Results m
results [ResultSource m
x]
    Maybe (ResultSource m)
Nothing ->
      ResultName -> Results m
forall a. HasCallStack => ResultName -> a
error (ResultName -> Results m) -> ResultName -> Results m
forall a b. (a -> b) -> a -> b
$
      ResultName
"Not found result source with name " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultName
name ResultName -> ResultName -> ResultName
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 :: ResultName -> ResultTransform m
resultByProperty ResultName
label Results m
rs = ((ResultSource m -> [ResultSource m]) -> ResultTransform m)
-> Results m -> (ResultSource m -> [ResultSource m]) -> Results m
forall a b c. (a -> b -> c) -> b -> a -> c
flip (ResultSource m -> [ResultSource m]) -> ResultTransform m
forall (m :: * -> *).
(ResultSource m -> [ResultSource m]) -> ResultTransform m
composeResults Results m
rs ResultSource m -> [ResultSource m]
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 =
                ((ResultProperty m -> Bool)
 -> [ResultProperty m] -> [ResultProperty m])
-> [ResultProperty m]
-> (ResultProperty m -> Bool)
-> [ResultProperty m]
forall a b c. (a -> b -> c) -> b -> a -> c
flip (ResultProperty m -> Bool)
-> [ResultProperty m] -> [ResultProperty m]
forall a. (a -> Bool) -> [a] -> [a]
filter (ResultObject m -> [ResultProperty m]
forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties ResultObject m
s) ((ResultProperty m -> Bool) -> [ResultProperty m])
-> (ResultProperty m -> Bool) -> [ResultProperty m]
forall a b. (a -> b) -> a -> b
$ \ResultProperty m
p ->
                ResultProperty m -> ResultName
forall (m :: * -> *). ResultProperty m -> ResultName
resultPropertyLabel ResultProperty m
p ResultName -> ResultName -> Bool
forall a. Eq a => a -> a -> Bool
== ResultName
label
          in case [ResultProperty m]
ps of
            [] ->
              ResultName -> [ResultSource m]
forall a. HasCallStack => ResultName -> a
error (ResultName -> [ResultSource m]) -> ResultName -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$
              ResultName
"Not found property " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultName
label ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
              ResultName
" for object " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultObject m -> ResultName
forall (m :: * -> *). ResultObject m -> ResultName
resultObjectName ResultObject m
s ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
              ResultName
": resultByProperty"
            [ResultProperty m]
ps ->
              (ResultProperty m -> ResultSource m)
-> [ResultProperty m] -> [ResultSource m]
forall a b. (a -> b) -> [a] -> [b]
map ResultProperty m -> ResultSource m
forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource [ResultProperty m]
ps
        ResultVectorSource ResultVector m
s ->
          [[ResultSource m]] -> [ResultSource m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultSource m]] -> [ResultSource m])
-> [[ResultSource m]] -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$ (ResultSource m -> [ResultSource m])
-> [ResultSource m] -> [[ResultSource m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultSource m]
loop ([ResultSource m] -> [[ResultSource m]])
-> [ResultSource m] -> [[ResultSource m]]
forall a b. (a -> b) -> a -> b
$ Array Int (ResultSource m) -> [ResultSource m]
forall i e. Array i e -> [e]
A.elems (Array Int (ResultSource m) -> [ResultSource m])
-> Array Int (ResultSource m) -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$ ResultVector m -> Array Int (ResultSource m)
forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
s
        ResultSource m
x ->
          ResultName -> [ResultSource m]
forall a. HasCallStack => ResultName -> a
error (ResultName -> [ResultSource m]) -> ResultName -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$
          ResultName
"Result source " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultSource m -> ResultName
forall (m :: * -> *). ResultSource m -> ResultName
resultSourceName ResultSource m
x ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
          ResultName
" is neither object, nor vector " ResultName -> ResultName -> ResultName
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 :: ResultId -> ResultTransform m
resultById ResultId
i Results m
rs = ((ResultSource m -> [ResultSource m]) -> ResultTransform m)
-> Results m -> (ResultSource m -> [ResultSource m]) -> Results m
forall a b c. (a -> b -> c) -> b -> a -> c
flip (ResultSource m -> [ResultSource m]) -> ResultTransform m
forall (m :: * -> *).
(ResultSource m -> [ResultSource m]) -> ResultTransform m
composeResults Results m
rs ResultSource m -> [ResultSource m]
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 a m -> ResultId
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultId
resultItemId a m
s ResultId -> ResultId -> Bool
forall a. Eq a => a -> a -> Bool
== ResultId
i
          then [ResultSource m
x]
          else ResultName -> [ResultSource m]
forall a. HasCallStack => ResultName -> a
error (ResultName -> [ResultSource m]) -> ResultName -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$
               ResultName
"Expected to find item with Id = " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultId -> ResultName
forall a. Show a => a -> ResultName
show ResultId
i ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
               ResultName
", while the item " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ a m -> ResultName
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultName
resultItemName a m
s ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
               ResultName
" has actual Id = " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultId -> ResultName
forall a. Show a => a -> ResultName
show (a m -> ResultId
forall (a :: (* -> *) -> *) (m :: * -> *).
ResultItemable a =>
a m -> ResultId
resultItemId a m
s) ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
               ResultName
": resultById"
        ResultObjectSource ResultObject m
s ->
          if ResultObject m -> ResultId
forall (m :: * -> *). ResultObject m -> ResultId
resultObjectId ResultObject m
s ResultId -> ResultId -> Bool
forall a. Eq a => a -> a -> Bool
== ResultId
i
          then [ResultSource m
x]
          else let ps :: [ResultProperty m]
ps =
                     ((ResultProperty m -> Bool)
 -> [ResultProperty m] -> [ResultProperty m])
-> [ResultProperty m]
-> (ResultProperty m -> Bool)
-> [ResultProperty m]
forall a b c. (a -> b -> c) -> b -> a -> c
flip (ResultProperty m -> Bool)
-> [ResultProperty m] -> [ResultProperty m]
forall a. (a -> Bool) -> [a] -> [a]
filter (ResultObject m -> [ResultProperty m]
forall (m :: * -> *). ResultObject m -> [ResultProperty m]
resultObjectProperties ResultObject m
s) ((ResultProperty m -> Bool) -> [ResultProperty m])
-> (ResultProperty m -> Bool) -> [ResultProperty m]
forall a b. (a -> b) -> a -> b
$ \ResultProperty m
p ->
                     ResultProperty m -> ResultId
forall (m :: * -> *). ResultProperty m -> ResultId
resultPropertyId ResultProperty m
p ResultId -> ResultId -> Bool
forall a. Eq a => a -> a -> Bool
== ResultId
i
               in case [ResultProperty m]
ps of
                 [] ->
                   ResultName -> [ResultSource m]
forall a. HasCallStack => ResultName -> a
error (ResultName -> [ResultSource m]) -> ResultName -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$
                   ResultName
"Not found property with Id = " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultId -> ResultName
forall a. Show a => a -> ResultName
show ResultId
i ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
                   ResultName
" for object " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultObject m -> ResultName
forall (m :: * -> *). ResultObject m -> ResultName
resultObjectName ResultObject m
s ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
                   ResultName
" that has actual Id = " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultId -> ResultName
forall a. Show a => a -> ResultName
show (ResultObject m -> ResultId
forall (m :: * -> *). ResultObject m -> ResultId
resultObjectId ResultObject m
s) ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
                   ResultName
": resultById"
                 [ResultProperty m]
ps ->
                   (ResultProperty m -> ResultSource m)
-> [ResultProperty m] -> [ResultSource m]
forall a b. (a -> b) -> [a] -> [b]
map ResultProperty m -> ResultSource m
forall (m :: * -> *). ResultProperty m -> ResultSource m
resultPropertySource [ResultProperty m]
ps
        ResultVectorSource ResultVector m
s ->
          if ResultVector m -> ResultId
forall (m :: * -> *). ResultVector m -> ResultId
resultVectorId ResultVector m
s ResultId -> ResultId -> Bool
forall a. Eq a => a -> a -> Bool
== ResultId
i
          then [ResultSource m
x]
          else [[ResultSource m]] -> [ResultSource m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultSource m]] -> [ResultSource m])
-> [[ResultSource m]] -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$ (ResultSource m -> [ResultSource m])
-> [ResultSource m] -> [[ResultSource m]]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> [ResultSource m]
loop ([ResultSource m] -> [[ResultSource m]])
-> [ResultSource m] -> [[ResultSource m]]
forall a b. (a -> b) -> a -> b
$ Array Int (ResultSource m) -> [ResultSource m]
forall i e. Array i e -> [e]
A.elems (Array Int (ResultSource m) -> [ResultSource m])
-> Array Int (ResultSource m) -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$ ResultVector m -> Array Int (ResultSource m)
forall (m :: * -> *). ResultVector m -> Array Int (ResultSource m)
resultVectorItems ResultVector m
s
        ResultSource m
x ->
          ResultName -> [ResultSource m]
forall a. HasCallStack => ResultName -> a
error (ResultName -> [ResultSource m]) -> ResultName -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$
          ResultName
"Result source " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultSource m -> ResultName
forall (m :: * -> *). ResultSource m -> ResultName
resultSourceName ResultSource m
x ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
          ResultName
" is neither item, nor object, nor vector " ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++
          ResultName
": resultById"

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

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

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

-- | Concatenate the results using the specified list of transformation functions.
concatResults :: [ResultTransform m] -> ResultTransform m
concatResults :: [ResultTransform m] -> ResultTransform m
concatResults [ResultTransform m]
trs Results m
rs =
  [ResultSource m] -> Results m
forall (m :: * -> *). [ResultSource m] -> Results m
results ([ResultSource m] -> Results m) -> [ResultSource m] -> Results m
forall a b. (a -> b) -> a -> b
$ [[ResultSource m]] -> [ResultSource m]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[ResultSource m]] -> [ResultSource m])
-> [[ResultSource m]] -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$ (ResultTransform m -> [ResultSource m])
-> [ResultTransform m] -> [[ResultSource m]]
forall a b. (a -> b) -> [a] -> [b]
map (\ResultTransform m
tr -> Results m -> [ResultSource m]
forall (m :: * -> *). Results m -> [ResultSource m]
resultSourceList (Results m -> [ResultSource m]) -> Results m -> [ResultSource m]
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 :: ResultTransform m -> ResultTransform m -> ResultTransform m
appendResults ResultTransform m
x ResultTransform m
y =
  [ResultTransform m] -> ResultTransform m
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 :: ResultPredefinedSignals m -> ResultSignal m -> Signal m ()
pureResultSignal ResultPredefinedSignals m
rs ResultSignal m
EmptyResultSignal =
  Signal m Double -> Signal m ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (ResultPredefinedSignals m -> Signal m Double
forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInStartTime ResultPredefinedSignals m
rs)
pureResultSignal ResultPredefinedSignals m
rs ResultSignal m
UnknownResultSignal =
  Signal m Double -> Signal m ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (ResultPredefinedSignals m -> Signal m Double
forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInIntegTimes ResultPredefinedSignals m
rs)
pureResultSignal ResultPredefinedSignals m
rs (ResultSignal Signal m ()
s) =
  Signal m Double -> Signal m ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (ResultPredefinedSignals m -> Signal m Double
forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInStartTime ResultPredefinedSignals m
rs) Signal m () -> Signal m () -> Signal m ()
forall a. Semigroup a => a -> a -> a
<> Signal m Double -> Signal m ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (ResultPredefinedSignals m -> Signal m Double
forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInStopTime ResultPredefinedSignals m
rs) Signal m () -> Signal m () -> Signal m ()
forall a. Semigroup a => a -> a -> a
<> Signal m ()
s
pureResultSignal ResultPredefinedSignals m
rs (ResultSignalMix Signal m ()
s) =
  Signal m Double -> Signal m ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (ResultPredefinedSignals m -> Signal m Double
forall (m :: * -> *). ResultPredefinedSignals m -> Signal m Double
resultSignalInIntegTimes ResultPredefinedSignals m
rs) Signal m () -> Signal m () -> Signal m ()
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 :: ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> t m a
-> ResultValue a m
computeResultValue ResultName
name [ResultName]
names ResultId
i [ResultId]
is t m a
m =
  ResultValue :: forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultData e m
-> ResultSignal m
-> ResultValue e 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   = t m a -> ResultData a m
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ResultComputing t m =>
t m a -> ResultData a m
computeResultData t m a
m,
    resultValueSignal :: ResultSignal m
resultValueSignal = t m a -> ResultSignal m
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 :: Parameter m a -> ResultData a m
computeResultData = Parameter m a -> ResultData a m
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
ParameterLift t m =>
Parameter m a -> t m a
liftParameter
  computeResultSignal :: Parameter m a -> ResultSignal m
computeResultSignal = ResultSignal m -> Parameter m a -> ResultSignal m
forall a b. a -> b -> a
const ResultSignal m
forall (m :: * -> *). ResultSignal m
UnknownResultSignal

instance MonadDES m => ResultComputing Simulation m where

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

instance MonadDES m => ResultComputing Dynamics m where

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

instance MonadDES m => ResultComputing Event m where

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

instance MonadDES m => ResultComputing Ref m where

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

instance MonadDES m => ResultComputing B.Ref m where

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

instance MonadVar m => ResultComputing Var m where

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

instance MonadDES m => ResultComputing Signalable m where

  computeResultData :: Signalable m a -> ResultData a m
computeResultData = Signalable m a -> ResultData a m
forall (m :: * -> *) a. Signalable m a -> Event m a
readSignalable
  computeResultSignal :: Signalable m a -> ResultSignal m
computeResultSignal = Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m)
-> (Signalable m a -> Signal m ())
-> Signalable m a
-> ResultSignal m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Signalable m a -> Signal m ()
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 :: ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSource ResultValue (SamplingStats a) m
x =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName      = ResultValue (SamplingStats a) m -> ResultName
forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (SamplingStats a) m
x,
    resultObjectId :: ResultId
resultObjectId        = ResultValue (SamplingStats a) m -> ResultId
forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (SamplingStats a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
SamplingStatsId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = ResultValue (SamplingStats a) m -> ResultSignal m
forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (SamplingStats a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = ResultValue (SamplingStats a) m -> ResultSource m
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 = [
      ResultContainer (ResultData (SamplingStats a) m) m
-> ResultName
-> ResultId
-> (SamplingStats a -> Int)
-> ResultProperty m
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 SamplingStats a -> Int
forall a. SamplingStats a -> Int
samplingStatsCount,
      ResultContainer (ResultData (SamplingStats a) m) m
-> ResultName
-> ResultId
-> (SamplingStats a -> Double)
-> ResultProperty m
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 SamplingStats a -> Double
forall a. SamplingStats a -> Double
samplingStatsMean,
      ResultContainer (ResultData (SamplingStats a) m) m
-> ResultName
-> ResultId
-> (SamplingStats a -> Double)
-> ResultProperty m
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 SamplingStats a -> Double
forall a. SamplingStats a -> Double
samplingStatsMean2,
      ResultContainer (ResultData (SamplingStats a) m) m
-> ResultName
-> ResultId
-> (SamplingStats a -> Double)
-> ResultProperty m
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 SamplingStats a -> Double
forall a. SamplingStats a -> Double
samplingStatsDeviation,
      ResultContainer (ResultData (SamplingStats a) m) m
-> ResultName
-> ResultId
-> (SamplingStats a -> Double)
-> ResultProperty m
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 SamplingStats a -> Double
forall a. SamplingStats a -> Double
samplingStatsVariance,
      ResultContainer (ResultData (SamplingStats a) m) m
-> ResultName
-> ResultId
-> (SamplingStats a -> a)
-> ResultProperty m
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 SamplingStats a -> a
forall a. SamplingStats a -> a
samplingStatsMin,
      ResultContainer (ResultData (SamplingStats a) m) m
-> ResultName
-> ResultId
-> (SamplingStats a -> a)
-> ResultProperty m
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 SamplingStats a -> a
forall a. SamplingStats a -> a
samplingStatsMax ] }
  where
    c :: ResultContainer (ResultData (SamplingStats a) m) m
c = ResultValue (SamplingStats a) m
-> ResultContainer (ResultData (SamplingStats a) m) m
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 :: ResultValue (SamplingStats a) m -> ResultSource m
samplingStatsResultSummary = ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m)
-> (ResultValue (SamplingStats a) m -> ResultItem m)
-> ResultValue (SamplingStats a) m
-> ResultSource m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultValue ResultName m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue ResultName m -> ResultItem m)
-> (ResultValue (SamplingStats a) m -> ResultValue ResultName m)
-> ResultValue (SamplingStats a) m
-> ResultItem m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultValue (SamplingStats a) m -> ResultValue ResultName m
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 :: ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSource ResultValue (TimingStats a) m
x =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName      = ResultValue (TimingStats a) m -> ResultName
forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (TimingStats a) m
x,
    resultObjectId :: ResultId
resultObjectId        = ResultValue (TimingStats a) m -> ResultId
forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (TimingStats a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
TimingStatsId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = ResultValue (TimingStats a) m -> ResultSignal m
forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (TimingStats a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = ResultValue (TimingStats a) m -> ResultSource m
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 = [
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Int)
-> ResultProperty m
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 TimingStats a -> Int
forall a. TimingStats a -> Int
timingStatsCount,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingData a => TimingStats a -> Double
timingStatsMean,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingData a => TimingStats a -> Double
timingStatsDeviation,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingData a => TimingStats a -> Double
timingStatsVariance,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> a)
-> ResultProperty m
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 TimingStats a -> a
forall a. TimingStats a -> a
timingStatsMin,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> a)
-> ResultProperty m
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 TimingStats a -> a
forall a. TimingStats a -> a
timingStatsMax,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingStats a -> Double
timingStatsMinTime,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingStats a -> Double
timingStatsMaxTime,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingStats a -> Double
timingStatsStartTime,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingStats a -> Double
timingStatsLastTime,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingStats a -> Double
timingStatsSum,
      ResultContainer (ResultData (TimingStats a) m) m
-> ResultName
-> ResultId
-> (TimingStats a -> Double)
-> ResultProperty m
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 TimingStats a -> Double
forall a. TimingStats a -> Double
timingStatsSum2 ] }
  where
    c :: ResultContainer (ResultData (TimingStats a) m) m
c = ResultValue (TimingStats a) m
-> ResultContainer (ResultData (TimingStats a) m) m
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 :: ResultValue (TimingStats a) m -> ResultSource m
timingStatsResultSummary = ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m)
-> (ResultValue (TimingStats a) m -> ResultItem m)
-> ResultValue (TimingStats a) m
-> ResultSource m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultValue ResultName m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue ResultName m -> ResultItem m)
-> (ResultValue (TimingStats a) m -> ResultValue ResultName m)
-> ResultValue (TimingStats a) m
-> ResultItem m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResultValue (TimingStats a) m -> ResultValue ResultName m
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 :: ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource ResultValue (SamplingCounter a) m
x =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName      = ResultValue (SamplingCounter a) m -> ResultName
forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (SamplingCounter a) m
x,
    resultObjectId :: ResultId
resultObjectId        = ResultValue (SamplingCounter a) m -> ResultId
forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (SamplingCounter a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
SamplingCounterId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = ResultValue (SamplingCounter a) m -> ResultSignal m
forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (SamplingCounter a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = ResultValue (SamplingCounter a) m -> ResultSource m
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 = [
      ResultContainer (ResultData (SamplingCounter a) m) m
-> ResultName
-> ResultId
-> (SamplingCounter a -> a)
-> ResultProperty m
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 SamplingCounter a -> a
forall a. SamplingCounter a -> a
samplingCounterValue,
      ResultContainer (ResultData (SamplingCounter a) m) m
-> ResultName
-> ResultId
-> (SamplingCounter a -> SamplingStats a)
-> ResultProperty m
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 SamplingCounter a -> SamplingStats a
forall a. SamplingCounter a -> SamplingStats a
samplingCounterStats ] }
  where
    c :: ResultContainer (ResultData (SamplingCounter a) m) m
c = ResultValue (SamplingCounter a) m
-> ResultContainer (ResultData (SamplingCounter a) m) m
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 :: ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSummary ResultValue (SamplingCounter a) m
x =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName      = ResultValue (SamplingCounter a) m -> ResultName
forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (SamplingCounter a) m
x,
    resultObjectId :: ResultId
resultObjectId        = ResultValue (SamplingCounter a) m -> ResultId
forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (SamplingCounter a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
SamplingCounterId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = ResultValue (SamplingCounter a) m -> ResultSignal m
forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (SamplingCounter a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = ResultValue (SamplingCounter a) m -> ResultSource m
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 = [
      ResultContainer (ResultData (SamplingCounter a) m) m
-> ResultName
-> ResultId
-> (SamplingCounter a -> a)
-> ResultProperty m
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 SamplingCounter a -> a
forall a. SamplingCounter a -> a
samplingCounterValue,
      ResultContainer (ResultData (SamplingCounter a) m) m
-> ResultName
-> ResultId
-> (SamplingCounter a -> SamplingStats a)
-> ResultProperty m
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 SamplingCounter a -> SamplingStats a
forall a. SamplingCounter a -> SamplingStats a
samplingCounterStats ] }
  where
    c :: ResultContainer (ResultData (SamplingCounter a) m) m
c = ResultValue (SamplingCounter a) m
-> ResultContainer (ResultData (SamplingCounter a) m) m
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 :: ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource ResultValue (TimingCounter a) m
x =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName      = ResultValue (TimingCounter a) m -> ResultName
forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (TimingCounter a) m
x,
    resultObjectId :: ResultId
resultObjectId        = ResultValue (TimingCounter a) m -> ResultId
forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (TimingCounter a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
TimingCounterId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = ResultValue (TimingCounter a) m -> ResultSignal m
forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (TimingCounter a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = ResultValue (TimingCounter a) m -> ResultSource m
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 = [
      ResultContainer (ResultData (TimingCounter a) m) m
-> ResultName
-> ResultId
-> (TimingCounter a -> a)
-> ResultProperty m
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 TimingCounter a -> a
forall a. TimingCounter a -> a
timingCounterValue,
      ResultContainer (ResultData (TimingCounter a) m) m
-> ResultName
-> ResultId
-> (TimingCounter a -> TimingStats a)
-> ResultProperty m
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 TimingCounter a -> TimingStats a
forall a. TimingCounter a -> TimingStats a
timingCounterStats ] }
  where
    c :: ResultContainer (ResultData (TimingCounter a) m) m
c = ResultValue (TimingCounter a) m
-> ResultContainer (ResultData (TimingCounter a) m) m
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 :: ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSummary ResultValue (TimingCounter a) m
x =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName      = ResultValue (TimingCounter a) m -> ResultName
forall e (m :: * -> *). ResultValue e m -> ResultName
resultValueName ResultValue (TimingCounter a) m
x,
    resultObjectId :: ResultId
resultObjectId        = ResultValue (TimingCounter a) m -> ResultId
forall e (m :: * -> *). ResultValue e m -> ResultId
resultValueId ResultValue (TimingCounter a) m
x,
    resultObjectTypeId :: ResultId
resultObjectTypeId    = ResultId
TimingCounterId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal    = ResultValue (TimingCounter a) m -> ResultSignal m
forall e (m :: * -> *). ResultValue e m -> ResultSignal m
resultValueSignal ResultValue (TimingCounter a) m
x,
    resultObjectSummary :: ResultSource m
resultObjectSummary   = ResultValue (TimingCounter a) m -> ResultSource m
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 = [
      ResultContainer (ResultData (TimingCounter a) m) m
-> ResultName
-> ResultId
-> (TimingCounter a -> a)
-> ResultProperty m
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 TimingCounter a -> a
forall a. TimingCounter a -> a
timingCounterValue,
      ResultContainer (ResultData (TimingCounter a) m) m
-> ResultName
-> ResultId
-> (TimingCounter a -> TimingStats a)
-> ResultProperty m
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 TimingCounter a -> TimingStats a
forall a. TimingCounter a -> TimingStats a
timingCounterStats ] }
  where
    c :: ResultContainer (ResultData (TimingCounter a) m) m
c = ResultValue (TimingCounter a) m
-> ResultContainer (ResultData (TimingCounter a) m) m
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 :: ResultContainer (Queue m si sm so a) m -> ResultSource m
queueResultSource ResultContainer (Queue m si sm so a) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Queue m si sm so a) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m si sm so a) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Queue m si sm so a) m -> ResultId
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 = ResultContainer (Queue m si sm so a) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m si sm so a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Queue m si sm so a) m -> ResultSource m
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 = [
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> si)
-> ResultProperty m
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 Queue m si sm so a -> si
forall (m :: * -> *) si sm so a. Queue m si sm so a -> si
Q.enqueueStrategy,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> sm)
-> ResultProperty m
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 Queue m si sm so a -> sm
forall (m :: * -> *) si sm so a. Queue m si sm so a -> sm
Q.enqueueStoringStrategy,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> so)
-> ResultProperty m
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 Queue m si sm so a -> so
forall (m :: * -> *) si sm so a. Queue m si sm so a -> so
Q.dequeueStrategy,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Bool)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueNull" ResultId
QueueNullId Queue m si sm so a -> Event m Bool
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Bool
Q.queueNull Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueNullChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Bool)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueFull" ResultId
QueueFullId Queue m si sm so a -> Event m Bool
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Bool
Q.queueFull Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueFullChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Int)
-> ResultProperty m
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 Queue m si sm so a -> Int
forall (m :: * -> *) si sm so a. Queue m si sm so a -> Int
Q.queueMaxCount,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueCount" ResultId
QueueCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.queueCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m (TimingStats Int))
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueCountStats" ResultId
QueueCountStatsId Queue m si sm so a -> Event m (TimingStats Int)
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (TimingStats Int)
Q.queueCountStats Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueCount" ResultId
EnqueueCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueLostCount" ResultId
EnqueueLostCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueLostCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueLostCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueStoreCount" ResultId
EnqueueStoreCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueStoreCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueStoreCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueCount" ResultId
DequeueCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.dequeueCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueExtractCount" ResultId
DequeueExtractCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.dequeueExtractCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueExtractCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Double)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueLoadFactor" ResultId
QueueLoadFactorId Queue m si sm so a -> Event m Double
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.queueLoadFactor Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueLoadFactorChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueRate" ResultId
EnqueueRateId Queue m si sm so a -> Event m Double
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.enqueueRate,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueStoreRate" ResultId
EnqueueStoreRateId Queue m si sm so a -> Event m Double
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.enqueueStoreRate,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueRate" ResultId
DequeueRateId Queue m si sm so a -> Event m Double
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.dequeueRate,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueExtractRate" ResultId
DequeueExtractRateId Queue m si sm so a -> Event m Double
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.dequeueExtractRate,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m (SamplingStats Double))
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueWaitTime" ResultId
QueueWaitTimeId Queue m si sm so a -> Event m (SamplingStats Double)
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.queueWaitTime Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueWaitTimeChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m (SamplingStats Double))
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueTotalWaitTime" ResultId
QueueTotalWaitTimeId Queue m si sm so a -> Event m (SamplingStats Double)
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.queueTotalWaitTime Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueTotalWaitTimeChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m (SamplingStats Double))
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueWaitTime" ResultId
EnqueueWaitTimeId Queue m si sm so a -> Event m (SamplingStats Double)
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.enqueueWaitTime Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueWaitTimeChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m (SamplingStats Double))
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueWaitTime" ResultId
DequeueWaitTimeId Queue m si sm so a -> Event m (SamplingStats Double)
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.dequeueWaitTime Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueWaitTimeChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Double)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueRate" ResultId
QueueRateId Queue m si sm so a -> Event m Double
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.queueRate Queue m si sm so a -> Signal m ()
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 :: ResultContainer (Queue m si sm so a) m -> ResultSource m
queueResultSummary ResultContainer (Queue m si sm so a) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Queue m si sm so a) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m si sm so a) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Queue m si sm so a) m -> ResultId
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 = ResultContainer (Queue m si sm so a) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m si sm so a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Queue m si sm so a) m -> ResultSource m
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 = [
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Int)
-> ResultProperty m
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 Queue m si sm so a -> Int
forall (m :: * -> *) si sm so a. Queue m si sm so a -> Int
Q.queueMaxCount,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m (TimingStats Int))
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueCountStats" ResultId
QueueCountStatsId Queue m si sm so a -> Event m (TimingStats Int)
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (TimingStats Int)
Q.queueCountStats Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueCount" ResultId
EnqueueCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueLostCount" ResultId
EnqueueLostCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueLostCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueLostCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"enqueueStoreCount" ResultId
EnqueueStoreCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.enqueueStoreCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.enqueueStoreCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueCount" ResultId
DequeueCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.dequeueCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Int)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"dequeueExtractCount" ResultId
DequeueExtractCountId Queue m si sm so a -> Event m Int
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Int
Q.dequeueExtractCount Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.dequeueExtractCountChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Double)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueLoadFactor" ResultId
QueueLoadFactorId Queue m si sm so a -> Event m Double
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.queueLoadFactor Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueLoadFactorChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m (SamplingStats Double))
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueWaitTime" ResultId
QueueWaitTimeId Queue m si sm so a -> Event m (SamplingStats Double)
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m (SamplingStats Double)
Q.queueWaitTime Queue m si sm so a -> Signal m ()
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Signal m ()
Q.queueWaitTimeChanged_,
      ResultContainer (Queue m si sm so a) m
-> ResultName
-> ResultId
-> (Queue m si sm so a -> Event m Double)
-> (Queue m si sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m si sm so a) m
c ResultName
"queueRate" ResultId
QueueRateId Queue m si sm so a -> Event m Double
forall (m :: * -> *) si sm so a.
MonadDES m =>
Queue m si sm so a -> Event m Double
Q.queueRate Queue m si sm so a -> Signal m ()
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 :: ResultContainer (Queue m sm so a) m -> ResultSource m
infiniteQueueResultSource ResultContainer (Queue m sm so a) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Queue m sm so a) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m sm so a) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Queue m sm so a) m -> ResultId
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 = ResultContainer (Queue m sm so a) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m sm so a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Queue m sm so a) m -> ResultSource m
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 = [
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> sm)
-> ResultProperty m
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 Queue m sm so a -> sm
forall (m :: * -> *) sm so a. Queue m sm so a -> sm
IQ.enqueueStoringStrategy,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> so)
-> ResultProperty m
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 Queue m sm so a -> so
forall (m :: * -> *) sm so a. Queue m sm so a -> so
IQ.dequeueStrategy,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Bool)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"queueNull" ResultId
QueueNullId Queue m sm so a -> Event m Bool
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Bool
IQ.queueNull Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueNullChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Int)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"queueCount" ResultId
QueueCountId Queue m sm so a -> Event m Int
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.queueCount Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m (TimingStats Int))
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"queueCountStats" ResultId
QueueCountStatsId Queue m sm so a -> Event m (TimingStats Int)
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (TimingStats Int)
IQ.queueCountStats Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Int)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"enqueueStoreCount" ResultId
EnqueueStoreCountId Queue m sm so a -> Event m Int
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.enqueueStoreCount Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.enqueueStoreCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Int)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueCount" ResultId
DequeueCountId Queue m sm so a -> Event m Int
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.dequeueCount Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Int)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueExtractCount" ResultId
DequeueExtractCountId Queue m sm so a -> Event m Int
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.dequeueExtractCount Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueExtractCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m sm so a) m
c ResultName
"enqueueStoreRate" ResultId
EnqueueStoreRateId Queue m sm so a -> Event m Double
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.enqueueStoreRate,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueRate" ResultId
DequeueRateId Queue m sm so a -> Event m Double
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.dequeueRate,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Double)
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName -> ResultId -> (a -> Event m b) -> ResultProperty m
resultContainerIntegProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueExtractRate" ResultId
DequeueExtractRateId Queue m sm so a -> Event m Double
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.dequeueExtractRate,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m (SamplingStats Double))
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"queueWaitTime" ResultId
QueueWaitTimeId Queue m sm so a -> Event m (SamplingStats Double)
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (SamplingStats Double)
IQ.queueWaitTime Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueWaitTimeChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m (SamplingStats Double))
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueWaitTime" ResultId
DequeueWaitTimeId Queue m sm so a -> Event m (SamplingStats Double)
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (SamplingStats Double)
IQ.dequeueWaitTime Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueWaitTimeChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Double)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"queueRate" ResultId
QueueRateId Queue m sm so a -> Event m Double
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.queueRate Queue m sm so a -> Signal m ()
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 :: ResultContainer (Queue m sm so a) m -> ResultSource m
infiniteQueueResultSummary ResultContainer (Queue m sm so a) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Queue m sm so a) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Queue m sm so a) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Queue m sm so a) m -> ResultId
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 = ResultContainer (Queue m sm so a) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Queue m sm so a) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Queue m sm so a) m -> ResultSource m
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 = [
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m (TimingStats Int))
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"queueCountStats" ResultId
QueueCountStatsId Queue m sm so a -> Event m (TimingStats Int)
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (TimingStats Int)
IQ.queueCountStats Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Int)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"enqueueStoreCount" ResultId
EnqueueStoreCountId Queue m sm so a -> Event m Int
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.enqueueStoreCount Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.enqueueStoreCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Int)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueCount" ResultId
DequeueCountId Queue m sm so a -> Event m Int
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.dequeueCount Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Int)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"dequeueExtractCount" ResultId
DequeueExtractCountId Queue m sm so a -> Event m Int
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Int
IQ.dequeueExtractCount Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.dequeueExtractCountChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m (SamplingStats Double))
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"queueWaitTime" ResultId
QueueWaitTimeId Queue m sm so a -> Event m (SamplingStats Double)
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m (SamplingStats Double)
IQ.queueWaitTime Queue m sm so a -> Signal m ()
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Signal m ()
IQ.queueWaitTimeChanged_,
      ResultContainer (Queue m sm so a) m
-> ResultName
-> ResultId
-> (Queue m sm so a -> Event m Double)
-> (Queue m sm so a -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Queue m sm so a) m
c ResultName
"queueRate" ResultId
QueueRateId Queue m sm so a -> Event m Double
forall (m :: * -> *) sm so a.
MonadDES m =>
Queue m sm so a -> Event m Double
IQ.queueRate Queue m sm so a -> Signal m ()
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 :: ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSource ResultContainer (ArrivalTimer m) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (ArrivalTimer m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (ArrivalTimer m) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (ArrivalTimer m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (ArrivalTimer m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ArrivalTimerId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (ArrivalTimer m) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (ArrivalTimer m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (ArrivalTimer m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSummary ResultContainer (ArrivalTimer m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (ArrivalTimer m) m
-> ResultName
-> ResultId
-> (ArrivalTimer m -> Event m (SamplingStats Double))
-> (ArrivalTimer m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (ArrivalTimer m) m
c ResultName
"processingTime" ResultId
ArrivalProcessingTimeId ArrivalTimer m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadDES m =>
ArrivalTimer m -> Event m (SamplingStats Double)
arrivalProcessingTime ArrivalTimer m -> Signal m ()
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 :: ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSummary ResultContainer (ArrivalTimer m) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (ArrivalTimer m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (ArrivalTimer m) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (ArrivalTimer m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (ArrivalTimer m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ArrivalTimerId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (ArrivalTimer m) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (ArrivalTimer m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (ArrivalTimer m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSummary ResultContainer (ArrivalTimer m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (ArrivalTimer m) m
-> ResultName
-> ResultId
-> (ArrivalTimer m -> Event m (SamplingStats Double))
-> (ArrivalTimer m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (ArrivalTimer m) m
c ResultName
"processingTime" ResultId
ArrivalProcessingTimeId ArrivalTimer m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadDES m =>
ArrivalTimer m -> Event m (SamplingStats Double)
arrivalProcessingTime ArrivalTimer m -> Signal m ()
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 :: ResultContainer (Server m s a b) m -> ResultSource m
serverResultSource ResultContainer (Server m s a b) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Server m s a b) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Server m s a b) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Server m s a b) m -> ResultId
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 = ResultContainer (Server m s a b) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Server m s a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Server m s a b) m -> ResultSource m
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 = [
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> s)
-> ResultProperty m
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 Server m s a b -> s
forall (m :: * -> *) s a b. Server m s a b -> s
serverInitState,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m s)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"state" ResultId
ServerStateId Server m s a b -> Event m s
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m s
serverState Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverStateChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"totalInputWaitTime" ResultId
ServerTotalInputWaitTimeId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalInputWaitTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalInputWaitTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"totalProcessingTime" ResultId
ServerTotalProcessingTimeId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalProcessingTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalProcessingTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"totalOutputWaitTime" ResultId
ServerTotalOutputWaitTimeId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalOutputWaitTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalOutputWaitTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"totalPreemptionTime" ResultId
ServerTotalPreemptionTimeId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalPreemptionTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalPreemptionTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m (SamplingStats Double))
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"inputWaitTime" ResultId
ServerInputWaitTimeId Server m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverInputWaitTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m (SamplingStats Double))
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"processingTime" ResultId
ServerProcessingTimeId Server m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverProcessingTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m (SamplingStats Double))
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"outputWaitTime" ResultId
ServerOutputWaitTimeId Server m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverOutputWaitTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m (SamplingStats Double))
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"preemptionTime" ResultId
ServerPreemptionTimeId Server m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverPreemptionTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"inputWaitFactor" ResultId
ServerInputWaitFactorId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverInputWaitFactor Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitFactorChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"processingFactor" ResultId
ServerProcessingFactorId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverProcessingFactor Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingFactorChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"outputWaitFactor" ResultId
ServerOutputWaitFactorId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverOutputWaitFactor Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitFactorChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"preemptionFactor" ResultId
ServerPreemptionFactorId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverPreemptionFactor Server m s a b -> Signal m ()
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 :: ResultContainer (Server m s a b) m -> ResultSource m
serverResultSummary ResultContainer (Server m s a b) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Server m s a b) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Server m s a b) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Server m s a b) m -> ResultId
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 = ResultContainer (Server m s a b) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Server m s a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Server m s a b) m -> ResultSource m
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 = [
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m (SamplingStats Double))
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"inputWaitTime" ResultId
ServerInputWaitTimeId Server m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverInputWaitTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m (SamplingStats Double))
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"processingTime" ResultId
ServerProcessingTimeId Server m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverProcessingTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m (SamplingStats Double))
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"outputWaitTime" ResultId
ServerOutputWaitTimeId Server m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverOutputWaitTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m (SamplingStats Double))
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"preemptionTime" ResultId
ServerPreemptionTimeId Server m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverPreemptionTime Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionTimeChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"inputWaitFactor" ResultId
ServerInputWaitFactorId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverInputWaitFactor Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitFactorChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"processingFactor" ResultId
ServerProcessingFactorId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverProcessingFactor Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingFactorChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"outputWaitFactor" ResultId
ServerOutputWaitFactorId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverOutputWaitFactor Server m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitFactorChanged_,
      ResultContainer (Server m s a b) m
-> ResultName
-> ResultId
-> (Server m s a b -> Event m Double)
-> (Server m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Server m s a b) m
c ResultName
"preemptionFactor" ResultId
ServerPreemptionFactorId Server m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverPreemptionFactor Server m s a b -> Signal m ()
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 :: ResultContainer (Activity m s a b) m -> ResultSource m
activityResultSource ResultContainer (Activity m s a b) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Activity m s a b) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Activity m s a b) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Activity m s a b) m -> ResultId
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 = ResultContainer (Activity m s a b) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Activity m s a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Activity m s a b) m -> ResultSource m
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 = [
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> s)
-> ResultProperty m
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 Activity m s a b -> s
forall (m :: * -> *) s a b. Activity m s a b -> s
activityInitState,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m s)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"state" ResultId
ActivityStateId Activity m s a b -> Event m s
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m s
activityState Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityStateChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"totalUtilisationTime" ResultId
ActivityTotalUtilisationTimeId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityTotalUtilisationTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityTotalUtilisationTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"totalIdleTime" ResultId
ActivityTotalIdleTimeId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityTotalIdleTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityTotalIdleTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"totalPreemptionTime" ResultId
ActivityTotalPreemptionTimeId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityTotalPreemptionTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityTotalPreemptionTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m (SamplingStats Double))
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"utilisationTime" ResultId
ActivityUtilisationTimeId Activity m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityUtilisationTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityUtilisationTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m (SamplingStats Double))
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"idleTime" ResultId
ActivityIdleTimeId Activity m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityIdleTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityIdleTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m (SamplingStats Double))
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"preemptionTime" ResultId
ActivityPreemptionTimeId Activity m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityPreemptionTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityPreemptionTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"utilisationFactor" ResultId
ActivityUtilisationFactorId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityUtilisationFactor Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityUtilisationFactorChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"idleFactor" ResultId
ActivityIdleFactorId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityIdleFactor Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityIdleFactorChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"preemptionFactor" ResultId
ActivityPreemptionFactorId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityPreemptionFactor Activity m s a b -> Signal m ()
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 :: ResultContainer (Activity m s a b) m -> ResultSource m
activityResultSummary ResultContainer (Activity m s a b) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Activity m s a b) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Activity m s a b) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Activity m s a b) m -> ResultId
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 = ResultContainer (Activity m s a b) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Activity m s a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Activity m s a b) m -> ResultSource m
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 = [
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m (SamplingStats Double))
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"utilisationTime" ResultId
ActivityUtilisationTimeId Activity m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityUtilisationTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityUtilisationTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m (SamplingStats Double))
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"idleTime" ResultId
ActivityIdleTimeId Activity m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityIdleTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityIdleTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m (SamplingStats Double))
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"preemptionTime" ResultId
ActivityPreemptionTimeId Activity m s a b -> Event m (SamplingStats Double)
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m (SamplingStats Double)
activityPreemptionTime Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityPreemptionTimeChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"utilisationFactor" ResultId
ActivityUtilisationFactorId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityUtilisationFactor Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityUtilisationFactorChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"idleFactor" ResultId
ActivityIdleFactorId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityIdleFactor Activity m s a b -> Signal m ()
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Signal m ()
activityIdleFactorChanged_,
      ResultContainer (Activity m s a b) m
-> ResultName
-> ResultId
-> (Activity m s a b -> Event m Double)
-> (Activity m s a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Activity m s a b) m
c ResultName
"preemptionFactor" ResultId
ActivityPreemptionFactorId Activity m s a b -> Event m Double
forall (m :: * -> *) s a b.
MonadDES m =>
Activity m s a b -> Event m Double
activityPreemptionFactor Activity m s a b -> Signal m ()
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 :: ResultContainer (Resource m s) m -> ResultSource m
resourceResultSource ResultContainer (Resource m s) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Resource m s) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Resource m s) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Resource m s) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Resource m s) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ResourceId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Resource m s) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Resource m s) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Resource m s) m -> ResultSource m
forall (m :: * -> *) s.
MonadDES m =>
ResultContainer (Resource m s) m -> ResultSource m
resourceResultSummary ResultContainer (Resource m s) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m Int)
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"queueCount" ResultId
ResourceQueueCountId Resource m s -> Event m Int
forall (m :: * -> *) s. MonadDES m => Resource m s -> Event m Int
resourceQueueCount Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceQueueCountChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m (TimingStats Int))
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"queueCountStats" ResultId
ResourceQueueCountStatsId Resource m s -> Event m (TimingStats Int)
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceQueueCountStats Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceQueueCountChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m Double)
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"totalWaitTime" ResultId
ResourceTotalWaitTimeId Resource m s -> Event m Double
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m Double
resourceTotalWaitTime Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceWaitTimeChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m (SamplingStats Double))
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"waitTime" ResultId
ResourceWaitTimeId Resource m s -> Event m (SamplingStats Double)
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (SamplingStats Double)
resourceWaitTime Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceWaitTimeChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m Int)
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"count" ResultId
ResourceCountId Resource m s -> Event m Int
forall (m :: * -> *) s. MonadDES m => Resource m s -> Event m Int
resourceCount Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceCountChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m (TimingStats Int))
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"countStats" ResultId
ResourceCountStatsId Resource m s -> Event m (TimingStats Int)
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceCountStats Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceCountChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m Int)
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"utilisationCount" ResultId
ResourceUtilisationCountId Resource m s -> Event m Int
forall (m :: * -> *) s. MonadDES m => Resource m s -> Event m Int
resourceUtilisationCount Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceUtilisationCountChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m (TimingStats Int))
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"utilisationCountStats" ResultId
ResourceUtilisationCountStatsId Resource m s -> Event m (TimingStats Int)
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceUtilisationCountStats Resource m s -> Signal m ()
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 :: ResultContainer (Resource m s) m -> ResultSource m
resourceResultSummary ResultContainer (Resource m s) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Resource m s) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Resource m s) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Resource m s) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Resource m s) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ResourceId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Resource m s) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Resource m s) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Resource m s) m -> ResultSource m
forall (m :: * -> *) s.
MonadDES m =>
ResultContainer (Resource m s) m -> ResultSource m
resourceResultSummary ResultContainer (Resource m s) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m (TimingStats Int))
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"queueCountStats" ResultId
ResourceQueueCountStatsId Resource m s -> Event m (TimingStats Int)
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceQueueCountStats Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceQueueCountChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m (SamplingStats Double))
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"waitTime" ResultId
ResourceWaitTimeId Resource m s -> Event m (SamplingStats Double)
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (SamplingStats Double)
resourceWaitTime Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceWaitTimeChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m (TimingStats Int))
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"countStats" ResultId
ResourceCountStatsId Resource m s -> Event m (TimingStats Int)
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceCountStats Resource m s -> Signal m ()
forall (m :: * -> *) s. MonadDES m => Resource m s -> Signal m ()
resourceCountChanged_,
      ResultContainer (Resource m s) m
-> ResultName
-> ResultId
-> (Resource m s -> Event m (TimingStats Int))
-> (Resource m s -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m s) m
c ResultName
"utilisationCountStats" ResultId
ResourceUtilisationCountStatsId Resource m s -> Event m (TimingStats Int)
forall (m :: * -> *) s.
MonadDES m =>
Resource m s -> Event m (TimingStats Int)
resourceUtilisationCountStats Resource m s -> Signal m ()
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 :: ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSource ResultContainer (Resource m) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Resource m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Resource m) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Resource m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Resource m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ResourceId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Resource m) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Resource m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Resource m) m -> ResultSource m
forall (m :: * -> *).
MonadResource m =>
ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSummary ResultContainer (Resource m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m Int)
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"queueCount" ResultId
ResourceQueueCountId Resource m -> Event m Int
forall (m :: * -> *). MonadResource m => Resource m -> Event m Int
PR.resourceQueueCount Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceQueueCountChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m (TimingStats Int))
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"queueCountStats" ResultId
ResourceQueueCountStatsId Resource m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceQueueCountStats Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceQueueCountChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m Double)
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"totalWaitTime" ResultId
ResourceTotalWaitTimeId Resource m -> Event m Double
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m Double
PR.resourceTotalWaitTime Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceWaitTimeChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m (SamplingStats Double))
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"waitTime" ResultId
ResourceWaitTimeId Resource m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (SamplingStats Double)
PR.resourceWaitTime Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceWaitTimeChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m Int)
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"count" ResultId
ResourceCountId Resource m -> Event m Int
forall (m :: * -> *). MonadResource m => Resource m -> Event m Int
PR.resourceCount Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceCountChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m (TimingStats Int))
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"countStats" ResultId
ResourceCountStatsId Resource m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceCountStats Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceCountChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m Int)
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"utilisationCount" ResultId
ResourceUtilisationCountId Resource m -> Event m Int
forall (m :: * -> *). MonadResource m => Resource m -> Event m Int
PR.resourceUtilisationCount Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceUtilisationCountChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m (TimingStats Int))
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"utilisationCountStats" ResultId
ResourceUtilisationCountStatsId Resource m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceUtilisationCountStats Resource m -> Signal m ()
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 :: ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSummary ResultContainer (Resource m) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Resource m) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Resource m) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Resource m) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Resource m) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
ResourceId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Resource m) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Resource m) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Resource m) m -> ResultSource m
forall (m :: * -> *).
MonadResource m =>
ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSummary ResultContainer (Resource m) m
c,
    resultObjectProperties :: [ResultProperty m]
resultObjectProperties = [
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m (TimingStats Int))
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"queueCountStats" ResultId
ResourceQueueCountStatsId Resource m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceQueueCountStats Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceQueueCountChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m (SamplingStats Double))
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"waitTime" ResultId
ResourceWaitTimeId Resource m -> Event m (SamplingStats Double)
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (SamplingStats Double)
PR.resourceWaitTime Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceWaitTimeChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m (TimingStats Int))
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"countStats" ResultId
ResourceCountStatsId Resource m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceCountStats Resource m -> Signal m ()
forall (m :: * -> *). MonadResource m => Resource m -> Signal m ()
PR.resourceCountChanged_,
      ResultContainer (Resource m) m
-> ResultName
-> ResultId
-> (Resource m -> Event m (TimingStats Int))
-> (Resource m -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Resource m) m
c ResultName
"utilisationCountStats" ResultId
ResourceUtilisationCountStatsId Resource m -> Event m (TimingStats Int)
forall (m :: * -> *).
MonadResource m =>
Resource m -> Event m (TimingStats Int)
PR.resourceUtilisationCountStats Resource m -> Signal m ()
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 :: ResultContainer (Operation m a b) m -> ResultSource m
operationResultSource ResultContainer (Operation m a b) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Operation m a b) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Operation m a b) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Operation m a b) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Operation m a b) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
OperationId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Operation m a b) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Operation m a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Operation m a b) m -> ResultSource m
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 = [
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m Double)
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"totalUtilisationTime" ResultId
OperationTotalUtilisationTimeId Operation m a b -> Event m Double
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationTotalUtilisationTime Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationTotalUtilisationTimeChanged_,
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m Double)
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"totalPreemptionTime" ResultId
OperationTotalPreemptionTimeId Operation m a b -> Event m Double
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationTotalPreemptionTime Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationTotalPreemptionTimeChanged_,
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m (SamplingStats Double))
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"utilisationTime" ResultId
OperationUtilisationTimeId Operation m a b -> Event m (SamplingStats Double)
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m (SamplingStats Double)
operationUtilisationTime Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationUtilisationTimeChanged_,
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m (SamplingStats Double))
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"preemptionTime" ResultId
OperationPreemptionTimeId Operation m a b -> Event m (SamplingStats Double)
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m (SamplingStats Double)
operationPreemptionTime Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationPreemptionTimeChanged_,
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m Double)
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"utilisationFactor" ResultId
OperationUtilisationFactorId Operation m a b -> Event m Double
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationUtilisationFactor Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationUtilisationFactorChanged_,
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m Double)
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"preemptionFactor" ResultId
OperationPreemptionFactorId Operation m a b -> Event m Double
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationPreemptionFactor Operation m a b -> Signal m ()
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 :: ResultContainer (Operation m a b) m -> ResultSource m
operationResultSummary ResultContainer (Operation m a b) m
c =
  ResultObject m -> ResultSource m
forall (m :: * -> *). ResultObject m -> ResultSource m
ResultObjectSource (ResultObject m -> ResultSource m)
-> ResultObject m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultObject :: forall (m :: * -> *).
ResultName
-> ResultId
-> ResultId
-> [ResultProperty m]
-> ResultSignal m
-> ResultSource m
-> ResultObject m
ResultObject {
    resultObjectName :: ResultName
resultObjectName = ResultContainer (Operation m a b) m -> ResultName
forall e (m :: * -> *). ResultContainer e m -> ResultName
resultContainerName ResultContainer (Operation m a b) m
c,
    resultObjectId :: ResultId
resultObjectId = ResultContainer (Operation m a b) m -> ResultId
forall e (m :: * -> *). ResultContainer e m -> ResultId
resultContainerId ResultContainer (Operation m a b) m
c,
    resultObjectTypeId :: ResultId
resultObjectTypeId = ResultId
OperationId,
    resultObjectSignal :: ResultSignal m
resultObjectSignal = ResultContainer (Operation m a b) m -> ResultSignal m
forall e (m :: * -> *). ResultContainer e m -> ResultSignal m
resultContainerSignal ResultContainer (Operation m a b) m
c,
    resultObjectSummary :: ResultSource m
resultObjectSummary = ResultContainer (Operation m a b) m -> ResultSource m
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 = [
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m (SamplingStats Double))
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"utilisationTime" ResultId
OperationUtilisationTimeId Operation m a b -> Event m (SamplingStats Double)
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m (SamplingStats Double)
operationUtilisationTime Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationUtilisationTimeChanged_,
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m (SamplingStats Double))
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"preemptionTime" ResultId
OperationPreemptionTimeId Operation m a b -> Event m (SamplingStats Double)
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m (SamplingStats Double)
operationPreemptionTime Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationPreemptionTimeChanged_,
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m Double)
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"utilisationFactor" ResultId
OperationUtilisationFactorId Operation m a b -> Event m Double
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationUtilisationFactor Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationUtilisationFactorChanged_,
      ResultContainer (Operation m a b) m
-> ResultName
-> ResultId
-> (Operation m a b -> Event m Double)
-> (Operation m a b -> Signal m ())
-> ResultProperty m
forall (m :: * -> *) b a.
(MonadDES m, ResultItemable (ResultValue b)) =>
ResultContainer a m
-> ResultName
-> ResultId
-> (a -> Event m b)
-> (a -> Signal m ())
-> ResultProperty m
resultContainerProperty ResultContainer (Operation m a b) m
c ResultName
"preemptionFactor" ResultId
OperationPreemptionFactorId Operation m a b -> Event m Double
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Event m Double
operationPreemptionFactor Operation m a b -> Signal m ()
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 :: ResultName -> ResultSource m
textResultSource ResultName
text =
  ResultSeparator -> ResultSource m
forall (m :: * -> *). ResultSeparator -> ResultSource m
ResultSeparatorSource (ResultSeparator -> ResultSource m)
-> ResultSeparator -> ResultSource m
forall a b. (a -> b) -> a -> b
$
  ResultSeparator :: ResultName -> ResultSeparator
ResultSeparator { resultSeparatorText :: ResultName
resultSeparatorText = ResultName
text }

-- | Return the source of the modeling time.
timeResultSource :: MonadDES m => ResultSource m
timeResultSource :: ResultSource m
timeResultSource = ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m Double
-> ResultSource m
forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
"t" [ResultName
"t"] ResultId
TimeId [ResultId
TimeId] Dynamics m Double
forall (m :: * -> *). Monad m => Dynamics m Double
time
                         
-- | Make an integer subscript
intSubscript :: Int -> ResultName
intSubscript :: Int -> ResultName
intSubscript Int
i = ResultName
"[" ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ Int -> ResultName
forall a. Show a => a -> ResultName
show Int
i ResultName -> ResultName -> ResultName
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue a m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue a m -> ResultItem m)
-> ResultValue a m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m a
-> ResultValue a m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue a m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue a m -> ResultItem m)
-> ResultValue a m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m a
-> ResultValue a m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue a m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue a m -> ResultItem m)
-> ResultValue a m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m a
-> ResultValue a m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue a m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue a m -> ResultItem m)
-> ResultValue a m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m a
-> ResultValue a m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue a m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue a m -> ResultItem m)
-> ResultValue a m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m a
-> ResultValue a m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue a m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue a m -> ResultItem m)
-> ResultValue a m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m a
-> ResultValue a m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue a m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue a m -> ResultItem m)
-> ResultValue a m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m a
-> ResultValue a m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue a m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue a m -> ResultItem m)
-> ResultValue a m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m a
-> ResultValue a m
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 =
    ResultValue (SamplingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource (ResultValue (SamplingCounter a) m -> ResultSource m)
-> ResultValue (SamplingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m (SamplingCounter a)
-> ResultValue (SamplingCounter a) m
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 =
    ResultValue (SamplingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource (ResultValue (SamplingCounter a) m -> ResultSource m)
-> ResultValue (SamplingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m (SamplingCounter a)
-> ResultValue (SamplingCounter a) m
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 =
    ResultValue (SamplingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource (ResultValue (SamplingCounter a) m -> ResultSource m)
-> ResultValue (SamplingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m (SamplingCounter a)
-> ResultValue (SamplingCounter a) m
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 =
    ResultValue (SamplingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource (ResultValue (SamplingCounter a) m -> ResultSource m)
-> ResultValue (SamplingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m (SamplingCounter a)
-> ResultValue (SamplingCounter a) m
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 =
    ResultValue (SamplingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource (ResultValue (SamplingCounter a) m -> ResultSource m)
-> ResultValue (SamplingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (SamplingCounter a)
-> ResultValue (SamplingCounter a) m
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 =
    ResultValue (SamplingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource (ResultValue (SamplingCounter a) m -> ResultSource m)
-> ResultValue (SamplingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (SamplingCounter a)
-> ResultValue (SamplingCounter a) m
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 =
    ResultValue (SamplingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource (ResultValue (SamplingCounter a) m -> ResultSource m)
-> ResultValue (SamplingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m (SamplingCounter a)
-> ResultValue (SamplingCounter a) m
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 =
    ResultValue (SamplingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (SamplingStats a))) =>
ResultValue (SamplingCounter a) m -> ResultSource m
samplingCounterResultSource (ResultValue (SamplingCounter a) m -> ResultSource m)
-> ResultValue (SamplingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m (SamplingCounter a)
-> ResultValue (SamplingCounter a) m
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 =
    ResultValue (TimingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource (ResultValue (TimingCounter a) m -> ResultSource m)
-> ResultValue (TimingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m (TimingCounter a)
-> ResultValue (TimingCounter a) m
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 =
    ResultValue (TimingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource (ResultValue (TimingCounter a) m -> ResultSource m)
-> ResultValue (TimingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m (TimingCounter a)
-> ResultValue (TimingCounter a) m
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 =
    ResultValue (TimingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource (ResultValue (TimingCounter a) m -> ResultSource m)
-> ResultValue (TimingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m (TimingCounter a)
-> ResultValue (TimingCounter a) m
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 =
    ResultValue (TimingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource (ResultValue (TimingCounter a) m -> ResultSource m)
-> ResultValue (TimingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m (TimingCounter a)
-> ResultValue (TimingCounter a) m
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 =
    ResultValue (TimingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource (ResultValue (TimingCounter a) m -> ResultSource m)
-> ResultValue (TimingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (TimingCounter a)
-> ResultValue (TimingCounter a) m
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 =
    ResultValue (TimingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource (ResultValue (TimingCounter a) m -> ResultSource m)
-> ResultValue (TimingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (TimingCounter a)
-> ResultValue (TimingCounter a) m
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 =
    ResultValue (TimingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource (ResultValue (TimingCounter a) m -> ResultSource m)
-> ResultValue (TimingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m (TimingCounter a)
-> ResultValue (TimingCounter a) m
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 =
    ResultValue (TimingCounter a) m -> ResultSource m
forall (m :: * -> *) a.
(MonadDES m, ResultItemable (ResultValue a),
 ResultItemable (ResultValue (TimingStats a))) =>
ResultValue (TimingCounter a) m -> ResultSource m
timingCounterResultSource (ResultValue (TimingCounter a) m -> ResultSource m)
-> ResultValue (TimingCounter a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m (TimingCounter a)
-> ResultValue (TimingCounter a) m
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 =
    ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultListWithSubscript p
-> ResultSource m
forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is (ResultListWithSubscript p -> ResultSource m)
-> ResultListWithSubscript p -> ResultSource m
forall a b. (a -> b) -> a -> b
$ [p] -> [ResultName] -> ResultListWithSubscript p
forall p. [p] -> [ResultName] -> ResultListWithSubscript p
ResultListWithSubscript [p]
m [ResultName]
subscript where
      subscript :: [ResultName]
subscript = ((p, ResultName) -> ResultName)
-> [(p, ResultName)] -> [ResultName]
forall a b. (a -> b) -> [a] -> [b]
map (p, ResultName) -> ResultName
forall a b. (a, b) -> b
snd ([(p, ResultName)] -> [ResultName])
-> [(p, ResultName)] -> [ResultName]
forall a b. (a -> b) -> a -> b
$ [p] -> [ResultName] -> [(p, ResultName)]
forall a b. [a] -> [b] -> [(a, b)]
zip [p]
m ([ResultName] -> [(p, ResultName)])
-> [ResultName] -> [(p, ResultName)]
forall a b. (a -> b) -> a -> b
$ (Int -> ResultName) -> [Int] -> [ResultName]
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 =
    ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultListWithSubscript p
-> ResultSource m
forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is (ResultListWithSubscript p -> ResultSource m)
-> ResultListWithSubscript p -> ResultSource m
forall a b. (a -> b) -> a -> b
$ [p] -> [ResultName] -> ResultListWithSubscript p
forall p. [p] -> [ResultName] -> ResultListWithSubscript p
ResultListWithSubscript [p]
items [ResultName]
subscript where
      items :: [p]
items = Array i p -> [p]
forall i e. Array i e -> [e]
A.elems Array i p
m
      subscript :: [ResultName]
subscript = (i -> ResultName) -> [i] -> [ResultName]
forall a b. (a -> b) -> [a] -> [b]
map (\i
i -> ResultName
"[" ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ i -> ResultName
forall a. Show a => a -> ResultName
show i
i ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultName
"]") (Array i p -> [i]
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 =
    ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultVectorWithSubscript p
-> ResultSource m
forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is (ResultVectorWithSubscript p -> ResultSource m)
-> ResultVectorWithSubscript p -> ResultSource m
forall a b. (a -> b) -> a -> b
$ Vector p -> Vector ResultName -> ResultVectorWithSubscript p
forall p.
Vector p -> Vector ResultName -> ResultVectorWithSubscript p
ResultVectorWithSubscript Vector p
m Vector ResultName
subscript where
      subscript :: Vector ResultName
subscript = (Int -> p -> ResultName) -> Vector p -> Vector ResultName
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) =
    ResultVector m -> ResultSource m
forall (m :: * -> *). ResultVector m -> ResultSource m
ResultVectorSource (ResultVector m -> ResultSource m)
-> ResultVector m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
    ResultVector m -> ResultVector m
forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSignal (ResultVector m -> ResultVector m)
-> ResultVector m -> ResultVector m
forall a b. (a -> b) -> a -> b
$
    ResultVector m -> ResultVector m
forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSummary (ResultVector m -> ResultVector m)
-> ResultVector m -> ResultVector m
forall a b. (a -> b) -> a -> b
$
    ResultVector :: forall (m :: * -> *).
ResultName
-> ResultId
-> Array Int (ResultSource m)
-> Array Int ResultName
-> ResultSignal m
-> ResultSource m
-> ResultVector m
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 = ResultSignal m
forall a. HasCallStack => a
undefined,
                   resultVectorSummary :: ResultSource m
resultVectorSummary = ResultSource m
forall a. HasCallStack => a
undefined }
    where
      bnds :: (Int, Int)
bnds   = (Int
0, [p] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [p]
xs Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1)
      axs :: Array Int (ResultSource m)
axs    = (Int, Int) -> [ResultSource m] -> Array Int (ResultSource m)
forall i e. Ix i => (i, i) -> [e] -> Array i e
A.listArray (Int, Int)
bnds [ResultSource m]
items
      ays :: Array Int ResultName
ays    = (Int, Int) -> [ResultName] -> Array Int ResultName
forall i e. Ix i => (i, i) -> [e] -> Array i e
A.listArray (Int, Int)
bnds [ResultName]
ys
      items :: [ResultSource m]
items  =
        (((ResultName, p) -> ResultSource m)
 -> [(ResultName, p)] -> [ResultSource m])
-> [(ResultName, p)]
-> ((ResultName, p) -> ResultSource m)
-> [ResultSource m]
forall a b c. (a -> b -> c) -> b -> a -> c
flip ((ResultName, p) -> ResultSource m)
-> [(ResultName, p)] -> [ResultSource m]
forall a b. (a -> b) -> [a] -> [b]
map ([ResultName] -> [p] -> [(ResultName, p)]
forall a b. [a] -> [b] -> [(a, b)]
zip [ResultName]
ys [p]
xs) (((ResultName, p) -> ResultSource m) -> [ResultSource m])
-> ((ResultName, p) -> ResultSource m) -> [ResultSource m]
forall a b. (a -> b) -> a -> b
$ \(ResultName
y, p
x) ->
        let name' :: ResultName
name'  = ResultName
name ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultName
y
            names' :: [ResultName]
names' = [ResultName]
names [ResultName] -> [ResultName] -> [ResultName]
forall a. [a] -> [a] -> [a]
++ [ResultName
y]
            i' :: ResultId
i'  = ResultName -> ResultId
VectorItemId ResultName
y
            is' :: [ResultId]
is' = [ResultId]
is [ResultId] -> [ResultId] -> [ResultId]
forall a. [a] -> [a] -> [a]
++ [ResultId
i']
        in ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
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' = (ResultSource m -> ResultSource m)
-> [ResultSource m] -> [ResultSource m]
forall a b. (a -> b) -> [a] -> [b]
map ResultSource m -> ResultSource m
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) =
    ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ResultListWithSubscript p
-> ResultSource m
forall p (m :: * -> *).
ResultProvider p m =>
ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
resultSource' ResultName
name [ResultName]
names ResultId
i [ResultId]
is (ResultListWithSubscript p -> ResultSource m)
-> ResultListWithSubscript p -> ResultSource m
forall a b. (a -> b) -> a -> b
$ [p] -> [ResultName] -> ResultListWithSubscript p
forall p. [p] -> [ResultName] -> ResultListWithSubscript p
ResultListWithSubscript [p]
items [ResultName]
subscript where
      items :: [p]
items = Array i p -> [p]
forall i e. Array i e -> [e]
A.elems Array i p
xs
      subscript :: [ResultName]
subscript = Array i ResultName -> [ResultName]
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) =
    ResultVector m -> ResultSource m
forall (m :: * -> *). ResultVector m -> ResultSource m
ResultVectorSource (ResultVector m -> ResultSource m)
-> ResultVector m -> ResultSource m
forall a b. (a -> b) -> a -> b
$
    ResultVector m -> ResultVector m
forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSignal (ResultVector m -> ResultVector m)
-> ResultVector m -> ResultVector m
forall a b. (a -> b) -> a -> b
$
    ResultVector m -> ResultVector m
forall (m :: * -> *).
MonadDES m =>
ResultVector m -> ResultVector m
memoResultVectorSummary (ResultVector m -> ResultVector m)
-> ResultVector m -> ResultVector m
forall a b. (a -> b) -> a -> b
$
    ResultVector :: forall (m :: * -> *).
ResultName
-> ResultId
-> Array Int (ResultSource m)
-> Array Int ResultName
-> ResultSignal m
-> ResultSource m
-> ResultVector m
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 = ResultSignal m
forall a. HasCallStack => a
undefined,
                   resultVectorSummary :: ResultSource m
resultVectorSummary = ResultSource m
forall a. HasCallStack => a
undefined }
    where
      bnds :: (Int, Int)
bnds   = (Int
0, Vector p -> Int
forall a. Vector a -> Int
V.length Vector p
xs Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1)
      axs :: Array Int (ResultSource m)
axs    = (Int, Int) -> [ResultSource m] -> Array Int (ResultSource m)
forall i e. Ix i => (i, i) -> [e] -> Array i e
A.listArray (Int, Int)
bnds (Vector (ResultSource m) -> [ResultSource m]
forall a. Vector a -> [a]
V.toList Vector (ResultSource m)
items)
      ays :: Array Int ResultName
ays    = (Int, Int) -> [ResultName] -> Array Int ResultName
forall i e. Ix i => (i, i) -> [e] -> Array i e
A.listArray (Int, Int)
bnds (Vector ResultName -> [ResultName]
forall a. Vector a -> [a]
V.toList Vector ResultName
ys)
      items :: Vector (ResultSource m)
items =
        Int -> (Int -> ResultSource m) -> Vector (ResultSource m)
forall a. Int -> (Int -> a) -> Vector a
V.generate (Vector p -> Int
forall a. Vector a -> Int
V.length Vector p
xs) ((Int -> ResultSource m) -> Vector (ResultSource m))
-> (Int -> ResultSource m) -> Vector (ResultSource m)
forall a b. (a -> b) -> a -> b
$ \Int
i ->
        let x :: p
x = Vector p
xs Vector p -> Int -> p
forall a. Vector a -> Int -> a
V.! Int
i
            y :: ResultName
y = Vector ResultName
ys Vector ResultName -> Int -> ResultName
forall a. Vector a -> Int -> a
V.! Int
i
            name' :: ResultName
name'  = ResultName
name ResultName -> ResultName -> ResultName
forall a. [a] -> [a] -> [a]
++ ResultName
y
            names' :: [ResultName]
names' = [ResultName]
names [ResultName] -> [ResultName] -> [ResultName]
forall a. [a] -> [a] -> [a]
++ [ResultName
y]
            i' :: ResultId
i'  = ResultName -> ResultId
VectorItemId ResultName
y
            is' :: [ResultId]
is' = [ResultId]
is [ResultId] -> [ResultId] -> [ResultId]
forall a. [a] -> [a] -> [a]
++ [ResultId
i']
        in ResultName
-> [ResultName] -> ResultId -> [ResultId] -> p -> ResultSource m
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' = (ResultSource m -> ResultSource m)
-> Vector (ResultSource m) -> Vector (ResultSource m)
forall a b. (a -> b) -> Vector a -> Vector b
V.map ResultSource m -> ResultSource m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Array i e -> [e])
-> ResultValue (Array i e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Array i e -> [e]
forall i e. Array i e -> [e]
A.elems (ResultValue (Array i e) m -> ResultValue [e] m)
-> ResultValue (Array i e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m (Array i e)
-> ResultValue (Array i e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Array i e -> [e])
-> ResultValue (Array i e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Array i e -> [e]
forall i e. Array i e -> [e]
A.elems (ResultValue (Array i e) m -> ResultValue [e] m)
-> ResultValue (Array i e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m (Array i e)
-> ResultValue (Array i e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Array i e -> [e])
-> ResultValue (Array i e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Array i e -> [e]
forall i e. Array i e -> [e]
A.elems (ResultValue (Array i e) m -> ResultValue [e] m)
-> ResultValue (Array i e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m (Array i e)
-> ResultValue (Array i e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Array i e -> [e])
-> ResultValue (Array i e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Array i e -> [e]
forall i e. Array i e -> [e]
A.elems (ResultValue (Array i e) m -> ResultValue [e] m)
-> ResultValue (Array i e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m (Array i e)
-> ResultValue (Array i e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Array i e -> [e])
-> ResultValue (Array i e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Array i e -> [e]
forall i e. Array i e -> [e]
A.elems (ResultValue (Array i e) m -> ResultValue [e] m)
-> ResultValue (Array i e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (Array i e)
-> ResultValue (Array i e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Array i e -> [e])
-> ResultValue (Array i e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Array i e -> [e]
forall i e. Array i e -> [e]
A.elems (ResultValue (Array i e) m -> ResultValue [e] m)
-> ResultValue (Array i e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (Array i e)
-> ResultValue (Array i e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Array i e -> [e])
-> ResultValue (Array i e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Array i e -> [e]
forall i e. Array i e -> [e]
A.elems (ResultValue (Array i e) m -> ResultValue [e] m)
-> ResultValue (Array i e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m (Array i e)
-> ResultValue (Array i e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Array i e -> [e])
-> ResultValue (Array i e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Array i e -> [e]
forall i e. Array i e -> [e]
A.elems (ResultValue (Array i e) m -> ResultValue [e] m)
-> ResultValue (Array i e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m (Array i e)
-> ResultValue (Array i e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Vector e -> [e]) -> ResultValue (Vector e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Vector e -> [e]
forall a. Vector a -> [a]
V.toList (ResultValue (Vector e) m -> ResultValue [e] m)
-> ResultValue (Vector e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Parameter m (Vector e)
-> ResultValue (Vector e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Vector e -> [e]) -> ResultValue (Vector e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Vector e -> [e]
forall a. Vector a -> [a]
V.toList (ResultValue (Vector e) m -> ResultValue [e] m)
-> ResultValue (Vector e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Simulation m (Vector e)
-> ResultValue (Vector e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Vector e -> [e]) -> ResultValue (Vector e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Vector e -> [e]
forall a. Vector a -> [a]
V.toList (ResultValue (Vector e) m -> ResultValue [e] m)
-> ResultValue (Vector e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Dynamics m (Vector e)
-> ResultValue (Vector e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Vector e -> [e]) -> ResultValue (Vector e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Vector e -> [e]
forall a. Vector a -> [a]
V.toList (ResultValue (Vector e) m -> ResultValue [e] m)
-> ResultValue (Vector e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Event m (Vector e)
-> ResultValue (Vector e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Vector e -> [e]) -> ResultValue (Vector e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Vector e -> [e]
forall a. Vector a -> [a]
V.toList (ResultValue (Vector e) m -> ResultValue [e] m)
-> ResultValue (Vector e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (Vector e)
-> ResultValue (Vector e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Vector e -> [e]) -> ResultValue (Vector e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Vector e -> [e]
forall a. Vector a -> [a]
V.toList (ResultValue (Vector e) m -> ResultValue [e] m)
-> ResultValue (Vector e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Ref m (Vector e)
-> ResultValue (Vector e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Vector e -> [e]) -> ResultValue (Vector e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Vector e -> [e]
forall a. Vector a -> [a]
V.toList (ResultValue (Vector e) m -> ResultValue [e] m)
-> ResultValue (Vector e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Var m (Vector e)
-> ResultValue (Vector e) m
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 =
    ResultItem m -> ResultSource m
forall (m :: * -> *). ResultItem m -> ResultSource m
ResultItemSource (ResultItem m -> ResultSource m) -> ResultItem m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultValue [e] m -> ResultItem m
forall (m :: * -> *) (a :: (* -> *) -> *).
ResultItemable a =>
a m -> ResultItem m
ResultItem (ResultValue [e] m -> ResultItem m)
-> ResultValue [e] m -> ResultItem m
forall a b. (a -> b) -> a -> b
$ (Vector e -> [e]) -> ResultValue (Vector e) m -> ResultValue [e] m
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> ResultValue a m -> ResultValue b m
mapResultValue Vector e -> [e]
forall a. Vector a -> [a]
V.toList (ResultValue (Vector e) m -> ResultValue [e] m)
-> ResultValue (Vector e) m -> ResultValue [e] m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Signalable m (Vector e)
-> ResultValue (Vector e) m
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 =
    ResultContainer (Queue m si sm so a) m -> ResultSource 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 (ResultContainer (Queue m si sm so a) m -> ResultSource m)
-> ResultContainer (Queue m si sm so a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Queue m si sm so a
-> ResultSignal m
-> ResultContainer (Queue m si sm so a) m
forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Queue m si sm so a
m (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Queue m si sm so a -> Signal m ()
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 =
    ResultContainer (Queue m sm so a) m -> ResultSource 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 (ResultContainer (Queue m sm so a) m -> ResultSource m)
-> ResultContainer (Queue m sm so a) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Queue m sm so a
-> ResultSignal m
-> ResultContainer (Queue m sm so a) m
forall e (m :: * -> *).
ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> e
-> ResultSignal m
-> ResultContainer e m
ResultContainer ResultName
name [ResultName]
names ResultId
i [ResultId]
is Queue m sm so a
m (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Queue m sm so a -> Signal m ()
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 =
    ResultContainer (ArrivalTimer m) m -> ResultSource m
forall (m :: * -> *).
MonadDES m =>
ResultContainer (ArrivalTimer m) m -> ResultSource m
arrivalTimerResultSource (ResultContainer (ArrivalTimer m) m -> ResultSource m)
-> ResultContainer (ArrivalTimer m) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> ArrivalTimer m
-> ResultSignal m
-> ResultContainer (ArrivalTimer m) m
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 (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ ArrivalTimer m -> Signal m ()
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 =
    ResultContainer (Server m s a b) m -> ResultSource m
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 -> ResultSource m)
-> ResultContainer (Server m s a b) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Server m s a b
-> ResultSignal m
-> ResultContainer (Server m s a b) m
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 (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Server m s a b -> Signal m ()
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 =
    ResultContainer (Activity m s a b) m -> ResultSource m
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 -> ResultSource m)
-> ResultContainer (Activity m s a b) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Activity m s a b
-> ResultSignal m
-> ResultContainer (Activity m s a b) m
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 (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Activity m s a b -> Signal m ()
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 =
    ResultContainer (Resource m s) m -> ResultSource m
forall (m :: * -> *) s.
(MonadDES m, Show s, ResultItemable (ResultValue s)) =>
ResultContainer (Resource m s) m -> ResultSource m
resourceResultSource (ResultContainer (Resource m s) m -> ResultSource m)
-> ResultContainer (Resource m s) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Resource m s
-> ResultSignal m
-> ResultContainer (Resource m s) m
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 (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Resource m s -> Signal m ()
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 =
    ResultContainer (Resource m) m -> ResultSource m
forall (m :: * -> *).
MonadResource m =>
ResultContainer (Resource m) m -> ResultSource m
preemptibleResourceResultSource (ResultContainer (Resource m) m -> ResultSource m)
-> ResultContainer (Resource m) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Resource m
-> ResultSignal m
-> ResultContainer (Resource m) m
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 (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Resource m -> Signal m ()
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 =
    ResultContainer (Operation m a b) m -> ResultSource m
forall (m :: * -> *) a b.
MonadDES m =>
ResultContainer (Operation m a b) m -> ResultSource m
operationResultSource (ResultContainer (Operation m a b) m -> ResultSource m)
-> ResultContainer (Operation m a b) m -> ResultSource m
forall a b. (a -> b) -> a -> b
$ ResultName
-> [ResultName]
-> ResultId
-> [ResultId]
-> Operation m a b
-> ResultSignal m
-> ResultContainer (Operation m a b) m
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 (Signal m () -> ResultSignal m
forall (m :: * -> *). Signal m () -> ResultSignal m
ResultSignal (Signal m () -> ResultSignal m) -> Signal m () -> ResultSignal m
forall a b. (a -> b) -> a -> b
$ Operation m a b -> Signal m ()
forall (m :: * -> *) a b.
MonadDES m =>
Operation m a b -> Signal m ()
operationChanged_ Operation m a b
m)