aivika-experiment-chart 0.3 → 0.3.1
raw patch · 10 files changed
+263/−150 lines, 10 filesdep ~aivikadep ~aivika-experimentPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aivika, aivika-experiment
API changes (from Hackage documentation)
Files
- Simulation/Aivika/Experiment/DeviationChartView.hs +27/−30
- Simulation/Aivika/Experiment/FinalHistogramView.hs +10/−18
- Simulation/Aivika/Experiment/FinalXYChartView.hs +28/−35
- Simulation/Aivika/Experiment/HistogramView.hs +2/−3
- Simulation/Aivika/Experiment/TimeSeriesView.hs +38/−26
- Simulation/Aivika/Experiment/XYChartView.hs +43/−33
- aivika-experiment-chart.cabal +5/−3
- examples/LinearArray.hs +105/−0
- examples/MachRep3.hs +0/−2
- examples/README +5/−0
Simulation/Aivika/Experiment/DeviationChartView.hs view
@@ -42,7 +42,6 @@ import Simulation.Aivika.Dynamics import Simulation.Aivika.Dynamics.Simulation import Simulation.Aivika.Dynamics.Signal-import Simulation.Aivika.Dynamics.EventQueue import Simulation.Aivika.Dynamics.Base (starttime, integIterationBnds, integTimes, integIteration) import Simulation.Aivika.Statistics @@ -64,7 +63,7 @@ -- An example is -- -- @- -- deviationChartFileName = UniqueFileName \"$TITLE\", \".png\"+ -- deviationChartFileName = UniqueFileName \"$TITLE\" \".png\" -- @ deviationChartSeries :: [Either String String], -- ^ It contains the labels of data plotted@@ -176,25 +175,28 @@ -- | Simulate the specified series. simulateDeviationChart :: DeviationChartViewState -> ExperimentData -> Dynamics (Dynamics ()) simulateDeviationChart st expdata =- do let protolabels = deviationChartSeries $ deviationChartView st- protoproviders = flip map protolabels $ \protolabel ->- case protolabel of- Left label -> map Left $ experimentSeriesProviders expdata [label]- Right label -> map Right $ experimentSeriesProviders expdata [label]- joinedproviders = join protoproviders- providers = flip map joinedproviders $ either id id - input =+ do let labels = deviationChartSeries $ deviationChartView st+ (leftLabels, rightLabels) = partitionEithers labels + (leftProviders, rightProviders) =+ (experimentSeriesProviders expdata leftLabels,+ experimentSeriesProviders expdata rightLabels)+ providerInput providers = flip map providers $ \provider -> case providerToDoubleStatsSource provider of Nothing -> error $ "Cannot represent series " ++ providerName provider ++ - " as a series of double values: simulateDeviationChart"- Just input -> samplingStatsSourceData input- names = flip map joinedproviders $ \protoprovider ->- case protoprovider of- Left provider -> Left $ providerName provider- Right provider -> Right $ providerName provider+ " as a source of double values: simulateDeviationChart"+ Just input -> (providerName provider,+ provider,+ samplingStatsSourceData input)+ leftInput = providerInput leftProviders+ rightInput = providerInput rightProviders+ leftNames = flip map leftInput $ \(x, _, _) -> Left x+ rightNames = flip map rightInput $ \(x, _, _) -> Right x+ input = leftInput ++ rightInput+ names = leftNames ++ rightNames+ source = flip map input $ \(_, _, x) -> x exp = deviationChartExperiment st lock = deviationChartLock st results <- liftIO $ readIORef (deviationChartResults st)@@ -208,20 +210,15 @@ error "Series with different names are returned for different runs: simulateDeviationChart" results <- liftIO $ fmap fromJust $ readIORef (deviationChartResults st) let stats = deviationChartStats results- t0 <- starttime- enqueue (experimentQueue expdata) t0 $- do let h = experimentSignalInIntegTimes expdata- -- we must subscribe through the event queue;- -- otherwise, we will loose a signal in the start time,- -- because the handleSignal_ function checks the event queue- handleSignal_ h $ \_ ->- do xs <- sequence input- i <- integIteration- liftIO $ withMVar lock $ \() ->- forM_ (zip xs stats) $ \(x, stats) ->- do y <- readArray stats i- let y' = addDataToSamplingStats x y- y' `seq` writeArray stats i y'+ h = experimentSignalInIntegTimes expdata+ handleSignal_ h $ \_ ->+ do xs <- sequence source+ i <- integIteration+ liftIO $ withMVar lock $ \() ->+ forM_ (zip xs stats) $ \(x, stats) ->+ do y <- readArray stats i+ let y' = addDataToSamplingStats x y+ y' `seq` writeArray stats i y' return $ return () -- | Plot the deviation chart after the simulation is complete.
Simulation/Aivika/Experiment/FinalHistogramView.hs view
@@ -44,7 +44,6 @@ import Simulation.Aivika.Dynamics import Simulation.Aivika.Dynamics.Simulation import Simulation.Aivika.Dynamics.Signal-import Simulation.Aivika.Dynamics.EventQueue import Simulation.Aivika.Dynamics.Base (starttime, integIterationBnds, integTimes, integIteration) -- | Defines the 'View' that saves the histogram@@ -67,7 +66,7 @@ -- An example is -- -- @- -- finalHistogramFileName = UniqueFileName \"$TITLE\", \".png\"+ -- finalHistogramFileName = UniqueFileName \"$TITLE\" \".png\" -- @ finalHistogramPredicate :: Dynamics Bool, -- ^ It specifies the predicate that defines@@ -164,10 +163,8 @@ -- | Simulation of the specified series. simulateFinalHistogram :: FinalHistogramViewState -> ExperimentData -> Dynamics (Dynamics ()) simulateFinalHistogram st expdata =- do let protolabels = finalHistogramSeries $ finalHistogramView st- protoproviders = flip map protolabels $ \protolabel ->- experimentSeriesProviders expdata [protolabel]- providers = concat protoproviders+ do let labels = finalHistogramSeries $ finalHistogramView st+ providers = experimentSeriesProviders expdata labels input = flip map providers $ \provider -> case providerToDoubleListSource provider of@@ -191,18 +188,13 @@ error "Series with different names are returned for different runs: simulateFinalHistogram" results <- liftIO $ fmap fromJust $ readIORef (finalHistogramResults st) let values = finalHistogramValues results- t0 <- starttime- enqueue (experimentQueue expdata) t0 $- do let h = filterSignalM (const predicate) $- experimentSignalInStopTime expdata- -- we must subscribe through the event queue;- -- otherwise, we will loose a signal in the start time,- -- because the handleSignal_ function checks the event queue- handleSignal_ h $ \_ ->- do xs <- sequence input- liftIO $ withMVar lock $ \() ->- forM_ (zip xs values) $ \(x, values) ->- addDataToListRef values x+ h = filterSignalM (const predicate) $+ experimentSignalInStopTime expdata+ handleSignal_ h $ \_ ->+ do xs <- sequence input+ liftIO $ withMVar lock $ \() ->+ forM_ (zip xs values) $ \(x, values) ->+ addDataToListRef values x return $ return () -- | Plot the histogram after the simulation is complete.
Simulation/Aivika/Experiment/FinalXYChartView.hs view
@@ -41,7 +41,6 @@ import Simulation.Aivika.Dynamics import Simulation.Aivika.Dynamics.Simulation import Simulation.Aivika.Dynamics.Signal-import Simulation.Aivika.Dynamics.EventQueue import Simulation.Aivika.Dynamics.Base (time) -- | Defines the 'View' that saves the XY chart@@ -63,7 +62,7 @@ -- An example is -- -- @- -- finalXYChartFileName = UniqueFileName \"$TITLE\", \".png\"+ -- finalXYChartFileName = UniqueFileName \"$TITLE\" \".png\" -- @ finalXYChartPredicate :: Dynamics Bool, -- ^ It specifies the predicate that defines@@ -175,38 +174,37 @@ -- | Simulation. simulateFinalXYChart :: FinalXYChartViewState -> ExperimentData -> Dynamics (Dynamics ()) simulateFinalXYChart st expdata =- do let yprotolabels = finalXYChartYSeries $ finalXYChartView st- xprotolabel = finalXYChartXSeries $ finalXYChartView st- ylabels = flip map yprotolabels $ either id id- xlabel = flip fromMaybe xprotolabel $+ do let ylabels = finalXYChartYSeries $ finalXYChartView st+ xlabels = finalXYChartXSeries $ finalXYChartView st+ xlabel = flip fromMaybe xlabels $ error "X series is not provided: simulateFinalXYChart"- yprotoproviders = flip map yprotolabels $ \protolabel ->- case protolabel of- Left label -> map Left $ experimentSeriesProviders expdata [label]- Right label -> map Right $ experimentSeriesProviders expdata [label]- joinedproviders = join yprotoproviders- yproviders = flip map joinedproviders $ either id id + (leftYLabels, rightYLabels) = partitionEithers ylabels+ leftYProviders = experimentSeriesProviders expdata leftYLabels+ rightYProviders = experimentSeriesProviders expdata rightYLabels xprovider = case experimentSeriesProviders expdata [xlabel] of [provider] -> provider _ -> error $ "Only a single X series must be" ++ " provided: simulateFinalXYChart"- ys = input yproviders- [x] = input [xprovider]- input providers =+ providerInput providers = flip map providers $ \provider -> case providerToDouble provider of Nothing -> error $ "Cannot represent series " ++ providerName provider ++ " as double values: simulateFinalXYChart"- Just input -> input- ynames = flip map joinedproviders $ \protoprovider ->- case protoprovider of- Left provider -> Left $ providerName provider- Right provider -> Right $ providerName provider- xname = providerName xprovider+ Just input -> (providerName provider, input)+ leftYInput = providerInput leftYProviders+ rightYInput = providerInput rightYProviders+ yinput = leftYInput ++ rightYInput+ [xinput] = providerInput [xprovider]+ leftYNames = map (Left . fst) leftYInput+ rightYNames = map (Right . fst) rightYInput+ ynames = leftYNames ++ rightYNames+ xname = fst xinput+ ys = map snd yinput+ x = snd xinput predicate = finalXYChartPredicate $ finalXYChartView st exp = finalXYChartExperiment st lock = finalXYChartLock st@@ -224,20 +222,15 @@ error "Series with different names are returned for different runs: simulateFinalXYChart" results <- liftIO $ fmap fromJust $ readIORef (finalXYChartResults st) let xys = finalXYChartXY results- t <- time- enqueue (experimentQueue expdata) t $- do let h = filterSignalM (const predicate) $- experimentSignalInStopTime expdata- -- we must subscribe through the event queue;- -- otherwise, we will loose a signal in the start time,- -- because the handleSignal_ function checks the event queue- handleSignal_ h $ \_ ->- do x' <- x- ys' <- sequence ys- i <- liftSimulation simulationIndex- liftIO $ withMVar lock $ \() ->- forM_ (zip ys' xys) $ \(y', xy) ->- x' `seq` y' `seq` writeArray xy i $ Just (x', y')+ h = filterSignalM (const predicate) $+ experimentSignalInStopTime expdata+ handleSignal_ h $ \_ ->+ do x' <- x+ ys' <- sequence ys+ i <- liftSimulation simulationIndex+ liftIO $ withMVar lock $ \() ->+ forM_ (zip ys' xys) $ \(y', xy) ->+ x' `seq` y' `seq` writeArray xy i $ Just (x', y') return $ return () -- | Plot the XY chart after the simulation is complete.
Simulation/Aivika/Experiment/HistogramView.hs view
@@ -42,7 +42,6 @@ import Simulation.Aivika.Dynamics import Simulation.Aivika.Dynamics.Simulation import Simulation.Aivika.Dynamics.Signal-import Simulation.Aivika.Dynamics.EventQueue -- | Defines the 'View' that saves the histogram in -- the PNG files by all integration time points for @@ -64,7 +63,7 @@ -- An example is -- -- @- -- histogramFileName = UniqueFileName \"$TITLE - $RUN_INDEX\", \".png\"+ -- histogramFileName = UniqueFileName \"$TITLE - $RUN_INDEX\" \".png\" -- @ histogramPredicate :: Dynamics Bool, -- ^ It specifies the predicate that defines@@ -195,7 +194,7 @@ replace "$PLOT_TITLE" plotTitle (histogramRunPlotTitle $ histogramView st) hs <- forM (zip providers input) $ \(provider, input) ->- newSignalHistoryThrough (experimentQueue expdata) $+ newSignalHistory $ mapSignalM (const input) $ filterSignalM (const predicate) $ experimentSignalInIntegTimes expdata
Simulation/Aivika/Experiment/TimeSeriesView.hs view
@@ -23,6 +23,7 @@ import Data.Maybe import Data.Either import Data.Array+import Data.List import Data.Accessor @@ -39,7 +40,6 @@ import Simulation.Aivika.Dynamics import Simulation.Aivika.Dynamics.Simulation import Simulation.Aivika.Dynamics.Signal-import Simulation.Aivika.Dynamics.EventQueue -- | Defines the 'View' that saves the time series charts -- in the PNG files.@@ -60,7 +60,7 @@ -- An example is -- -- @- -- timeSeriesFileName = UniqueFileName \"$TITLE - $RUN_INDEX\", \".png\"+ -- timeSeriesFileName = UniqueFileName \"$TITLE - $RUN_INDEX\" \".png\" -- @ timeSeriesPredicate :: Dynamics Bool, -- ^ It specifies the predicate that defines@@ -164,17 +164,21 @@ -- | Plot the time series chart during the simulation. simulateTimeSeries :: TimeSeriesViewState -> ExperimentData -> Dynamics (Dynamics ()) simulateTimeSeries st expdata =- do let protolabels = timeSeries $ timeSeriesView st- labels = flip map protolabels $ either id id- providers = experimentSeriesProviders expdata labels- input =+ do let labels = timeSeries $ timeSeriesView st+ (leftLabels, rightLabels) = partitionEithers labels + (leftProviders, rightProviders) =+ (experimentSeriesProviders expdata leftLabels,+ experimentSeriesProviders expdata rightLabels)+ providerInput providers = flip map providers $ \provider -> case providerToDouble provider of Nothing -> error $ "Cannot represent series " ++ providerName provider ++ " as double values: simulateTimeSeries"- Just input -> input+ Just input -> (providerName provider, provider, input)+ leftInput = providerInput leftProviders+ rightInput = providerInput rightProviders n = experimentRunCount $ timeSeriesExperiment st width = timeSeriesWidth $ timeSeriesView st height = timeSeriesHeight $ timeSeriesView st@@ -195,26 +199,34 @@ replace "$RUN_COUNT" (show n) $ replace "$PLOT_TITLE" plotTitle (timeSeriesRunPlotTitle $ timeSeriesView st)- hs <- forM (zip providers input) $ \(provider, input) ->- let transform () =- do x <- predicate- if x then input else return (1/0) -- the infinite values will be ignored then- in newSignalHistoryThrough (experimentQueue expdata) $- mapSignalM transform $- experimentMixedSignal expdata [provider]+ inputHistory input =+ forM input $ \(name, provider, input) ->+ let transform () =+ do x <- predicate+ if x then input else return (1/0) -- the infinite values will be ignored then+ in newSignalHistory $+ mapSignalM transform $+ experimentMixedSignal expdata [provider]+ leftHs <- inputHistory leftInput+ rightHs <- inputHistory rightInput return $- do ps <- forM (zip3 hs providers plotLines) $ \(h, provider, plotLines) ->- do (ts, xs) <- readSignalHistory h - return $- toPlot $- plotLines $- plot_lines_values ^= filterPlotLinesValues (zip (elems ts) (elems xs)) $- plot_lines_title ^= providerName provider $- defaultPlotLines- let ps' = flip map (zip ps protolabels) $ \(p, label) ->- case label of- Left _ -> Left p- Right _ -> Right p+ do let plots hs input plotLineTails =+ do ps <-+ forM (zip3 hs input (head plotLineTails)) $+ \(h, (name, provider, input), plotLines) ->+ do (ts, xs) <- readSignalHistory h + return $+ toPlot $+ plotLines $+ plot_lines_values ^= filterPlotLinesValues (zip (elems ts) (elems xs)) $+ plot_lines_title ^= name $+ defaultPlotLines+ return (ps, drop (length hs) plotLineTails)+ (leftPs, plotLineTails) <- plots leftHs leftInput (tails plotLines)+ (rightPs, plotLineTails) <- plots rightHs rightInput plotLineTails+ let leftPs' = map Left leftPs+ rightPs' = map Right rightPs+ ps' = leftPs' ++ rightPs' axis = plotBottomAxis $ laxis_title ^= "time" $ defaultLayoutAxis
Simulation/Aivika/Experiment/XYChartView.hs view
@@ -24,6 +24,7 @@ import Data.Either import Data.Array import Data.Monoid+import Data.List import Data.Accessor @@ -40,7 +41,6 @@ import Simulation.Aivika.Dynamics import Simulation.Aivika.Dynamics.Simulation import Simulation.Aivika.Dynamics.Signal-import Simulation.Aivika.Dynamics.EventQueue -- | Defines the 'View' that saves the XY charts -- in the PNG files.@@ -61,7 +61,7 @@ -- An example is -- -- @- -- xyChartFileName = UniqueFileName \"$TITLE - $RUN_INDEX\", \".png\"+ -- xyChartFileName = UniqueFileName \"$TITLE - $RUN_INDEX\" \".png\" -- @ xyChartPredicate :: Dynamics Bool, -- ^ It specifies the predicate that defines@@ -171,28 +171,30 @@ -- | Plot the XY chart during the simulation. simulateXYChart :: XYChartViewState -> ExperimentData -> Dynamics (Dynamics ()) simulateXYChart st expdata =- do let yprotolabels = xyChartYSeries $ xyChartView st- xprotolabel = xyChartXSeries $ xyChartView st- ylabels = flip map yprotolabels $ either id id- xlabel = flip fromMaybe xprotolabel $+ do let ylabels = xyChartYSeries $ xyChartView st+ xlabels = xyChartXSeries $ xyChartView st+ xlabel = flip fromMaybe xlabels $ error "X series is not provided: simulateXYChart"- yproviders = experimentSeriesProviders expdata ylabels+ (leftYLabels, rightYLabels) = partitionEithers ylabels+ leftYProviders = experimentSeriesProviders expdata leftYLabels+ rightYProviders = experimentSeriesProviders expdata rightYLabels xprovider = case experimentSeriesProviders expdata [xlabel] of [provider] -> provider _ -> error $ "Only a single X series must be" ++ " provided: simulateXYChart"- ys = input yproviders- [x] = input [xprovider]- input providers =+ providerInput providers = flip map providers $ \provider -> case providerToDouble provider of Nothing -> error $ "Cannot represent series " ++ providerName provider ++ " as double values: simulateXYChart"- Just input -> input+ Just input -> (providerName provider, provider, input)+ leftYInput = providerInput leftYProviders+ rightYInput = providerInput rightYProviders+ [(xname, _, x)] = providerInput [xprovider] n = experimentRunCount $ xyChartExperiment st width = xyChartWidth $ xyChartView st height = xyChartHeight $ xyChartView st@@ -213,29 +215,37 @@ replace "$RUN_COUNT" (show n) $ replace "$PLOT_TITLE" plotTitle (xyChartRunPlotTitle $ xyChartView st)- hs <- forM (zip yproviders ys) $ \(provider, y) ->- let transform () =- do p <- predicate- if p - then liftM2 (,) x y- else return (1/0, 1/0) -- such values will be ignored then- in newSignalHistoryThrough (experimentQueue expdata) $- mapSignalM transform $- experimentMixedSignal expdata [provider] <>- experimentMixedSignal expdata [xprovider]+ inputHistory input = + forM input $ \(name, provider, y) ->+ let transform () =+ do p <- predicate+ if p+ then liftM2 (,) x y+ else return (1/0, 1/0) -- such values will be ignored then+ in newSignalHistory $+ mapSignalM transform $+ experimentMixedSignal expdata [provider] <>+ experimentMixedSignal expdata [xprovider]+ leftHs <- inputHistory leftYInput+ rightHs <- inputHistory rightYInput return $- do ps <- forM (zip3 hs yproviders plotLines) $ \(h, provider, plotLines) ->- do (ts, zs) <- readSignalHistory h - return $- toPlot $- plotLines $- plot_lines_values ^= filterPlotLinesValues (elems zs) $- plot_lines_title ^= providerName provider $- defaultPlotLines- let ps' = flip map (zip ps yprotolabels) $ \(p, label) ->- case label of- Left _ -> Left p- Right _ -> Right p+ do let plots hs input plotLineTails =+ do ps <-+ forM (zip3 hs input (head plotLineTails)) $+ \(h, (name, provider, input), plotLines) ->+ do (ts, zs) <- readSignalHistory h + return $+ toPlot $+ plotLines $+ plot_lines_values ^= filterPlotLinesValues (elems zs) $+ plot_lines_title ^= name $+ defaultPlotLines+ return (ps, drop (length hs) plotLineTails) + (leftPs, plotLineTails) <- plots leftHs leftYInput (tails plotLines)+ (rightPs, plotLineTails) <- plots rightHs rightYInput plotLineTails+ let leftPs' = map Left leftPs+ rightPs' = map Right rightPs+ ps' = leftPs' ++ rightPs' axis = plotBottomAxis $ laxis_title ^= providerName xprovider $ defaultLayoutAxis
aivika-experiment-chart.cabal view
@@ -1,5 +1,5 @@ name: aivika-experiment-chart-version: 0.3+version: 0.3.1 synopsis: Simulation experiments with charting for the Aivika library description: This package complements the Aivika and Aivika Experiment packages with@@ -26,6 +26,8 @@ examples/Financial.hs examples/DifferenceEquations.hs examples/Furnace.hs+ examples/LinearArray.hs+ examples/README library @@ -46,7 +48,7 @@ split >= 0.2.2, data-accessor >= 0.2.2.3, colour >= 2.3.3,- aivika >= 0.6,- aivika-experiment >= 0.3+ aivika >= 0.6.1,+ aivika-experiment >= 0.3.1 ghc-options: -O2
+ examples/LinearArray.hs view
@@ -0,0 +1,105 @@++-- The model demonstrates using the arrays+-- as described in model Linear Array from Berkeley Madonna.+--+-- It defines only one helper function generateArray.+-- If the model used vectors (Data.Vector) then there would be+-- no need in this helper function.++{-# LANGUAGE RecursiveDo #-}++import Data.Array+import Control.Monad+import Control.Monad.Trans++import qualified Data.Vector as V++import Simulation.Aivika.Dynamics+import Simulation.Aivika.Dynamics.Simulation+import Simulation.Aivika.Dynamics.SystemDynamics+import Simulation.Aivika.Dynamics.EventQueue+import Simulation.Aivika.Dynamics.Base++import Simulation.Aivika.Experiment+import Simulation.Aivika.Experiment.TableView+import Simulation.Aivika.Experiment.ExperimentSpecsView++import Simulation.Aivika.Experiment.TimeSeriesView+import Simulation.Aivika.Experiment.DeviationChartView+import Simulation.Aivika.Experiment.FinalHistogramView+import Simulation.Aivika.Experiment.FinalXYChartView+import Simulation.Aivika.Experiment.HistogramView+import Simulation.Aivika.Experiment.XYChartView++specs = Specs { spcStartTime = 0, + spcStopTime = 500, + spcDT = 0.1,+ spcMethod = RungeKutta4 }++-- | This is an analog of 'V.generateM' included in the Haskell platform.+generateArray :: (Ix i, Monad m) => (i, i) -> (i -> m a) -> m (Array i a)+generateArray bnds generator =+ do ps <- forM (range bnds) $ \i ->+ do x <- generator i+ return (i, x)+ return $ array bnds ps++model :: Int -> Simulation ExperimentData+model n =+ mdo queue <- newQueue+ m <- generateArray (1, n) $ \i ->+ integ (q + k * (c!(i - 1) - c!i) + k * (c!(i + 1) - c!i)) 0+ let c =+ array (0, n + 1) [(i, if (i == 0) || (i == n + 1)+ then 0+ else (m!i / v)) | i <- [0 .. n + 1]]+ q = 1+ k = 2+ v = 0.75+ experimentDataInStartTime queue+ [("t", seriesEntity "time" time),+ ("m", seriesEntity "M" m),+ ("c", seriesEntity "C" c)]++experiment :: Experiment+experiment =+ defaultExperiment {+ experimentSpecs = specs,+ experimentRunCount = 1,+ experimentTitle = "Linear Array",+ experimentDescription = "Model Linear Array as described in " +++ "the examples included in Berkeley-Madonna.",+ experimentGenerators = + [outputView defaultExperimentSpecsView,+ outputView $ defaultTableView {+ tableSeries = ["t", "m", "c"] },+ outputView $ defaultTimeSeriesView {+ timeSeries = [Left "m"],+ timeSeriesWidth = 800,+ timeSeriesHeight = 800 },+ outputView $ defaultTimeSeriesView {+ timeSeries = [Right "c"],+ timeSeriesWidth = 800,+ timeSeriesHeight = 800 },+ outputView $ defaultTimeSeriesView {+ timeSeries = [Left "m", Right "c"],+ timeSeriesWidth = 800,+ timeSeriesHeight = 800 },+ outputView $ defaultXYChartView {+ xyChartXSeries = Just "t",+ xyChartYSeries = [Left "m"],+ xyChartWidth = 800,+ xyChartHeight = 800 },+ outputView $ defaultXYChartView {+ xyChartXSeries = Just "t",+ xyChartYSeries = [Right "c"],+ xyChartWidth = 800,+ xyChartHeight = 800 },+ outputView $ defaultXYChartView {+ xyChartXSeries = Just "t",+ xyChartYSeries = [Left "m", Right "c"],+ xyChartWidth = 800,+ xyChartHeight = 800 }+ ] }++main = runExperiment experiment (model 51)
examples/MachRep3.hs view
@@ -13,8 +13,6 @@ -- until both machines are down. We find the proportion of up time. It -- should come out to about 0.45. -module MachRep3Model (model) where- import System.Random import Control.Monad import Control.Monad.Trans
+ examples/README view
@@ -0,0 +1,5 @@+You may find more examples on GitHub by the following link:++https://github.com/dsorokin/aivika-models++July 18, 2013