{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
module Simulation.Aivika.Trans.Results.Transform
(
ResultTransformer(..),
SamplingStats(..),
samplingStatsCount,
samplingStatsMin,
samplingStatsMax,
samplingStatsMean,
samplingStatsMean2,
samplingStatsVariance,
samplingStatsDeviation,
TimingStats(..),
timingStatsCount,
timingStatsMin,
timingStatsMax,
timingStatsMean,
timingStatsVariance,
timingStatsDeviation,
timingStatsMinTime,
timingStatsMaxTime,
timingStatsStartTime,
timingStatsLastTime,
timingStatsSum,
timingStatsSum2,
SamplingCounter(..),
samplingCounterValue,
samplingCounterStats,
TimingCounter(..),
timingCounterValue,
timingCounterStats,
Queue(..),
enqueueStrategy,
enqueueStoringStrategy,
dequeueStrategy,
queueNull,
queueFull,
queueMaxCount,
queueCount,
queueCountStats,
enqueueCount,
enqueueLostCount,
enqueueStoreCount,
dequeueCount,
dequeueExtractCount,
queueLoadFactor,
enqueueRate,
enqueueStoreRate,
dequeueRate,
dequeueExtractRate,
queueWaitTime,
queueTotalWaitTime,
enqueueWaitTime,
dequeueWaitTime,
queueRate,
ArrivalTimer(..),
arrivalProcessingTime,
Server(..),
serverInitState,
serverState,
serverTotalInputWaitTime,
serverTotalProcessingTime,
serverTotalOutputWaitTime,
serverTotalPreemptionTime,
serverInputWaitTime,
serverProcessingTime,
serverOutputWaitTime,
serverPreemptionTime,
serverInputWaitFactor,
serverProcessingFactor,
serverOutputWaitFactor,
serverPreemptionFactor,
Activity(..),
activityInitState,
activityState,
activityTotalUtilisationTime,
activityTotalIdleTime,
activityTotalPreemptionTime,
activityUtilisationTime,
activityIdleTime,
activityPreemptionTime,
activityUtilisationFactor,
activityIdleFactor,
activityPreemptionFactor,
Resource(..),
resourceCount,
resourceCountStats,
resourceUtilisationCount,
resourceUtilisationCountStats,
resourceQueueCount,
resourceQueueCountStats,
resourceTotalWaitTime,
resourceWaitTime,
Operation(..),
operationTotalUtilisationTime,
operationTotalPreemptionTime,
operationUtilisationTime,
operationPreemptionTime,
operationUtilisationFactor,
operationPreemptionFactor) where
import Control.Arrow
import Simulation.Aivika.Trans.DES
import Simulation.Aivika.Trans.Results
import Simulation.Aivika.Trans.Results.Locale
class ResultTransformer t m where
tr :: t m -> ResultTransform m
newtype SamplingStats m = SamplingStats (ResultTransform m)
instance ResultTransformer SamplingStats m where
tr (SamplingStats a) = a
samplingStatsCount :: MonadDES m => SamplingStats m -> ResultTransform m
samplingStatsCount (SamplingStats a) =
a >>> expandResults >>> resultById SamplingStatsCountId
samplingStatsMin :: MonadDES m => SamplingStats m -> ResultTransform m
samplingStatsMin (SamplingStats a) =
a >>> expandResults >>> resultById SamplingStatsMinId
samplingStatsMax :: MonadDES m => SamplingStats m -> ResultTransform m
samplingStatsMax (SamplingStats a) =
a >>> expandResults >>> resultById SamplingStatsMaxId
samplingStatsMean :: MonadDES m => SamplingStats m -> ResultTransform m
samplingStatsMean (SamplingStats a) =
a >>> expandResults >>> resultById SamplingStatsMeanId
samplingStatsMean2 :: MonadDES m => SamplingStats m -> ResultTransform m
samplingStatsMean2 (SamplingStats a) =
a >>> expandResults >>> resultById SamplingStatsMean2Id
samplingStatsVariance :: MonadDES m => SamplingStats m -> ResultTransform m
samplingStatsVariance (SamplingStats a) =
a >>> expandResults >>> resultById SamplingStatsVarianceId
samplingStatsDeviation :: MonadDES m => SamplingStats m -> ResultTransform m
samplingStatsDeviation (SamplingStats a) =
a >>> expandResults >>> resultById SamplingStatsDeviationId
newtype SamplingCounter m = SamplingCounter (ResultTransform m)
instance ResultTransformer SamplingCounter m where
tr (SamplingCounter a) = a
samplingCounterValue :: SamplingCounter m -> ResultTransform m
samplingCounterValue (SamplingCounter a) =
a >>> resultById SamplingCounterValueId
samplingCounterStats :: SamplingCounter m -> SamplingStats m
samplingCounterStats (SamplingCounter a) =
SamplingStats (a >>> resultById SamplingCounterStatsId)
newtype TimingStats m = TimingStats (ResultTransform m)
instance ResultTransformer TimingStats m where
tr (TimingStats a) = a
timingStatsCount :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsCount (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsCountId
timingStatsMin :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsMin (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsMinId
timingStatsMax :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsMax (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsMaxId
timingStatsMean :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsMean (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsMeanId
timingStatsVariance :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsVariance (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsVarianceId
timingStatsDeviation :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsDeviation (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsDeviationId
timingStatsMinTime :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsMinTime (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsMinTimeId
timingStatsMaxTime :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsMaxTime (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsMaxTimeId
timingStatsStartTime :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsStartTime (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsStartTimeId
timingStatsLastTime :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsLastTime (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsLastTimeId
timingStatsSum :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsSum (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsSumId
timingStatsSum2 :: MonadDES m => TimingStats m -> ResultTransform m
timingStatsSum2 (TimingStats a) =
a >>> expandResults >>> resultById TimingStatsSum2Id
newtype TimingCounter m = TimingCounter (ResultTransform m)
instance ResultTransformer TimingCounter m where
tr (TimingCounter a) = a
timingCounterValue :: TimingCounter m -> ResultTransform m
timingCounterValue (TimingCounter a) =
a >>> resultById TimingCounterValueId
timingCounterStats :: TimingCounter m -> TimingStats m
timingCounterStats (TimingCounter a) =
TimingStats (a >>> resultById TimingCounterStatsId)
newtype Queue m = Queue (ResultTransform m)
instance ResultTransformer Queue m where
tr (Queue a) = a
enqueueStrategy :: Queue m -> ResultTransform m
enqueueStrategy (Queue a) =
a >>> resultById EnqueueStrategyId
enqueueStoringStrategy :: Queue m -> ResultTransform m
enqueueStoringStrategy (Queue a) =
a >>> resultById EnqueueStoringStrategyId
dequeueStrategy :: Queue m -> ResultTransform m
dequeueStrategy (Queue a) =
a >>> resultById DequeueStrategyId
queueNull :: Queue m -> ResultTransform m
queueNull (Queue a) =
a >>> resultById QueueNullId
queueFull :: Queue m -> ResultTransform m
queueFull (Queue a) =
a >>> resultById QueueFullId
queueMaxCount :: Queue m -> ResultTransform m
queueMaxCount (Queue a) =
a >>> resultById QueueMaxCountId
queueCount :: Queue m -> ResultTransform m
queueCount (Queue a) =
a >>> resultById QueueCountId
queueCountStats :: Queue m -> TimingStats m
queueCountStats (Queue a) =
TimingStats (a >>> resultById QueueCountStatsId)
enqueueCount :: Queue m -> ResultTransform m
enqueueCount (Queue a) =
a >>> resultById EnqueueCountId
enqueueLostCount :: Queue m -> ResultTransform m
enqueueLostCount (Queue a) =
a >>> resultById EnqueueLostCountId
enqueueStoreCount :: Queue m -> ResultTransform m
enqueueStoreCount (Queue a) =
a >>> resultById EnqueueStoreCountId
dequeueCount :: Queue m -> ResultTransform m
dequeueCount (Queue a) =
a >>> resultById DequeueCountId
dequeueExtractCount :: Queue m -> ResultTransform m
dequeueExtractCount (Queue a) =
a >>> resultById DequeueExtractCountId
queueLoadFactor :: Queue m -> ResultTransform m
queueLoadFactor (Queue a) =
a >>> resultById QueueLoadFactorId
enqueueRate :: Queue m -> ResultTransform m
enqueueRate (Queue a) =
a >>> resultById EnqueueRateId
enqueueStoreRate :: Queue m -> ResultTransform m
enqueueStoreRate (Queue a) =
a >>> resultById EnqueueStoreRateId
dequeueRate :: Queue m -> ResultTransform m
dequeueRate (Queue a) =
a >>> resultById DequeueRateId
dequeueExtractRate :: Queue m -> ResultTransform m
dequeueExtractRate (Queue a) =
a >>> resultById DequeueExtractRateId
queueWaitTime :: Queue m -> SamplingStats m
queueWaitTime (Queue a) =
SamplingStats (a >>> resultById QueueWaitTimeId)
queueTotalWaitTime :: Queue m -> SamplingStats m
queueTotalWaitTime (Queue a) =
SamplingStats (a >>> resultById QueueTotalWaitTimeId)
enqueueWaitTime :: Queue m -> SamplingStats m
enqueueWaitTime (Queue a) =
SamplingStats (a >>> resultById EnqueueWaitTimeId)
dequeueWaitTime :: Queue m -> SamplingStats m
dequeueWaitTime (Queue a) =
SamplingStats (a >>> resultById DequeueWaitTimeId)
queueRate :: Queue m -> ResultTransform m
queueRate (Queue a) =
a >>> resultById QueueRateId
newtype ArrivalTimer m = ArrivalTimer (ResultTransform m)
instance ResultTransformer ArrivalTimer m where
tr (ArrivalTimer a) = a
arrivalProcessingTime :: ArrivalTimer m -> SamplingStats m
arrivalProcessingTime (ArrivalTimer a) =
SamplingStats (a >>> resultById ArrivalProcessingTimeId)
newtype Server m = Server (ResultTransform m)
instance ResultTransformer Server m where
tr (Server a) = a
serverInitState :: Server m -> ResultTransform m
serverInitState (Server a) =
a >>> resultById ServerInitStateId
serverState :: Server m -> ResultTransform m
serverState (Server a) =
a >>> resultById ServerStateId
serverTotalInputWaitTime :: Server m -> ResultTransform m
serverTotalInputWaitTime (Server a) =
a >>> resultById ServerTotalInputWaitTimeId
serverTotalProcessingTime :: Server m -> ResultTransform m
serverTotalProcessingTime (Server a) =
a >>> resultById ServerTotalProcessingTimeId
serverTotalOutputWaitTime :: Server m -> ResultTransform m
serverTotalOutputWaitTime (Server a) =
a >>> resultById ServerTotalOutputWaitTimeId
serverTotalPreemptionTime :: Server m -> ResultTransform m
serverTotalPreemptionTime (Server a) =
a >>> resultById ServerTotalPreemptionTimeId
serverInputWaitTime :: Server m -> SamplingStats m
serverInputWaitTime (Server a) =
SamplingStats (a >>> resultById ServerInputWaitTimeId)
serverProcessingTime :: Server m -> SamplingStats m
serverProcessingTime (Server a) =
SamplingStats (a >>> resultById ServerProcessingTimeId)
serverOutputWaitTime :: Server m -> SamplingStats m
serverOutputWaitTime (Server a) =
SamplingStats (a >>> resultById ServerOutputWaitTimeId)
serverPreemptionTime :: Server m -> SamplingStats m
serverPreemptionTime (Server a) =
SamplingStats (a >>> resultById ServerPreemptionTimeId)
serverInputWaitFactor :: Server m -> ResultTransform m
serverInputWaitFactor (Server a) =
a >>> resultById ServerInputWaitFactorId
serverProcessingFactor :: Server m -> ResultTransform m
serverProcessingFactor (Server a) =
a >>> resultById ServerProcessingFactorId
serverOutputWaitFactor :: Server m -> ResultTransform m
serverOutputWaitFactor (Server a) =
a >>> resultById ServerOutputWaitFactorId
serverPreemptionFactor :: Server m -> ResultTransform m
serverPreemptionFactor (Server a) =
a >>> resultById ServerPreemptionFactorId
newtype Activity m = Activity (ResultTransform m)
instance ResultTransformer Activity m where
tr (Activity a) = a
activityInitState :: Activity m -> ResultTransform m
activityInitState (Activity a) =
a >>> resultById ActivityInitStateId
activityState :: Activity m -> ResultTransform m
activityState (Activity a) =
a >>> resultById ActivityStateId
activityTotalUtilisationTime :: Activity m -> ResultTransform m
activityTotalUtilisationTime (Activity a) =
a >>> resultById ActivityTotalUtilisationTimeId
activityTotalIdleTime :: Activity m -> ResultTransform m
activityTotalIdleTime (Activity a) =
a >>> resultById ActivityTotalIdleTimeId
activityTotalPreemptionTime :: Activity m -> ResultTransform m
activityTotalPreemptionTime (Activity a) =
a >>> resultById ActivityTotalPreemptionTimeId
activityUtilisationTime :: Activity m -> SamplingStats m
activityUtilisationTime (Activity a) =
SamplingStats (a >>> resultById ActivityUtilisationTimeId)
activityIdleTime :: Activity m -> SamplingStats m
activityIdleTime (Activity a) =
SamplingStats (a >>> resultById ActivityIdleTimeId)
activityPreemptionTime :: Activity m -> SamplingStats m
activityPreemptionTime (Activity a) =
SamplingStats (a >>> resultById ActivityPreemptionTimeId)
activityUtilisationFactor :: Activity m -> ResultTransform m
activityUtilisationFactor (Activity a) =
a >>> resultById ActivityUtilisationFactorId
activityIdleFactor :: Activity m -> ResultTransform m
activityIdleFactor (Activity a) =
a >>> resultById ActivityIdleFactorId
activityPreemptionFactor :: Activity m -> ResultTransform m
activityPreemptionFactor (Activity a) =
a >>> resultById ActivityPreemptionFactorId
newtype Resource m = Resource (ResultTransform m)
instance ResultTransformer Resource m where
tr (Resource a) = a
resourceCount :: Resource m -> ResultTransform m
resourceCount (Resource a) =
a >>> resultById ResourceCountId
resourceCountStats :: Resource m -> TimingStats m
resourceCountStats (Resource a) =
TimingStats (a >>> resultById ResourceCountStatsId)
resourceUtilisationCount :: Resource m -> ResultTransform m
resourceUtilisationCount (Resource a) =
a >>> resultById ResourceUtilisationCountId
resourceUtilisationCountStats :: Resource m -> TimingStats m
resourceUtilisationCountStats (Resource a) =
TimingStats (a >>> resultById ResourceUtilisationCountStatsId)
resourceQueueCount :: Resource m -> ResultTransform m
resourceQueueCount (Resource a) =
a >>> resultById ResourceQueueCountId
resourceQueueCountStats :: Resource m -> TimingStats m
resourceQueueCountStats (Resource a) =
TimingStats (a >>> resultById ResourceQueueCountStatsId)
resourceTotalWaitTime :: Resource m -> ResultTransform m
resourceTotalWaitTime (Resource a) =
a >>> resultById ResourceTotalWaitTimeId
resourceWaitTime :: Resource m -> SamplingStats m
resourceWaitTime (Resource a) =
SamplingStats (a >>> resultById ResourceWaitTimeId)
newtype Operation m = Operation (ResultTransform m)
instance ResultTransformer Operation m where
tr (Operation a) = a
operationTotalUtilisationTime :: Operation m -> ResultTransform m
operationTotalUtilisationTime (Operation a) =
a >>> resultById OperationTotalUtilisationTimeId
operationTotalPreemptionTime :: Operation m -> ResultTransform m
operationTotalPreemptionTime (Operation a) =
a >>> resultById OperationTotalPreemptionTimeId
operationUtilisationTime :: Operation m -> SamplingStats m
operationUtilisationTime (Operation a) =
SamplingStats (a >>> resultById OperationUtilisationTimeId)
operationPreemptionTime :: Operation m -> SamplingStats m
operationPreemptionTime (Operation a) =
SamplingStats (a >>> resultById OperationPreemptionTimeId)
operationUtilisationFactor :: Operation m -> ResultTransform m
operationUtilisationFactor (Operation a) =
a >>> resultById OperationUtilisationFactorId
operationPreemptionFactor :: Operation m -> ResultTransform m
operationPreemptionFactor (Operation a) =
a >>> resultById OperationPreemptionFactorId