packages feed

aivika-transformers 4.3.5 → 4.5

raw patch · 92 files changed

+472/−235 lines, 92 filesdep ~aivikaPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aivika

API changes (from Hackage documentation)

- Simulation.Aivika.Trans.Simulation: SimulationException :: e -> SimulationException
- Simulation.Aivika.Trans.Transform: instance (Simulation.Aivika.Trans.SD.MonadSD m, Control.Monad.Fix.MonadFix m) => Control.Arrow.ArrowLoop (Simulation.Aivika.Trans.Transform.Transform m)
+ Simulation.Aivika.IO.Event: instance (GHC.Base.Monad m, Control.Monad.IO.Class.MonadIO m, Simulation.Aivika.Trans.Template.MonadTemplate m, Simulation.Aivika.Trans.DES.MonadDES m) => Simulation.Aivika.Trans.Internal.Event.EventIOQueueing m
+ Simulation.Aivika.Trans.Event: class (EventQueueing m, MonadIO (Event m)) => EventIOQueueing m
+ Simulation.Aivika.Trans.Event: data family EventQueue m :: *;
+ Simulation.Aivika.Trans.Event: enqueueEventIO :: EventIOQueueing m => Double -> Event m () -> Event m ()
+ Simulation.Aivika.Trans.Event: enqueueEventIOWithIntegTimes :: (MonadDES m, EventIOQueueing m) => Event m () -> Event m ()
+ Simulation.Aivika.Trans.Event: enqueueEventIOWithStartTime :: (MonadDES m, EventIOQueueing m) => Event m () -> Event m ()
+ Simulation.Aivika.Trans.Event: enqueueEventIOWithStopTime :: (MonadDES m, EventIOQueueing m) => Event m () -> Event m ()
+ Simulation.Aivika.Trans.Event: enqueueEventIOWithTimes :: (MonadDES m, EventIOQueueing m) => [Double] -> Event m () -> Event m ()
+ Simulation.Aivika.Trans.Event: enqueueEventWithStartTime :: MonadDES m => Event m () -> Event m ()
+ Simulation.Aivika.Trans.Event: enqueueEventWithStopTime :: MonadDES m => Event m () -> Event m ()
+ Simulation.Aivika.Trans.Event: }
+ Simulation.Aivika.Trans.Generator: data family Generator m :: *;
+ Simulation.Aivika.Trans.Generator: }
+ Simulation.Aivika.Trans.Internal.Types: data family EventQueue m :: *;
+ Simulation.Aivika.Trans.Internal.Types: }
+ Simulation.Aivika.Trans.Observable: class Observable o m
+ Simulation.Aivika.Trans.Observable: readObservable :: Observable o m => o a -> m a
+ Simulation.Aivika.Trans.QueueStrategy: data family StrategyQueue m s :: * -> *;
+ Simulation.Aivika.Trans.QueueStrategy: }
+ Simulation.Aivika.Trans.Ref: instance (Simulation.Aivika.Trans.DES.MonadDES m, Simulation.Aivika.Trans.Observable.Observable (Simulation.Aivika.Trans.Ref.Base.Ref m) (t m)) => Simulation.Aivika.Trans.Observable.Observable (Simulation.Aivika.Trans.Ref.Ref m) (t m)
+ Simulation.Aivika.Trans.Ref.Base: data family Ref m a;
+ Simulation.Aivika.Trans.Ref.Base: instance (GHC.Base.Monad m, Simulation.Aivika.Trans.Ref.Base.MonadRef m) => Simulation.Aivika.Trans.Observable.Observable (Simulation.Aivika.Trans.Ref.Base.Ref m) (Simulation.Aivika.Trans.Internal.Types.Event m)
+ Simulation.Aivika.Trans.Ref.Base: }
+ Simulation.Aivika.Trans.Resource.Preemption: data family Resource m;
+ Simulation.Aivika.Trans.Resource.Preemption: }
+ Simulation.Aivika.Trans.Resource.Preemption.Base: data family Resource m;
+ Simulation.Aivika.Trans.Resource.Preemption.Base: }
+ Simulation.Aivika.Trans.Results.IO: enqueuePrintingResultSource :: (MonadDES m, EventIOQueueing m) => ResultLocalisation -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: enqueuePrintingResultSourceInEnglish :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: enqueuePrintingResultSourceInRussian :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: enqueuePrintingResultSourceIndented :: (MonadDES m, EventIOQueueing m) => Int -> ResultLocalisation -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: hEnqueuePrintingResultSource :: (MonadDES m, EventIOQueueing m) => Handle -> ResultLocalisation -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: hEnqueuePrintingResultSourceInEnglish :: (MonadDES m, EventIOQueueing m) => Handle -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: hEnqueuePrintingResultSourceInRussian :: (MonadDES m, EventIOQueueing m) => Handle -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: hEnqueuePrintingResultSourceIndented :: (MonadDES m, EventIOQueueing m) => Handle -> Int -> ResultLocalisation -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Simulation: [SimulationException] :: SimulationException
+ Simulation.Aivika.Trans.Var: data family Var m a;
+ Simulation.Aivika.Trans.Var: }
+ Simulation.Aivika.Trans.Var.Unboxed: data family Var m a;
+ Simulation.Aivika.Trans.Var.Unboxed: }
- Simulation.Aivika.Trans.Event: class EventQueueing m where data family EventQueue m :: * runEvent = runEventWith CurrentEvents
+ Simulation.Aivika.Trans.Event: class EventQueueing m where data EventQueue m :: * runEvent = runEventWith CurrentEvents where {
- Simulation.Aivika.Trans.Generator: class (Functor m, Monad m) => MonadGenerator m where data family Generator m :: *
+ Simulation.Aivika.Trans.Generator: class (Functor m, Monad m) => MonadGenerator m where data Generator m :: * where {
- Simulation.Aivika.Trans.Generator: generateDiscrete :: MonadGenerator m => Generator m -> DiscretePDF a -> m a
+ Simulation.Aivika.Trans.Generator: generateDiscrete :: forall a. MonadGenerator m => Generator m -> DiscretePDF a -> m a
- Simulation.Aivika.Trans.Internal.Types: class EventQueueing m where data family EventQueue m :: * runEvent = runEventWith CurrentEvents
+ Simulation.Aivika.Trans.Internal.Types: class EventQueueing m where data EventQueue m :: * runEvent = runEventWith CurrentEvents where {
- Simulation.Aivika.Trans.QueueStrategy: class Monad m => QueueStrategy m s where data family StrategyQueue m s :: * -> *
+ Simulation.Aivika.Trans.QueueStrategy: class Monad m => QueueStrategy m s where data StrategyQueue m s :: * -> * where {
- Simulation.Aivika.Trans.Ref.Base: class Monad m => MonadRef m where data family Ref m a
+ Simulation.Aivika.Trans.Ref.Base: class Monad m => MonadRef m where data Ref m a where {
- Simulation.Aivika.Trans.Resource.Preemption: class MonadDES m => MonadResource m where data family Resource m
+ Simulation.Aivika.Trans.Resource.Preemption: class MonadDES m => MonadResource m where data Resource m where {
- Simulation.Aivika.Trans.Resource.Preemption.Base: class MonadDES m => MonadResource m where data family Resource m
+ Simulation.Aivika.Trans.Resource.Preemption.Base: class MonadDES m => MonadResource m where data Resource m where {
- Simulation.Aivika.Trans.Results.IO: hPrintResultSource :: (MonadDES m, MonadIO m) => Handle -> ResultLocalisation -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: hPrintResultSource :: (MonadDES m, MonadIO (Event m)) => Handle -> ResultLocalisation -> ResultSourcePrint m
- Simulation.Aivika.Trans.Results.IO: hPrintResultSourceInEnglish :: (MonadDES m, MonadIO m) => Handle -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: hPrintResultSourceInEnglish :: (MonadDES m, MonadIO (Event m)) => Handle -> ResultSourcePrint m
- Simulation.Aivika.Trans.Results.IO: hPrintResultSourceInRussian :: (MonadDES m, MonadIO m) => Handle -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: hPrintResultSourceInRussian :: (MonadDES m, MonadIO (Event m)) => Handle -> ResultSourcePrint m
- Simulation.Aivika.Trans.Results.IO: hPrintResultSourceIndented :: (MonadDES m, MonadIO m) => Handle -> Int -> ResultLocalisation -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: hPrintResultSourceIndented :: (MonadDES m, MonadIO (Event m)) => Handle -> Int -> ResultLocalisation -> ResultSourcePrint m
- Simulation.Aivika.Trans.Results.IO: printResultSource :: (MonadDES m, MonadIO m) => ResultLocalisation -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: printResultSource :: (MonadDES m, MonadIO (Event m)) => ResultLocalisation -> ResultSourcePrint m
- Simulation.Aivika.Trans.Results.IO: printResultSourceInEnglish :: (MonadDES m, MonadIO m) => ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: printResultSourceInEnglish :: (MonadDES m, MonadIO (Event m)) => ResultSourcePrint m
- Simulation.Aivika.Trans.Results.IO: printResultSourceInRussian :: (MonadDES m, MonadIO m) => ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: printResultSourceInRussian :: (MonadDES m, MonadIO (Event m)) => ResultSourcePrint m
- Simulation.Aivika.Trans.Results.IO: printResultSourceIndented :: (MonadDES m, MonadIO m) => Int -> ResultLocalisation -> ResultSourcePrint m
+ Simulation.Aivika.Trans.Results.IO: printResultSourceIndented :: (MonadDES m, MonadIO (Event m)) => Int -> ResultLocalisation -> ResultSourcePrint m
- Simulation.Aivika.Trans.Results.IO: printResultsInIntegTimes :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Results m -> Simulation m ()
+ Simulation.Aivika.Trans.Results.IO: printResultsInIntegTimes :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Results m -> Simulation m ()
- Simulation.Aivika.Trans.Results.IO: printResultsInStartTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Results m -> Simulation m ()
+ Simulation.Aivika.Trans.Results.IO: printResultsInStartTime :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Results m -> Simulation m ()
- Simulation.Aivika.Trans.Results.IO: printResultsInStopTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Results m -> Simulation m ()
+ Simulation.Aivika.Trans.Results.IO: printResultsInStopTime :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Results m -> Simulation m ()
- Simulation.Aivika.Trans.Results.IO: printResultsInTime :: (MonadDES m, MonadIO m) => Double -> ResultSourcePrint m -> Results m -> Simulation m ()
+ Simulation.Aivika.Trans.Results.IO: printResultsInTime :: (MonadDES m, EventIOQueueing m) => Double -> ResultSourcePrint m -> Results m -> Simulation m ()
- Simulation.Aivika.Trans.Results.IO: printResultsInTimes :: (MonadDES m, MonadIO m) => [Double] -> ResultSourcePrint m -> Results m -> Simulation m ()
+ Simulation.Aivika.Trans.Results.IO: printResultsInTimes :: (MonadDES m, EventIOQueueing m) => [Double] -> ResultSourcePrint m -> Results m -> Simulation m ()
- Simulation.Aivika.Trans.Results.IO: printResultsWithTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Results m -> Event m ()
+ Simulation.Aivika.Trans.Results.IO: printResultsWithTime :: (MonadDES m, MonadIO (Event m)) => ResultSourcePrint m -> Results m -> Event m ()
- Simulation.Aivika.Trans.Results.IO: printSimulationResultsInIntegTimes :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
+ Simulation.Aivika.Trans.Results.IO: printSimulationResultsInIntegTimes :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
- Simulation.Aivika.Trans.Results.IO: printSimulationResultsInStartTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
+ Simulation.Aivika.Trans.Results.IO: printSimulationResultsInStartTime :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
- Simulation.Aivika.Trans.Results.IO: printSimulationResultsInStopTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
+ Simulation.Aivika.Trans.Results.IO: printSimulationResultsInStopTime :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
- Simulation.Aivika.Trans.Results.IO: printSimulationResultsInTime :: (MonadDES m, MonadIO m) => Double -> ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
+ Simulation.Aivika.Trans.Results.IO: printSimulationResultsInTime :: (MonadDES m, EventIOQueueing m) => Double -> ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
- Simulation.Aivika.Trans.Results.IO: printSimulationResultsInTimes :: (MonadDES m, MonadIO m) => [Double] -> ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
+ Simulation.Aivika.Trans.Results.IO: printSimulationResultsInTimes :: (MonadDES m, EventIOQueueing m) => [Double] -> ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()
- Simulation.Aivika.Trans.Statistics: SamplingStats :: SrictNotUnpackedInt -> SrictNotUnpackeda -> SrictNotUnpackeda -> SrictNotUnpackedDouble -> SrictNotUnpackedDouble -> SamplingStats a
+ Simulation.Aivika.Trans.Statistics: SamplingStats :: ~Int -> ~a -> ~a -> ~Double -> ~Double -> SamplingStats a
- Simulation.Aivika.Trans.Statistics: TimingStats :: SrictNotUnpackedInt -> SrictNotUnpackeda -> SrictNotUnpackeda -> SrictNotUnpackeda -> SrictNotUnpackedDouble -> SrictNotUnpackedDouble -> SrictNotUnpackedDouble -> SrictNotUnpackedDouble -> SrictNotUnpackedDouble -> SrictNotUnpackedDouble -> TimingStats a
+ Simulation.Aivika.Trans.Statistics: TimingStats :: ~Int -> ~a -> ~a -> ~a -> ~Double -> ~Double -> ~Double -> ~Double -> ~Double -> ~Double -> TimingStats a
- Simulation.Aivika.Trans.Statistics: [samplingStatsCount] :: SamplingStats a -> SrictNotUnpackedInt
+ Simulation.Aivika.Trans.Statistics: [samplingStatsCount] :: SamplingStats a -> ~Int
- Simulation.Aivika.Trans.Statistics: [samplingStatsMax] :: SamplingStats a -> SrictNotUnpackeda
+ Simulation.Aivika.Trans.Statistics: [samplingStatsMax] :: SamplingStats a -> ~a
- Simulation.Aivika.Trans.Statistics: [samplingStatsMean2] :: SamplingStats a -> SrictNotUnpackedDouble
+ Simulation.Aivika.Trans.Statistics: [samplingStatsMean2] :: SamplingStats a -> ~Double
- Simulation.Aivika.Trans.Statistics: [samplingStatsMean] :: SamplingStats a -> SrictNotUnpackedDouble
+ Simulation.Aivika.Trans.Statistics: [samplingStatsMean] :: SamplingStats a -> ~Double
- Simulation.Aivika.Trans.Statistics: [samplingStatsMin] :: SamplingStats a -> SrictNotUnpackeda
+ Simulation.Aivika.Trans.Statistics: [samplingStatsMin] :: SamplingStats a -> ~a
- Simulation.Aivika.Trans.Statistics: [timingStatsCount] :: TimingStats a -> SrictNotUnpackedInt
+ Simulation.Aivika.Trans.Statistics: [timingStatsCount] :: TimingStats a -> ~Int
- Simulation.Aivika.Trans.Statistics: [timingStatsLastTime] :: TimingStats a -> SrictNotUnpackedDouble
+ Simulation.Aivika.Trans.Statistics: [timingStatsLastTime] :: TimingStats a -> ~Double
- Simulation.Aivika.Trans.Statistics: [timingStatsLast] :: TimingStats a -> SrictNotUnpackeda
+ Simulation.Aivika.Trans.Statistics: [timingStatsLast] :: TimingStats a -> ~a
- Simulation.Aivika.Trans.Statistics: [timingStatsMaxTime] :: TimingStats a -> SrictNotUnpackedDouble
+ Simulation.Aivika.Trans.Statistics: [timingStatsMaxTime] :: TimingStats a -> ~Double
- Simulation.Aivika.Trans.Statistics: [timingStatsMax] :: TimingStats a -> SrictNotUnpackeda
+ Simulation.Aivika.Trans.Statistics: [timingStatsMax] :: TimingStats a -> ~a
- Simulation.Aivika.Trans.Statistics: [timingStatsMinTime] :: TimingStats a -> SrictNotUnpackedDouble
+ Simulation.Aivika.Trans.Statistics: [timingStatsMinTime] :: TimingStats a -> ~Double
- Simulation.Aivika.Trans.Statistics: [timingStatsMin] :: TimingStats a -> SrictNotUnpackeda
+ Simulation.Aivika.Trans.Statistics: [timingStatsMin] :: TimingStats a -> ~a
- Simulation.Aivika.Trans.Statistics: [timingStatsStartTime] :: TimingStats a -> SrictNotUnpackedDouble
+ Simulation.Aivika.Trans.Statistics: [timingStatsStartTime] :: TimingStats a -> ~Double
- Simulation.Aivika.Trans.Statistics: [timingStatsSum2] :: TimingStats a -> SrictNotUnpackedDouble
+ Simulation.Aivika.Trans.Statistics: [timingStatsSum2] :: TimingStats a -> ~Double
- Simulation.Aivika.Trans.Statistics: [timingStatsSum] :: TimingStats a -> SrictNotUnpackedDouble
+ Simulation.Aivika.Trans.Statistics: [timingStatsSum] :: TimingStats a -> ~Double
- Simulation.Aivika.Trans.Statistics: addSamplingStats :: SamplingData a => a -> SamplingStats a -> SamplingStats a
+ Simulation.Aivika.Trans.Statistics: addSamplingStats :: a -> SamplingStats a -> SamplingStats a
- Simulation.Aivika.Trans.Statistics: addTimingStats :: TimingData a => Double -> a -> TimingStats a -> TimingStats a
+ Simulation.Aivika.Trans.Statistics: addTimingStats :: Double -> a -> TimingStats a -> TimingStats a
- Simulation.Aivika.Trans.Statistics: combineSamplingStats :: SamplingData a => SamplingStats a -> SamplingStats a -> SamplingStats a
+ Simulation.Aivika.Trans.Statistics: combineSamplingStats :: SamplingStats a -> SamplingStats a -> SamplingStats a
- Simulation.Aivika.Trans.Statistics: emptySamplingStats :: SamplingData a => SamplingStats a
+ Simulation.Aivika.Trans.Statistics: emptySamplingStats :: SamplingStats a
- Simulation.Aivika.Trans.Statistics: emptyTimingStats :: TimingData a => TimingStats a
+ Simulation.Aivika.Trans.Statistics: emptyTimingStats :: TimingStats a
- Simulation.Aivika.Trans.Statistics: timingStatsMean :: TimingData a => TimingStats a -> Double
+ Simulation.Aivika.Trans.Statistics: timingStatsMean :: TimingStats a -> Double
- Simulation.Aivika.Trans.Statistics: timingStatsMean2 :: TimingData a => TimingStats a -> Double
+ Simulation.Aivika.Trans.Statistics: timingStatsMean2 :: TimingStats a -> Double
- Simulation.Aivika.Trans.Statistics: timingStatsVariance :: TimingData a => TimingStats a -> Double
+ Simulation.Aivika.Trans.Statistics: timingStatsVariance :: TimingStats a -> Double
- Simulation.Aivika.Trans.Var: class MonadDES m => MonadVar m where data family Var m a
+ Simulation.Aivika.Trans.Var: class MonadDES m => MonadVar m where data Var m a where {
- Simulation.Aivika.Trans.Var.Unboxed: class MonadDES m => MonadVar m a where data family Var m a
+ Simulation.Aivika.Trans.Var.Unboxed: class MonadDES m => MonadVar m a where data Var m a where {

Files

Simulation/Aivika/IO.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.IO--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module re-exports the most part of the library functionality related -- to 'IO'-based computations.
Simulation/Aivika/IO/Comp.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.Comp--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- It allows making the 'MonadIO'-based monad an instance of type class 'MonadComp' -- on top of which the simulation monads can be built.
Simulation/Aivika/IO/DES.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.DES--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- It allows making the 'MonadIO'-based monad an instance of type class 'MonadDES' -- used for Discrete Event Simulation (DES).
Simulation/Aivika/IO/Dynamics/Memo.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.Dynamics.Memo--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- The 'MonadIO'-based monad can be an instance of the 'MonadMemo' type class. --
Simulation/Aivika/IO/Dynamics/Memo/Unboxed.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.Dynamics.Memo.Unboxed--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- The 'MonadIO'-based monad can be an instance of the 'MonadMemo' type class. --
Simulation/Aivika/IO/Event.hs view
@@ -3,14 +3,14 @@  -- | -- Module     : Simulation.Aivika.IO.Event--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- The module defines a template-based event queue, where--- the 'MonadIO'-based monad can be an instance of 'EventQueueing'.+-- the 'MonadIO'-based monad can be an instance of 'EventQueueing' and 'EventIOQueueing'. -- module Simulation.Aivika.IO.Event () where @@ -26,6 +26,7 @@ import Simulation.Aivika.Trans.Comp import Simulation.Aivika.Trans.Template import Simulation.Aivika.Trans.Internal.Types+import Simulation.Aivika.Trans.Event  -- | A template-based implementation of the 'EventQueueing' type class. instance (Monad m, MonadIO m, MonadTemplate m) => EventQueueing m where@@ -145,3 +146,8 @@ processEvents EarlierEvents = processEventsIncludingEarlier processEvents CurrentEventsOrFromPast = processEventsIncludingCurrentCore processEvents EarlierEventsOrFromPast = processEventsIncludingEarlierCore++-- | A template-based implementation of the 'EventIOQueueing' type class.+instance (Monad m, MonadIO m, MonadTemplate m, MonadDES m) => EventIOQueueing m where++  enqueueEventIO = enqueueEvent
Simulation/Aivika/IO/Exception.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.IO.Exception--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It provides with exception handling capabilities, -- where 'IO' is an instance of 'MonadException'.
Simulation/Aivika/IO/Generator.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.Generator--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- Here is defined a random number generator, where -- the 'MonadIO'-based monad can be an instance of 'MonadGenerator'.
Simulation/Aivika/IO/QueueStrategy.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.QueueStrategy--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module defines some queue strategy instances -- for the 'MonadIO'-based computations.
Simulation/Aivika/IO/Ref/Base.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.Ref.Base--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The 'MonadIO'-based monad can be an instance of 'MonadRef'. --
Simulation/Aivika/IO/Resource/Preemption.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.Resource.Preemption--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module defines the preemptible resource, where -- the 'MonadIO'-based monad can be an instance of 'MonadResource'.
Simulation/Aivika/IO/Resource/Preemption/Base.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module defines the optimised preemptible resource, where -- the 'MonadIO'-based monad can be an instance of 'MonadResource'.
Simulation/Aivika/IO/SD.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.SD--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- It allows making the 'MonadIO'-based monad an instance of type class 'MonadSD' -- used for System Dynamics (SD).
Simulation/Aivika/IO/Signal.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.IO.Signal--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module allows collecting the signal history. --
Simulation/Aivika/IO/Var.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.Var--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- The 'MonadIO'-based monad can be an instance 'MonadVar'. --
Simulation/Aivika/IO/Var/Unboxed.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.IO.Var.Unboxed--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- The 'MonadIO'-based monad can be an instance 'MonadVar'. --
Simulation/Aivika/Trans.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module re-exports the most part of the library functionality. -- There are modules that must be imported explicitly, though.@@ -30,6 +30,7 @@         module Simulation.Aivika.Trans.Generator,         module Simulation.Aivika.Trans.Net,         module Simulation.Aivika.Trans.Net.Random,+        module Simulation.Aivika.Trans.Observable,         module Simulation.Aivika.Trans.Operation,         module Simulation.Aivika.Trans.Operation.Random,         module Simulation.Aivika.Trans.Parameter,@@ -80,6 +81,7 @@ import Simulation.Aivika.Trans.Generator import Simulation.Aivika.Trans.Net import Simulation.Aivika.Trans.Net.Random+import Simulation.Aivika.Trans.Observable import Simulation.Aivika.Trans.Operation import Simulation.Aivika.Trans.Operation.Random import Simulation.Aivika.Trans.Parameter
Simulation/Aivika/Trans/Activity.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Activity--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It models an activity that can be utilised. The activity is similar to a 'Server' -- but destined for simulation within 'Net' computation.
Simulation/Aivika/Trans/Activity/Random.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Activity.Random--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines some useful predefined activities that -- hold the current process for the corresponding random time
Simulation/Aivika/Trans/Agent.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Agent--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module introduces basic entities for the agent-based modeling. --
Simulation/Aivika/Trans/Array.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Array--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines helper functions for creating mutable arrays. --
Simulation/Aivika/Trans/Arrival.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Arrival--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the types and functions for working with the events -- that can represent something that arrive from outside the model, or
Simulation/Aivika/Trans/Circuit.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Circuit--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It represents a circuit synchronized with the event queue. -- Also it allows creating the recursive links with help of
Simulation/Aivika/Trans/Comp.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Comp--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines a type class of monads based on which the simulation monads can be built. --
Simulation/Aivika/Trans/Cont.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Cont--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The 'Cont' monad is a variation of the standard Cont monad  -- and F# async workflow, where the result of applying 
Simulation/Aivika/Trans/DES.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.DES--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines a type class of monads for Discrete Event Simulation (DES). --
Simulation/Aivika/Trans/DoubleLinkedList.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.DoubleLinkedList--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- An imperative double-linked list. --
Simulation/Aivika/Trans/Dynamics.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Dynamics--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the 'Dynamics' monad tranformer representing a time varying polymorphic function.  --
Simulation/Aivika/Trans/Dynamics/Extra.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Dynamics.Extra--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines auxiliary functions such as interpolation ones -- that complement the memoization, for example. There are scan functions too.
Simulation/Aivika/Trans/Dynamics/Memo.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Dynamics.Memo--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines memo functions. The memoization creates such 'Dynamics' -- computations, which values are cached in the integration time points. Then
Simulation/Aivika/Trans/Dynamics/Memo/Unboxed.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Dynamics.Memo.Unboxed--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the unboxed memo functions. The memoization creates such 'Dynamics' -- computations, which values are cached in the integration time points. Then
Simulation/Aivika/Trans/Dynamics/Random.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Dynamics.Random--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the random functions that always return the same values -- in the integration time points within a single simulation run. The values
Simulation/Aivika/Trans/Event.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Event--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the 'Event' monad which is very similar to the 'Dynamics' -- monad but only now the computation is strongly synchronized with the event queue.@@ -20,6 +20,8 @@         -- * Event Queue         EventQueueing(..),         enqueueEventWithCancellation,+        enqueueEventWithStartTime,+        enqueueEventWithStopTime,         enqueueEventWithTimes,         enqueueEventWithIntegTimes,         yieldEvent,@@ -39,6 +41,12 @@         DisposableEvent(..),         -- * Retrying Computation         retryEvent,+        -- * Synchronizing IO Actions+        EventIOQueueing(..),+        enqueueEventIOWithStartTime,+        enqueueEventIOWithStopTime,+        enqueueEventIOWithTimes,+        enqueueEventIOWithIntegTimes,         -- * Debugging         traceEvent) where 
Simulation/Aivika/Trans/Exception.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Exception--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines a type class of monads with exception handling capabilities. --
Simulation/Aivika/Trans/Gate.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Gate--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines a gate which can be either opened or closed. --
Simulation/Aivika/Trans/Generator.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Generator--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- Below is defined a random number generator. --
Simulation/Aivika/Trans/Generator/Primitive.hs view
@@ -5,7 +5,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This helper module defines primitives for generating random numbers. --
Simulation/Aivika/Trans/Internal/Cont.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Internal.Cont--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The 'Cont' monad is a variation of the standard Cont monad  -- and F# async workflow, where the result of applying 
Simulation/Aivika/Trans/Internal/Dynamics.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Internal.Dynamics--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the 'Dynamics' monad transformer representing a time varying polymorphic function.  --
Simulation/Aivika/Trans/Internal/Event.hs view
@@ -1,13 +1,13 @@ -{-# LANGUAGE RecursiveDo, MultiParamTypeClasses, FlexibleInstances #-}+{-# LANGUAGE RecursiveDo, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts #-}  -- | -- Module     : Simulation.Aivika.Trans.Internal.Event--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the 'Event' monad transformer which is very similar to the 'Dynamics' -- monad transformer but only now the computation is strongly synchronized with the event queue.@@ -23,6 +23,8 @@         -- * Event Queue         EventQueueing(..),         enqueueEventWithCancellation,+        enqueueEventWithStartTime,+        enqueueEventWithStopTime,         enqueueEventWithTimes,         enqueueEventWithPoints,         enqueueEventWithIntegTimes,@@ -43,6 +45,13 @@         DisposableEvent(..),         -- * Retrying Computation         retryEvent,+        -- * Synchronizing IO Actions+        EventIOQueueing(..),+        enqueueEventIOWithStartTime,+        enqueueEventIOWithStopTime,+        enqueueEventIOWithTimes,+        enqueueEventIOWithPoints,+        enqueueEventIOWithIntegTimes,         -- * Debugging         traceEvent) where @@ -198,6 +207,22 @@   let points = integPointsStartingFrom p   in invokeEvent p $ enqueueEventWithPoints points e +-- | Actuate the event handler in the start time point.+enqueueEventWithStartTime :: MonadDES m => Event m () -> Event m ()+{-# INLINABLE enqueueEventWithStartTime #-}+enqueueEventWithStartTime e =+  Event $ \p ->+  let p0 = integStartPoint $ pointRun p+  in invokeEvent p $ enqueueEventWithPoints [p0] e++-- | Actuate the event handler in the final time point.+enqueueEventWithStopTime :: MonadDES m => Event m () -> Event m ()+{-# INLINABLE enqueueEventWithStopTime #-}+enqueueEventWithStopTime e =+  Event $ \p ->+  let p0 = integStopPoint $ pointRun p+  in invokeEvent p $ enqueueEventWithPoints [p0] e+ -- | It allows cancelling the event. data EventCancellation m =   EventCancellation { cancelEvent :: Event m (),@@ -300,7 +325,9 @@   mappend (DisposableEvent x) (DisposableEvent y) = DisposableEvent $ x >> y  -- | Retry the current computation as possible, using the specified argument--- as a 'SimulationRetry' exception message in case of failure.+-- as a 'SimulationRetry' exception message in case of failure. It makes sense+-- for parallel distributed simulation, when we have to make a rollback,+-- awaiting for incoming messages. retryEvent :: MonadException m => String -> Event m a retryEvent message = throwEvent $ SimulationRetry message @@ -311,3 +338,60 @@   Event $ \p ->   trace ("t = " ++ show (pointTime p) ++ ": " ++ message) $   invokeEvent p m++-- | A type class of monads that allows synchronizing the global modeling time+-- before calling the event handler so that it is rather safe to perform 'IO' actions+-- within such a handler. It is mainly destined for parallel distributed simulation,+-- but it should be supported in other cases too.+--+class (EventQueueing m, MonadIO (Event m)) => EventIOQueueing m where++  -- | Like 'enqueueEvent' but synchronizes the global modeling time before+  -- calling the specified event handler.+  enqueueEventIO :: Double -> Event m () -> Event m ()++-- | Like 'enqueueEventWithTimes' but synchronizes the global modeling time+-- before calling the specified event handler.+enqueueEventIOWithTimes :: (MonadDES m, EventIOQueueing m) => [Double] -> Event m () -> Event m ()+{-# INLINABLE enqueueEventIOWithTimes #-}+enqueueEventIOWithTimes ts e = loop ts+  where loop []       = return ()+        loop (t : ts) = enqueueEventIO t $ e >> loop ts+       +-- | Like 'enqueueEventWithPoints' but synchronizes the global modeling time+-- before calling the specified event handler.+enqueueEventIOWithPoints :: (MonadDES m, EventIOQueueing m) => [Point m] -> Event m () -> Event m ()+{-# INLINABLE enqueueEventIOWithPoints #-}+enqueueEventIOWithPoints xs (Event e) = loop xs+  where loop []       = return ()+        loop (x : xs) = enqueueEventIO (pointTime x) $ +                        Event $ \p ->+                        do e x    -- N.B. we substitute the time point!+                           invokeEvent p $ loop xs+                           +-- | Like 'enqueueEventWithIntegTimes' but synchronizes the global modeling time+-- before calling the specified event handler.+enqueueEventIOWithIntegTimes :: (MonadDES m, EventIOQueueing m) => Event m () -> Event m ()+{-# INLINABLE enqueueEventIOWithIntegTimes #-}+enqueueEventIOWithIntegTimes e =+  Event $ \p ->+  let points = integPointsStartingFrom p+  in invokeEvent p $ enqueueEventIOWithPoints points e++-- | Like 'enqueueEventWithStartTime' but synchronizes the global modeling time+-- before calling the specified event handler.+enqueueEventIOWithStartTime :: (MonadDES m, EventIOQueueing m) => Event m () -> Event m ()+{-# INLINABLE enqueueEventIOWithStartTime #-}+enqueueEventIOWithStartTime e =+  Event $ \p ->+  let p0 = integStartPoint $ pointRun p+  in invokeEvent p $ enqueueEventIOWithPoints [p0] e++-- | Like 'enqueueEventWithStopTime' but synchronizes the global modeling time+-- before calling the specified event handler.+enqueueEventIOWithStopTime :: (MonadDES m, EventIOQueueing m) => Event m () -> Event m ()+{-# INLINABLE enqueueEventIOWithStopTime #-}+enqueueEventIOWithStopTime e =+  Event $ \p ->+  let p0 = integStopPoint $ pointRun p+  in invokeEvent p $ enqueueEventIOWithPoints [p0] e
Simulation/Aivika/Trans/Internal/Parameter.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Internal.Parameter--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the 'Parameter' monad transformer that allows representing the model -- parameters. For example, they can be used when running the Monte-Carlo simulation.
Simulation/Aivika/Trans/Internal/Process.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Internal.Process--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- A value in the 'Process' monad represents a discontinuous process that  -- can suspend in any simulation time point and then resume later in the same 
Simulation/Aivika/Trans/Internal/Simulation.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Internal.Simulation--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the 'Simulation' monad transformer that represents a computation -- within the simulation run.
Simulation/Aivika/Trans/Internal/Specs.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Internal.Specs--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines the simulation specs and related stuff. module Simulation.Aivika.Trans.Internal.Specs
Simulation/Aivika/Trans/Internal/Types.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Internal.Types--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines the implementation details of some types. You should never -- use it in ordinary simulation models. The module is destined for those
Simulation/Aivika/Trans/Net.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Net--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines a 'Net' arrow that can be applied to modeling the queue networks -- like the 'Processor' arrow from another module. Only the former has a more efficient
Simulation/Aivika/Trans/Net/Random.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Net.Random--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines some useful random network computations that -- hold the current process for the corresponding time interval,
+ Simulation/Aivika/Trans/Observable.hs view
@@ -0,0 +1,24 @@++{-# LANGUAGE TypeFamilies, MultiParamTypeClasses #-}++-- |+-- Module     : Simulation.Aivika.Trans.Observable+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com>+-- License    : BSD3+-- Maintainer : David Sorokin <david.sorokin@gmail.com>+-- Stability  : experimental+-- Tested with: GHC 8.0.1+--+-- This module defines an observable entity, which value can be read within some computation.+--+module Simulation.Aivika.Trans.Observable+       (Observable(..)) where++import Control.Monad+import Control.Monad.Trans++-- | A class of observable entities.+class Observable o m where++  -- | Read the observable entity value within the specified computation.+  readObservable :: o a -> m a
Simulation/Aivika/Trans/Operation.hs view
@@ -5,7 +5,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- It defines a stateless activity, some simplification of 'Server' and 'Activity'. module Simulation.Aivika.Trans.Operation
Simulation/Aivika/Trans/Operation/Random.hs view
@@ -5,7 +5,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module defines some useful predefined operations that -- hold the current process for the corresponding random time
Simulation/Aivika/Trans/Parameter.hs view
@@ -1,10 +1,10 @@ -- | -- Module     : Simulation.Aivika.Trans.Parameter--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the 'Parameter' monad transformer that allows representing the model -- parameters. For example, they can be used when running the Monte-Carlo simulation.
Simulation/Aivika/Trans/Parameter/Random.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Parameter.Random--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the random parameters of simulation experiments. --
Simulation/Aivika/Trans/Process.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Process--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- A value in the 'Process' monad represents a discontinuous process that  -- can suspend in any simulation time point and then resume later in the same 
Simulation/Aivika/Trans/Process/Random.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Process.Random--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines helper functions, which are useful to hold  -- the 'Process' computation for a time interval according to some
Simulation/Aivika/Trans/Processor.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Processor--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The processor of simulation data. --
Simulation/Aivika/Trans/Processor/Random.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Processor.Random--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines some useful random processors that -- hold the current process for the corresponding time interval,
Simulation/Aivika/Trans/Processor/RoundRobbin.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Processor.RoundRobbin--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the Round-Robbin processor. --
Simulation/Aivika/Trans/Queue.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Queue--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines a queue that can use the specified strategies. So, having only -- the 'FCFS', 'LCFS', 'SIRO' and 'StaticPriorities' strategies, you can build
Simulation/Aivika/Trans/Queue/Base.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module defines an optimised finite queue, which has no counters nor signals. --
Simulation/Aivika/Trans/Queue/Infinite.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Queue.Infinite--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines an infinite queue that can use the specified strategies. --
Simulation/Aivika/Trans/Queue/Infinite/Base.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module defines an infinite optimised queue, which has no counters nor signals. --
Simulation/Aivika/Trans/QueueStrategy.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.QueueStrategy--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the queue strategies. --
Simulation/Aivika/Trans/Ref.hs view
@@ -1,11 +1,13 @@ +{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, UndecidableInstances #-}+ -- | -- Module     : Simulation.Aivika.Trans.Ref--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines an updatable reference that depends on the event queue. --@@ -29,6 +31,7 @@ import Simulation.Aivika.Trans.Signal import qualified Simulation.Aivika.Trans.Ref.Base as B import Simulation.Aivika.Trans.DES+import Simulation.Aivika.Trans.Observable  -- | The 'Ref' type represents a mutable variable similar to the 'IORef' variable  -- but only dependent on the event queue, which allows synchronizing the reference@@ -91,3 +94,8 @@    {-# INLINE (==) #-}   r1 == r2 = (refValue r1) == (refValue r2)++instance (MonadDES m, Observable (B.Ref m) (t m))  => Observable (Ref m) (t m) where++  {-# INLINE readObservable #-}+  readObservable r = readObservable (refValue r)
Simulation/Aivika/Trans/Ref/Base.hs view
@@ -1,13 +1,13 @@ -{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeFamilies, MultiParamTypeClasses #-}  -- | -- Module     : Simulation.Aivika.Trans.Ref.Base--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines a plain and more fast version of an updatable reference -- that depends on the event queue but that doesn't supply with the signal notification.@@ -22,11 +22,12 @@ import Control.Monad.Trans  import Simulation.Aivika.Trans.Internal.Types+import Simulation.Aivika.Trans.Observable  -- | A monad within which we can create mutable references. class Monad m => MonadRef m where -  -- | The 'ProtoRef' type represents a mutable variable similar to the 'IORef' variable +  -- | The 'Ref' type represents a mutable variable similar to the 'IORef' variable    -- but only dependent on the event queue, which allows synchronizing the reference   -- with the model explicitly through the 'Event' monad.   data Ref m a@@ -56,3 +57,8 @@    -- | Create a new reference within more low level computation than 'Simulation'.   newRef0 :: a -> m (Ref m a)++instance (Monad m, MonadRef m) => Observable (Ref m) (Event m) where++  {-# INLINE readObservable #-}+  readObservable = readRef
Simulation/Aivika/Trans/Resource.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the resource which can be acquired and  -- then released by the discontinuous process 'Process'.
Simulation/Aivika/Trans/Resource/Base.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module defines an optimised version of the resource  -- which can be acquired and then released by the discontinuous 
Simulation/Aivika/Trans/Resource/Preemption.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Resource.Preemption--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the preemptible resource. --
Simulation/Aivika/Trans/Resource/Preemption/Base.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.3+-- Tested with: GHC 8.0.1 -- -- This module defines the preemptible resource. --
Simulation/Aivika/Trans/Results.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Results--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module allows exporting the simulation results from the model. --
Simulation/Aivika/Trans/Results/IO.hs view
@@ -1,11 +1,13 @@ +{-# LANGUAGE FlexibleContexts #-}+ -- | -- Module     : Simulation.Aivika.Trans.Results.IO--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module allows printing and converting the 'Simulation' 'Results' to a 'String'. --@@ -48,6 +50,15 @@         printResultSource,         printResultSourceInRussian,         printResultSourceInEnglish,+        -- * Enqueue Printing of the Result Source+        hEnqueuePrintingResultSourceIndented,+        hEnqueuePrintingResultSource,+        hEnqueuePrintingResultSourceInRussian,+        hEnqueuePrintingResultSourceInEnglish,+        enqueuePrintingResultSourceIndented,+        enqueuePrintingResultSource,+        enqueuePrintingResultSourceInRussian,+        enqueuePrintingResultSourceInEnglish,         -- * Showing the Result Source         showResultSourceIndented,         showResultSource,@@ -68,6 +79,7 @@ import Simulation.Aivika.Trans.Simulation import Simulation.Aivika.Trans.Dynamics import Simulation.Aivika.Trans.Event+import Simulation.Aivika.Trans.Ref import Simulation.Aivika.Trans.Results import Simulation.Aivika.Trans.Results.Locale @@ -81,7 +93,7 @@  -- | Print a localised text representation of the results by the specified source -- and with the given indent.-hPrintResultSourceIndented :: (MonadDES m, MonadIO m)+hPrintResultSourceIndented :: (MonadDES m, MonadIO (Event m))                               => Handle                               -- ^ a handle                               -> Int@@ -101,7 +113,7 @@  -- | Print an indented and labelled text representation of the results by -- the specified source.-hPrintResultSourceIndentedLabelled :: (MonadDES m, MonadIO m)+hPrintResultSourceIndentedLabelled :: (MonadDES m, MonadIO (Event m))                                       => Handle                                       -- ^ a handle                                       -> Int@@ -167,7 +179,7 @@  -- | Print a localised text representation of the results by the specified source -- and with the given indent.-printResultSourceIndented :: (MonadDES m, MonadIO m)+printResultSourceIndented :: (MonadDES m, MonadIO (Event m))                              => Int                              -- ^ an indent                              -> ResultLocalisation@@ -177,7 +189,7 @@ printResultSourceIndented = hPrintResultSourceIndented stdout  -- | Print a localised text representation of the results by the specified source.-hPrintResultSource :: (MonadDES m, MonadIO m)+hPrintResultSource :: (MonadDES m, MonadIO (Event m))                       => Handle                       -- ^ a handle                       -> ResultLocalisation@@ -187,7 +199,7 @@ hPrintResultSource h = hPrintResultSourceIndented h 0  -- | Print a localised text representation of the results by the specified source.-printResultSource :: (MonadDES m, MonadIO m)+printResultSource :: (MonadDES m, MonadIO (Event m))                      => ResultLocalisation                      -- ^ a localisation                      -> ResultSourcePrint m@@ -195,25 +207,90 @@ printResultSource = hPrintResultSource stdout  -- | Print in Russian a text representation of the results by the specified source.-hPrintResultSourceInRussian :: (MonadDES m, MonadIO m) => Handle -> ResultSourcePrint m+hPrintResultSourceInRussian :: (MonadDES m, MonadIO (Event m)) => Handle -> ResultSourcePrint m {-# INLINABLE hPrintResultSourceInRussian #-} hPrintResultSourceInRussian h = hPrintResultSource h russianResultLocalisation  -- | Print in English a text representation of the results by the specified source.-hPrintResultSourceInEnglish :: (MonadDES m, MonadIO m) => Handle -> ResultSourcePrint m+hPrintResultSourceInEnglish :: (MonadDES m, MonadIO (Event m)) => Handle -> ResultSourcePrint m {-# INLINABLE hPrintResultSourceInEnglish #-} hPrintResultSourceInEnglish h = hPrintResultSource h englishResultLocalisation  -- | Print in Russian a text representation of the results by the specified source.-printResultSourceInRussian :: (MonadDES m, MonadIO m) => ResultSourcePrint m+printResultSourceInRussian :: (MonadDES m, MonadIO (Event m)) => ResultSourcePrint m {-# INLINABLE printResultSourceInRussian #-} printResultSourceInRussian = hPrintResultSourceInRussian stdout  -- | Print in English a text representation of the results by the specified source.-printResultSourceInEnglish :: (MonadDES m, MonadIO m) => ResultSourcePrint m+printResultSourceInEnglish :: (MonadDES m, MonadIO (Event m)) => ResultSourcePrint m {-# INLINABLE printResultSourceInEnglish #-} printResultSourceInEnglish = hPrintResultSourceInEnglish stdout +-- | Enqueue printing of a localised text representation of the results by the specified source+-- and with the given indent.+hEnqueuePrintingResultSourceIndented :: (MonadDES m, EventIOQueueing m)+                                        => Handle+                                        -- ^ a handle+                                        -> Int+                                        -- ^ an indent+                                        -> ResultLocalisation+                                        -- ^ a localisation+                                        -> ResultSourcePrint m+{-# INLINABLE hEnqueuePrintingResultSourceIndented #-}+hEnqueuePrintingResultSourceIndented h indent loc source =+  do t <- liftDynamics time+     enqueueEventIO t $+       hPrintResultSourceIndented h indent loc source++-- | Enqueue printing of a localised text representation of the results by the specified source+-- and with the given indent.+enqueuePrintingResultSourceIndented :: (MonadDES m, EventIOQueueing m)+                                       => Int+                                       -- ^ an indent+                                       -> ResultLocalisation+                                       -- ^ a localisation+                                       -> ResultSourcePrint m+{-# INLINABLE enqueuePrintingResultSourceIndented #-}+enqueuePrintingResultSourceIndented = hEnqueuePrintingResultSourceIndented stdout++-- | Enqueue printing of a localised text representation of the results by the specified source.+hEnqueuePrintingResultSource :: (MonadDES m, EventIOQueueing m)+                                => Handle+                                -- ^ a handle+                                -> ResultLocalisation+                                -- ^ a localisation+                                -> ResultSourcePrint m+{-# INLINABLE hEnqueuePrintingResultSource #-}+hEnqueuePrintingResultSource h = hEnqueuePrintingResultSourceIndented h 0++-- | Enqueue printing of a localised text representation of the results by the specified source.+enqueuePrintingResultSource :: (MonadDES m, EventIOQueueing m)+                               => ResultLocalisation+                               -- ^ a localisation+                               -> ResultSourcePrint m+{-# INLINABLE enqueuePrintingResultSource #-}+enqueuePrintingResultSource = hEnqueuePrintingResultSource stdout++-- | Enqueue printing in Russian of a text representation of the results by the specified source.+hEnqueuePrintingResultSourceInRussian :: (MonadDES m, EventIOQueueing m) => Handle -> ResultSourcePrint m+{-# INLINABLE hEnqueuePrintingResultSourceInRussian #-}+hEnqueuePrintingResultSourceInRussian h = hEnqueuePrintingResultSource h russianResultLocalisation++-- | Enqueue printing in English of a text representation of the results by the specified source.+hEnqueuePrintingResultSourceInEnglish :: (MonadDES m, EventIOQueueing m) => Handle -> ResultSourcePrint m+{-# INLINABLE hEnqueuePrintingResultSourceInEnglish #-}+hEnqueuePrintingResultSourceInEnglish h = hEnqueuePrintingResultSource h englishResultLocalisation++-- | Enqueue printing in Russian of a text representation of the results by the specified source.+enqueuePrintingResultSourceInRussian :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m+{-# INLINABLE enqueuePrintingResultSourceInRussian #-}+enqueuePrintingResultSourceInRussian = hEnqueuePrintingResultSourceInRussian stdout++-- | Enqueue printing in English of a text representation of the results by the specified source.+enqueuePrintingResultSourceInEnglish :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m+{-# INLINABLE enqueuePrintingResultSourceInEnglish #-}+enqueuePrintingResultSourceInEnglish = hEnqueuePrintingResultSourceInEnglish stdout+ -- | Show a localised text representation of the results by the specified source -- and with the given indent. showResultSourceIndented :: MonadDES m@@ -317,7 +394,7 @@ showResultSourceInEnglish = showResultSource englishResultLocalisation  -- | Print the results with the information about the modeling time.-printResultsWithTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Results m -> Event m ()+printResultsWithTime :: (MonadDES m, MonadIO (Event m)) => ResultSourcePrint m -> Results m -> Event m () {-# INLINABLE printResultsWithTime #-} printResultsWithTime print results =   do let x1 = textResultSource "----------"@@ -331,43 +408,54 @@      -- print x3  -- | Print the simulation results in start time.-printResultsInStartTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Results m -> Simulation m ()+printResultsInStartTime :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Results m -> Simulation m () {-# INLINABLE printResultsInStartTime #-} printResultsInStartTime print results =-  runEventInStartTime $ printResultsWithTime print results+  do runEventInStartTime $+       enqueueEventIOWithStartTime $+       printResultsWithTime print results+     runEventInStopTime $+       return ()  -- | Print the simulation results in stop time.-printResultsInStopTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Results m -> Simulation m ()+printResultsInStopTime :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Results m -> Simulation m () {-# INLINABLE printResultsInStopTime #-} printResultsInStopTime print results =-  runEventInStopTime $ printResultsWithTime print results+  do runEventInStartTime $+       enqueueEventIOWithStopTime $+       printResultsWithTime print results+     runEventInStopTime $+       return ()  -- | Print the simulation results in the integration time points.-printResultsInIntegTimes :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Results m -> Simulation m ()+printResultsInIntegTimes :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Results m -> Simulation m () {-# INLINABLE printResultsInIntegTimes #-} printResultsInIntegTimes print results =-  do let loop (m : ms) = m >> loop ms-         loop [] = return ()-     ms <- runDynamicsInIntegTimes $ runEvent $-           printResultsWithTime print results-     liftComp $ loop ms+  do runEventInStartTime $+       enqueueEventIOWithIntegTimes $+       printResultsWithTime print results+     runEventInStopTime $+       return ()  -- | Print the simulation results in the specified time.-printResultsInTime :: (MonadDES m, MonadIO m) => Double -> ResultSourcePrint m -> Results m -> Simulation m ()+printResultsInTime :: (MonadDES m, EventIOQueueing m) => Double -> ResultSourcePrint m -> Results m -> Simulation m () {-# INLINABLE printResultsInTime #-} printResultsInTime t print results =-  runDynamicsInTime t $ runEvent $-  printResultsWithTime print results+  do runEventInStartTime $+       enqueueEventIO t $+       printResultsWithTime print results+     runEventInStopTime $+       return ()  -- | Print the simulation results in the specified time points.-printResultsInTimes :: (MonadDES m, MonadIO m) => [Double] -> ResultSourcePrint m -> Results m -> Simulation m ()+printResultsInTimes :: (MonadDES m, EventIOQueueing m) => [Double] -> ResultSourcePrint m -> Results m -> Simulation m () {-# INLINABLE printResultsInTimes #-} printResultsInTimes ts print results =-  do let loop (m : ms) = m >> loop ms-         loop [] = return ()-     ms <- runDynamicsInTimes ts $ runEvent $-           printResultsWithTime print results-     liftComp $ loop ms+  do runEventInStartTime $+       enqueueEventIOWithTimes ts $+       printResultsWithTime print results+     runEventInStopTime $+       return ()  -- | Show the results with the information about the modeling time. showResultsWithTime :: MonadDES m => ResultSourceShowS m -> Results m -> Event m ShowS@@ -392,7 +480,8 @@ showResultsInStartTime :: MonadDES m => ResultSourceShowS m -> Results m -> Simulation m ShowS {-# INLINABLE showResultsInStartTime #-} showResultsInStartTime f results =-  runEventInStartTime $ showResultsWithTime f results+  do g <- runEventInStartTime $ showResultsWithTime f results+     runEventInStopTime $ return g  -- | Show the simulation results in stop time. showResultsInStopTime :: MonadDES m => ResultSourceShowS m -> Results m -> Simulation m ShowS@@ -407,18 +496,25 @@ showResultsInIntegTimes :: MonadDES m => ResultSourceShowS m -> Results m -> Simulation m ShowS {-# INLINABLE showResultsInIntegTimes #-} showResultsInIntegTimes f results =-  do let loop (m : ms) = return (.) `ap` m `ap` loop ms-         loop [] = return id-     ms <- runDynamicsInIntegTimes $ runEvent $-           showResultsWithTime f results-     liftComp $ loop ms+  do r <- newRef id+     runEventInStartTime $+       enqueueEventWithIntegTimes $+       do g <- showResultsWithTime f results+          modifyRef r (. g)+     runEventInStopTime $+       readRef r  -- | Show the simulation results in the specified time point. showResultsInTime :: MonadDES m => Double -> ResultSourceShowS m -> Results m -> Simulation m ShowS {-# INLINABLE showResultsInTime #-} showResultsInTime t f results =-  runDynamicsInTime t $ runEvent $-  showResultsWithTime f results+  do r <- newRef id+     runEventInStartTime $+       enqueueEvent t $+       do g <- showResultsWithTime f results+          writeRef r g+     runEventInStopTime $+       readRef r  -- | Show the simulation results in the specified time points. --@@ -427,42 +523,44 @@ showResultsInTimes :: MonadDES m => [Double] -> ResultSourceShowS m -> Results m -> Simulation m ShowS {-# INLINABLE showResultsInTimes #-} showResultsInTimes ts f results =-  do let loop (m : ms) = return (.) `ap` m `ap` loop ms-         loop [] = return id-     ms <- runDynamicsInTimes ts $ runEvent $-           showResultsWithTime f results-     liftComp $ loop ms+  do r <- newRef id+     runEventInStartTime $+       enqueueEventWithTimes ts $+       do g <- showResultsWithTime f results+          modifyRef r (. g)+     runEventInStopTime $+       readRef r  -- | Run the simulation and then print the results in the start time.-printSimulationResultsInStartTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()+printSimulationResultsInStartTime :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m () {-# INLINABLE printSimulationResultsInStartTime #-} printSimulationResultsInStartTime print model specs =   flip runSimulation specs $   model >>= printResultsInStartTime print  -- | Run the simulation and then print the results in the final time.-printSimulationResultsInStopTime :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()+printSimulationResultsInStopTime :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m () {-# INLINABLE printSimulationResultsInStopTime #-} printSimulationResultsInStopTime print model specs =   flip runSimulation specs $   model >>= printResultsInStopTime print  -- | Run the simulation and then print the results in the integration time points.-printSimulationResultsInIntegTimes :: (MonadDES m, MonadIO m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()+printSimulationResultsInIntegTimes :: (MonadDES m, EventIOQueueing m) => ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m () {-# INLINABLE printSimulationResultsInIntegTimes #-} printSimulationResultsInIntegTimes print model specs =   flip runSimulation specs $   model >>= printResultsInIntegTimes print  -- | Run the simulation and then print the results in the specified time point.-printSimulationResultsInTime :: (MonadDES m, MonadIO m) => Double -> ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()+printSimulationResultsInTime :: (MonadDES m, EventIOQueueing m) => Double -> ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m () {-# INLINABLE printSimulationResultsInTime #-} printSimulationResultsInTime t print model specs =   flip runSimulation specs $   model >>= printResultsInTime t print  -- | Run the simulation and then print the results in the specified time points.-printSimulationResultsInTimes :: (MonadDES m, MonadIO m) => [Double] -> ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m ()+printSimulationResultsInTimes :: (MonadDES m, EventIOQueueing m) => [Double] -> ResultSourcePrint m -> Simulation m (Results m) -> Specs m -> m () {-# INLINABLE printSimulationResultsInTimes #-} printSimulationResultsInTimes ts print model specs =   flip runSimulation specs $
Simulation/Aivika/Trans/Results/Locale.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Results.Locale--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines locales for outputting and printing the simulation results. --
Simulation/Aivika/Trans/SD.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.SD--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines a type class of monads for System Dynamics (SD). --
Simulation/Aivika/Trans/Server.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Server--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It models the server that prodives a service. module Simulation.Aivika.Trans.Server
Simulation/Aivika/Trans/Server/Random.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Server.Random--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines some useful predefined servers that -- hold the current process for the corresponding random time
Simulation/Aivika/Trans/Signal.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Signal--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the signal which we can subscribe handlers to.  -- These handlers can be disposed. The signal is triggered in the 
Simulation/Aivika/Trans/Simulation.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Simulation--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines the 'Simulation' monad transformer that represents a simulation run. -- 
Simulation/Aivika/Trans/Specs.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Specs--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines the simulation specs and functions for this data type. module Simulation.Aivika.Trans.Specs
Simulation/Aivika/Trans/Statistics.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Statistics--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- Represents statistics. --
Simulation/Aivika/Trans/Statistics/Accumulator.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Statistics.Accumulator--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This small utility module allows accumulating the timing statistics based on 'Signalable' data -- such as the queue size or the number of lost items in the queue.
Simulation/Aivika/Trans/Stream.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Stream--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The infinite stream of data in time. --
Simulation/Aivika/Trans/Stream/Random.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Stream.Random--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines random streams of events, which are useful -- for describing the input of the model.
Simulation/Aivika/Trans/SystemDynamics.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.SystemDynamics--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines integrals and other functions of System Dynamics. --
Simulation/Aivika/Trans/Table.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Table--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines the table functions. --
Simulation/Aivika/Trans/Task.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Task--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The 'Task' value represents a process that was already started in background. -- We can check the completion of the task, receive notifications about changing
Simulation/Aivika/Trans/Template.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Template--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- It defines an explicit type sub-class of 'IO'-based monads on top of which -- the simulation monads can be automatically generated.
Simulation/Aivika/Trans/Transform.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Transform--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- The module defines something which is most close to the notion of -- analogous circuit as an opposite to the digital one.@@ -93,15 +93,15 @@        c' <- g b        return $ liftM2 (,) c c' -instance (MonadSD m, MonadFix m) => ArrowLoop (Transform m) where--  {-# INLINABLE loop #-}-  loop (Transform f) =-    Transform $ \b ->-    mdo let bd = liftM2 (,) b d-        cd <- f bd-        (c, d) <- M.unzip0Dynamics cd-        return c+-- instance (MonadSD m, MonadFix m) => ArrowLoop (Transform m) where+-- +--   {-# INLINABLE loop #-}+--   loop (Transform f) =+--     Transform $ \b ->+--     mdo let bd = liftM2 (,) b d+--         cd <- f bd+--         (c, d) <- M.unzip0Dynamics cd+--         return c  -- | A transform that returns the current modeling time. timeTransform :: Monad m => Transform m a Double
Simulation/Aivika/Trans/Transform/Extra.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Transform.Extra--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines auxiliary computations such as interpolation ones -- that complement the memoization, for example. There are scan computations too.
Simulation/Aivika/Trans/Transform/Memo.hs view
@@ -1,11 +1,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Transform.Memo--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines memoization transforms. The memoization creates such 'Dynamics' -- computations, which values are cached in the integration time points. Then
Simulation/Aivika/Trans/Transform/Memo/Unboxed.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Transform.Memo.Unboxed--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines the unboxed memoization transforms. The memoization creates such 'Dynamics' -- computations, which values are cached in the integration time points. Then
Simulation/Aivika/Trans/Var.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Var--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines a variable that is bound up with the event queue and  -- that keeps the history of changes storing the values in arrays, which
Simulation/Aivika/Trans/Var/Unboxed.hs view
@@ -3,11 +3,11 @@  -- | -- Module     : Simulation.Aivika.Trans.Var.Unboxed--- Copyright  : Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com>+-- Copyright  : Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.10.1+-- Tested with: GHC 8.0.1 -- -- This module defines an unboxed variable that is bound up with the event queue and  -- that keeps the history of changes storing the values in unboxed arrays, which
aivika-transformers.cabal view
@@ -1,8 +1,8 @@ name:            aivika-transformers-version:         4.3.5+version:         4.5 synopsis:        Transformers for the Aivika simulation library description:-    This package is a generalization of the Aivika [1] simulation library+    This package is a generalization of the aivika [1] simulation library     with extensive use of monad transformers and type families.     .     \[1] <http://hackage.haskell.org/package/aivika>@@ -70,6 +70,7 @@                      Simulation.Aivika.Trans.Internal.Types                      Simulation.Aivika.Trans.Net                      Simulation.Aivika.Trans.Net.Random+                     Simulation.Aivika.Trans.Observable                      Simulation.Aivika.Trans.Operation                      Simulation.Aivika.Trans.Operation.Random                      Simulation.Aivika.Trans.Parameter@@ -144,7 +145,7 @@                      containers >= 0.4.0.0,                      random >= 1.0.0.3,                      vector >= 0.10.0.1,-                     aivika >= 4.3.5+                     aivika >= 4.5      other-extensions:   FlexibleContexts,                         FlexibleInstances,