module Simulation.Aivika.Dynamics.Internal.Time
(starttime,
stoptime,
dt,
time,
integTimes) where
import Simulation.Aivika.Dynamics.Internal.Simulation
import Simulation.Aivika.Dynamics.Internal.Dynamics
starttime :: Dynamics Double
starttime = Dynamics $ return . spcStartTime . pointSpecs
stoptime :: Dynamics Double
stoptime = Dynamics $ return . spcStopTime . pointSpecs
dt :: Dynamics Double
dt = Dynamics $ return . spcDT . pointSpecs
time :: Dynamics Double
time = Dynamics $ return . pointTime
integTimes :: Simulation [Double]
integTimes =
Simulation $ \r ->
do let sc = runSpecs r
(nl, nu) = iterationBnds sc
t n = basicTime sc n 0
return $ map t [nl .. nu]