module Simulation.Aivika.Dynamics.Internal.Time
(starttime,
stoptime,
dt,
time,
integTimes,
isTimeInteg,
integIteration,
integPhase) 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 :: Specs -> [Double]
integTimes sc = map t [nl .. nu]
where (nl, nu) = integIterationBnds sc
t n = basicTime sc n 0
isTimeInteg :: Dynamics Bool
isTimeInteg = Dynamics $ \p -> return $ pointPhase p >= 0
integIteration :: Dynamics Int
integIteration = Dynamics $ return . pointIteration
integPhase :: Dynamics Int
integPhase = Dynamics $ return . pointPhase