aivika-branches 0.3.2 → 0.4
raw patch · 5 files changed
+18/−16 lines, 5 filesdep ~aivikadep ~aivika-transformersPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aivika, aivika-transformers
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−1
- Simulation/Aivika/Branch/BR.hs +1/−1
- Simulation/Aivika/Branch/Event.hs +5/−4
- Simulation/Aivika/Branch/Internal/BR.hs +0/−3
- aivika-branches.cabal +7/−7
CHANGELOG.md view
@@ -1,9 +1,13 @@ +Version 0.4+-----++* Introduced the discrete event priorities.+ Version 0.3 ----- * Using the mwc-random package for generating random numbers by default.- Version 0.2 -----
Simulation/Aivika/Branch/BR.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE FlexibleInstances #-} -- |--- Module : Simulation.Aivika.Branch.Br+-- Module : Simulation.Aivika.Branch.BR -- Copyright : Copyright (c) 2016-2017, David Sorokin <david.sorokin@gmail.com> -- License : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com>
Simulation/Aivika/Branch/Event.hs view
@@ -22,7 +22,7 @@ import Control.Monad import Control.Monad.Trans -import qualified Simulation.Aivika.PriorityQueue.Pure as PQ+import qualified Simulation.Aivika.PriorityQueue.EventQueue.Pure as PQ import Simulation.Aivika.Trans import Simulation.Aivika.Trans.Internal.Types@@ -50,11 +50,11 @@ queueBusy = f, queueTime = t } - enqueueEvent t (Event m) =+ enqueueEventWithPriority t priority (Event m) = Event $ \p -> BR $ \ps -> let pq = queuePQ $ runEventQueue $ pointRun p- in modifyIORef pq $ \x -> PQ.enqueue x t m+ in modifyIORef pq $ \x -> PQ.enqueue x t priority m runEventWith processing (Event e) = Dynamics $ \p ->@@ -84,7 +84,7 @@ r = pointRun p f <- fmap PQ.queueNull $ readIORef pq unless f $- do (t2, c2) <- fmap PQ.queueFront $ readIORef pq+ do (t2, priority2, c2) <- fmap PQ.queueFront $ readIORef pq let t = queueTime q t' <- readIORef t when (t2 < t') $ @@ -99,6 +99,7 @@ n2 = fromIntegral $ floor ((t2 - t0) / dt) invokeBR ps $ c2 $ p { pointTime = t2,+ pointPriority = priority2, pointIteration = n2, pointPhase = -1 } call q p ps
Simulation/Aivika/Branch/Internal/BR.hs view
@@ -54,9 +54,6 @@ instance Monad m => Monad (BR m) where - {-# INLINE return #-}- return = BR . const . return- {-# INLINE (>>=) #-} (BR m) >>= k = BR $ \ps -> m ps >>= \a ->
aivika-branches.cabal view
@@ -1,5 +1,5 @@ name: aivika-branches-version: 0.3.2+version: 0.4 synopsis: Nested discrete event simulation module for the Aivika library description: This package extends the aivika-transformers [1] library and allows creating branches to run@@ -17,10 +17,10 @@ category: Simulation license: BSD3 license-file: LICENSE-copyright: (c) 2016-2017. David Sorokin <david.sorokin@gmail.com>+copyright: (c) 2016-2023. David Sorokin <davsor@mail.ru> author: David Sorokin-maintainer: David Sorokin <david.sorokin@gmail.com>-homepage: http://www.aivikasoft.com+maintainer: David Sorokin <davsor@mail.ru>+homepage: https://gitflic.ru/project/dsorokin/aivika-branches cabal-version: >= 1.10 build-type: Simple tested-with: GHC == 8.0.1@@ -51,8 +51,8 @@ containers >= 0.4.0.0, random >= 1.0.0.3, mwc-random >= 0.13.1.0,- aivika >= 5.9.1,- aivika-transformers >= 5.9.1+ aivika >= 6.0.0,+ aivika-transformers >= 6.0.0 other-extensions: TypeFamilies, MultiParamTypeClasses,@@ -66,4 +66,4 @@ source-repository head type: git- location: https://github.com/dsorokin/aivika-branches+ location: https://gitflic.ru/project/dsorokin/aivika-branches