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