packages feed

aivika-experiment-chart 3.1 → 4.0.3

raw patch · 24 files changed

+180/−43 lines, 24 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/Chart.hs view
@@ -5,7 +5,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.6.3+-- Tested with: GHC 7.10.1 -- -- This module re-exports the library functionality. --
Simulation/Aivika/Experiment/Chart/DeviationChartView.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.8.3+-- Tested with: GHC 7.10.1 -- -- The module defines 'DeviationChartView' that plots the deviation chart using rule of 3-sigma. --
Simulation/Aivika/Experiment/Chart/FinalHistogramView.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.8.3+-- Tested with: GHC 7.10.1 -- -- The module defines 'FinalHistogramView' that plots a histogram -- by the specified series in final time points collected from different 
Simulation/Aivika/Experiment/Chart/FinalXYChartView.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.8.3+-- Tested with: GHC 7.10.1 -- -- The module defines 'FinalXYChartView' that plots a single XY chart -- in final time points for different simulation runs sequentially
Simulation/Aivika/Experiment/Chart/HistogramView.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.8.3+-- Tested with: GHC 7.10.1 -- -- The module defines 'HistogramView' that plots the histogram -- collecting statistics in all integration time points and does
Simulation/Aivika/Experiment/Chart/TimeSeriesView.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.6.3+-- Tested with: GHC 7.10.1 -- -- The module defines 'TimeSeriesView' that plots the time series charts. --
Simulation/Aivika/Experiment/Chart/Types.hs view
@@ -5,7 +5,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.8.3+-- Tested with: GHC 7.10.1 -- -- The module defines a type class for rendering charts. --
Simulation/Aivika/Experiment/Chart/Utils.hs view
@@ -5,7 +5,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.6.3+-- Tested with: GHC 7.10.1 -- -- The module defines some utilities used in the charting. --
Simulation/Aivika/Experiment/Chart/XYChartView.hs view
@@ -7,7 +7,7 @@ -- License    : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability  : experimental--- Tested with: GHC 7.8.3+-- Tested with: GHC 7.10.1 -- -- The module defines 'XYChartView' that plots the XY charts. --
aivika-experiment-chart.cabal view
@@ -1,5 +1,5 @@ name:            aivika-experiment-chart-version:         3.1+version:         4.0.3 synopsis:        Simulation experiments with charting for the Aivika library description:     This package complements the Aivika and Aivika Experiment packages with@@ -21,7 +21,7 @@ homepage:        http://github.com/dsorokin/aivika-experiment-chart cabal-version:   >= 1.6 build-type:      Simple-tested-with:     GHC == 7.8.3+tested-with:     GHC == 7.10.1  extra-source-files:  examples/BassDiffusion/Model.hs                      examples/BassDiffusion/Experiment.hs@@ -91,8 +91,8 @@                      lens >= 3.9,                      data-default-class < 0.1,                      colour >= 2.3.3,-                     aivika >= 3.1,-                     aivika-experiment >= 3.1+                     aivika >= 4.0.3,+                     aivika-experiment >= 4.0.3      extensions:      MultiParamTypeClasses 
examples/BassDiffusion/Experiment.hs view
@@ -23,6 +23,7 @@ generators :: ChartRendering r => [WebPageGenerator r] generators =   [outputView defaultExperimentSpecsView,+   outputView defaultInfoView,    outputView $ defaultDeviationChartView {      deviationChartLeftYSeries =          resultByName "potentialAdopters" <>
examples/BassDiffusion/Model.hs view
@@ -1,7 +1,18 @@  -- This is the Bass Diffusion model solved with help of --- the Agent-based Modeling as described in the AnyLogic +-- the agent-based Modeling as described in the AnyLogic  -- documentation.+--+-- The model describes a product diffusion process. Potential +-- adopters of a product are influenced into buying the product +-- by advertising and by word of mouth from adopters, those +-- who have already purchased the new product. Adoption of +-- a new product driven by word of mouth is likewise an epidemic. +-- Potential adopters come into contact with adopters through +-- social interactions. A fraction of these contacts results +-- in the purchase of the new product. The advertising causes +-- a constant fraction of the potential adopter population +-- to adopt each time period.  module Model (model) where 
examples/BassDiffusion/README view
@@ -1,1 +1,13 @@-Simulation model Bass Diffusion as described in the documentation of AnyLogic in the part related to the Agent-based modelling.+Simulation model Bass Diffusion as described in the documentation+of AnyLogic in the part related to the agent-based modelling.++The model describes a product diffusion process. Potential +adopters of a product are influenced into buying the product +by advertising and by word of mouth from adopters, those +who have already purchased the new product. Adoption of +a new product driven by word of mouth is likewise an epidemic. +Potential adopters come into contact with adopters through +social interactions. A fraction of these contacts results +in the purchase of the new product. The advertising causes +a constant fraction of the potential adopter population +to adopt each time period.
examples/BouncingBall/Experiment.hs view
@@ -25,6 +25,7 @@ generators :: ChartRendering r => [WebPageGenerator r] generators =   [outputView defaultExperimentSpecsView,+   outputView defaultInfoView,    outputView $ defaultTableView {      tableSeries =         resultByName "t" <>
examples/DifferenceEquations/Experiment.hs view
@@ -26,6 +26,7 @@ generators :: ChartRendering r => [WebPageGenerator r] generators =   [outputView defaultExperimentSpecsView,+   outputView defaultInfoView,    outputView $ defaultTableView {      tableSeries =         mconcat $ map resultByName $
examples/DifferenceEquations/Model.hs view
@@ -27,5 +27,5 @@          resultSource "x" "x" x,          resultSource "sumX" "sum x" sumX,          resultSource "sumX2" "sum x^2" sumX2,-         resultSource "avg" "Ex" avg,-         resultSource "std" "sqrt(Dx)" std]+         resultSource "avg" "E(x)" avg,+         resultSource "std" "sqrt(D(x))" std]
examples/Financial/Experiment.hs view
@@ -28,6 +28,7 @@ monteCarloGenerators :: ChartRendering r => [WebPageGenerator r] monteCarloGenerators =   [outputView defaultExperimentSpecsView,+   outputView defaultInfoView,    outputView $ defaultDeviationChartView {      deviationChartTitle = "Chart 1",      deviationChartPlotTitle = "The deviation chart for Net Income and Cash Flow",@@ -75,6 +76,7 @@ singleGenerators :: ChartRendering r => [WebPageGenerator r] singleGenerators =   [outputView defaultExperimentSpecsView,+   outputView defaultInfoView,    outputView $ defaultTimeSeriesView {      timeSeriesTitle = "Time Series 1",      timeSeriesPlotTitle = "Time series of Net Income and Cash Flow",
examples/Furnace/Experiment.hs view
@@ -30,6 +30,7 @@ generators :: ChartRendering r => [WebPageGenerator r] generators =   [outputView defaultExperimentSpecsView,+   outputView defaultInfoView,    outputView $ defaultDeviationChartView {      deviationChartTitle = "Deviation Chart - 1",      deviationChartPlotTitle = "The input, loaded and output ingot counts",@@ -70,19 +71,14 @@        resultByName pitCountName },    outputView $ defaultDeviationChartView {      deviationChartTitle = "Deviation Chart - 3",-     deviationChartPlotTitle = "The queue size",+     deviationChartPlotTitle = "The average queue size",      deviationChartRightYSeries =-       resultByName furnaceQueueName >>> resultById QueueCountId },-   outputView $ defaultFinalHistogramView {-     finalHistogramTitle = "Final Histogram - 3",-     finalHistogramPlotTitle = "The queue size in the final time point.",-     finalHistogramSeries =-       resultByName furnaceQueueName >>> resultById QueueCountId },+       resultByName furnaceQueueName >>> resultById QueueCountStatsId },    outputView $ defaultFinalStatsView {      finalStatsTitle = "Final Statistics - 3",-     finalStatsDescription = "The summary of the queue size in the final time point.",+     finalStatsDescription = "The summary of the average queue size in the final time point.",      finalStatsSeries =-       resultByName furnaceQueueName >>> resultById QueueCountId },+       resultByName furnaceQueueName >>> resultById QueueCountStatsId },    outputView $ defaultDeviationChartView {      deviationChartTitle = "Deviation Chart - 4",      deviationChartPlotTitle = "The mean wait time",
examples/Furnace/Model.hs view
@@ -1,18 +1,51 @@ --- This is a model of the Furnace. It is described in different sources [1, 2].+-- This is a model of the soaking pit furnace. It is described in different sources [1, 2]. -- -- [1] A. Alan B. Pritsker, Simulation with Visual SLAM and AweSim, 2nd ed. -- -- [2] Труб И.И., Объектно-ориентированное моделирование на C++: Учебный курс. - СПб.: Питер, 2006 ----- To define the external parameters for the Monte-Carlo simulation, see the Financial model.------ To enable the parallel simulation, you should compile it--- with option -threaded and then pass in other options +RTS -N2 -RTS--- to the executable if you have a dual core processor without--- hyper-threading. Also you can increase the number--- of parallel threads via option -N if you have a more modern--- processor.+-- Steel ingots arrive at a soaking pit furnace in a steel plant with+-- an interarrival time that is exponentially distributed with mean+-- of 2.25 hours. The soaking pit furnace heats an ingot so that it+-- can be economically rolled in the next stage of the process.+-- The temperature change of an ingot in the soaking pit furnace is+-- described by the following differential equation.+-- +--   d(h_i)/dt = (H - h_i) * C_i,+-- +-- where  h_i is the temperature of the i-th ingot in the soaking pit;+-- C_i is the heating time coefficient of an ingot and is equal to X + 0.1+-- where X is normally distributed with mean of 0.05 and standard deviation+-- of 0.01; and H is the furnace temperature which is heated toward 2600 F+-- with a heating rate constant if 0.2, that is,+-- +--   dH/dt = (2600 - H) * 0.2.+-- +-- The ingots interact with one another in that adding a "cold" ingot+-- to the furnace reduces the temperature of the furnace and thus changes+-- the heating time for all ingots in the furnace. The temperature reduction+-- is equal to the difference between furnace and ingot temperatures, divided+-- by the number of ingots in the furnace. There are 10 soaking pits in+-- the furnace. When a new ingot arrives and the furnace is full, it is+-- stored in an ingot storage bank. It is assumed that the initial temperature+-- of an arriving ingot is uniformly distributed in the interval from 400 to 500 F.+-- All ingots put in the ingot storage bank are assumed to have a temperature of+-- 400 F upon insertion into the soaking pit. The operating policy of the company+-- is to continue heating the ingots in the furnace until one or more ingots+-- reach 2200 F. At such a time all ingots with a temperature greater than 2000 F+-- are removed. The initial conditions are that there are six ingots in the furnace+-- with initial temperatures of 550, 600, 650, 700, 750 and 800 F. Initially,+-- the temperature of the furnace is 1650 F, and the next ingot is due to arrive+-- at time 0.+-- +-- The objective is to simulate the above system for 500 hours to obtain+-- estimates of the following quantities:+-- +-- 1) heating time of the ingots;+-- 2) final temperature distribution of the ingots;+-- 3) waiting time of the ingots in the ingot storage bank; and+-- 4) utilization of the soaking pit furnace.  module Model        (-- * Simulation Model
examples/Furnace/README view
@@ -1,4 +1,47 @@-This is a model of the furnace. It is described in different sources [1, 2].+This is a model of the soaking pit furnace. It is described in different sources [1, 2].  [1] A. Alan B. Pritsker, Simulation with Visual SLAM and AweSim, 2nd ed. [2] Труб И.И., Объектно-ориентированное моделирование на C++: Учебный курс. - СПб.: Питер, 2006++Steel ingots arrive at a soaking pit furnace in a steel plant with+an interarrival time that is exponentially distributed with mean+of 2.25 hours. The soaking pit furnace heats an ingot so that it+can be economically rolled in the next stage of the process.+The temperature change of an ingot in the soaking pit furnace is+described by the following differential equation.++  d(h_i)/dt = (H - h_i) * C_i,++where  h_i is the temperature of the i-th ingot in the soaking pit;+C_i is the heating time coefficient of an ingot and is equal to X + 0.1+where X is normally distributed with mean of 0.05 and standard deviation+of 0.01; and H is the furnace temperature which is heated toward 2600 F+with a heating rate constant if 0.2, that is,++  dH/dt = (2600 - H) * 0.2.++The ingots interact with one another in that adding a "cold" ingot+to the furnace reduces the temperature of the furnace and thus changes+the heating time for all ingots in the furnace. The temperature reduction+is equal to the difference between furnace and ingot temperatures, divided+by the number of ingots in the furnace. There are 10 soaking pits in+the furnace. When a new ingot arrives and the furnace is full, it is+stored in an ingot storage bank. It is assumed that the initial temperature+of an arriving ingot is uniformly distributed in the interval from 400 to 500 F.+All ingots put in the ingot storage bank are assumed to have a temperature of+400 F upon insertion into the soaking pit. The operating policy of the company+is to continue heating the ingots in the furnace until one or more ingots+reach 2200 F. At such a time all ingots with a temperature greater than 2000 F+are removed. The initial conditions are that there are six ingots in the furnace+with initial temperatures of 550, 600, 650, 700, 750 and 800 F. Initially,+the temperature of the furnace is 1650 F, and the next ingot is due to arrive+at time 0.++The objective is to simulate the above system for 500 hours to obtain+estimates of the following quantities:++1) heating time of the ingots;+2) final temperature distribution of the ingots;+3) waiting time of the ingots in the ingot storage bank; and+4) utilization of the soaking pit furnace.+ 
examples/InspectionAdjustmentStations/Experiment.hs view
@@ -44,10 +44,10 @@ resultQueueSize :: ResultTransform resultQueueSize =   (resultByName "inspectionQueue" >>>-   resultById QueueCountId)+   resultById QueueCountStatsId)   <>   (resultByName "adjustmentQueue" >>>-   resultById QueueCountId)+   resultById QueueCountStatsId)  resultWaitTime :: ResultTransform resultWaitTime =@@ -60,6 +60,7 @@ generators :: ChartRendering r => [WebPageGenerator r] generators =   [outputView defaultExperimentSpecsView,+   outputView defaultInfoView,    outputView $ defaultFinalStatsView {      finalStatsTitle  = "Arrivals",      finalStatsSeries = resultProcessingTime },@@ -78,10 +79,6 @@      deviationChartTitle = "The queue size (chart)",      deviationChartWidth = 1000,      deviationChartRightYSeries = resultQueueSize },-   outputView $ defaultFinalHistogramView {-     finalHistogramTitle = "The queue size (histogram)",-     finalHistogramWidth = 1000,-     finalHistogramSeries = resultQueueSize },    outputView $ defaultFinalStatsView {      finalStatsTitle = "The queue size (statistics)",      finalStatsSeries = resultQueueSize },
examples/InspectionAdjustmentStations/Model.hs view
@@ -6,9 +6,28 @@ -- This is a model of the workflow with a loop. Also there are two infinite queues. -- -- It is described in different sources [1, 2]. So, this is chapter 8 of [2] and section 5.15 of [1].+-- +-- Assembled television sets move through a series of testing stations in the final +-- stage of their production. At the last of these stations, the vertical control +-- setting on the TV sets is tested. If the setting is found to be functioning improperly, +-- the offending set is routed to an adjustment station where the setting is adjusted. +-- After adjustment, the television set is sent back to the last inspection station where +-- the setting is again inspected. Television sets passing the final inspection phase, +-- whether for the first time of after one or more routings through the adjustment station, +-- are routed to a packing area.+-- +-- The time between arrivals of television sets to the final inspection station is uniformly +-- distributed between 3.5 and 7.5 minutes. Two inspectors work side-by-side at the final +-- inspection station. The time required to inspect a set is uniformly distributed between +-- 6 and 12 minutes. On the average, 85 percent of the sets are routed to the adjustment +-- station which is manned by a single worker. Adjustment of the vertical control setting +-- requires between 20 and 40 minutes, uniformly distributed.+-- +-- The inspection station and adjustor are to be simulated for 480 minutes to estimate +-- the time to process television sets through the final production stage and to determine +-- the utilization of the inspectors and the adjustors. -- -- [1] A. Alan B. Pritsker, Simulation with Visual SLAM and AweSim, 2nd ed.--- -- [2] Труб И.И., Объектно-ориентированное моделирование на C++: Учебный курс. - СПб.: Питер, 2006  module Model (model) where
examples/InspectionAdjustmentStations/README view
@@ -5,5 +5,25 @@  It is described in different sources [1, 2]. So, this is chapter 8 of [2] and section 5.15 of [1]. +Assembled television sets move through a series of testing stations in the final +stage of their production. At the last of these stations, the vertical control +setting on the TV sets is tested. If the setting is found to be functioning improperly, +the offending set is routed to an adjustment station where the setting is adjusted. +After adjustment, the television set is sent back to the last inspection station where +the setting is again inspected. Television sets passing the final inspection phase, +whether for the first time of after one or more routings through the adjustment station, +are routed to a packing area.++The time between arrivals of television sets to the final inspection station is uniformly +distributed between 3.5 and 7.5 minutes. Two inspectors work side-by-side at the final +inspection station. The time required to inspect a set is uniformly distributed between +6 and 12 minutes. On the average, 85 percent of the sets are routed to the adjustment +station which is manned by a single worker. Adjustment of the vertical control setting +requires between 20 and 40 minutes, uniformly distributed.++The inspection station and adjustor are to be simulated for 480 minutes to estimate +the time to process television sets through the final production stage and to determine +the utilization of the inspectors and the adjustors.+ [1] A. Alan B. Pritsker, Simulation with Visual SLAM and AweSim, 2nd ed. [2] Труб И.И., Объектно-ориентированное моделирование на C++: Учебный курс. - СПб.: Питер, 2006
examples/MachRep3/Experiment.hs view
@@ -27,6 +27,7 @@ generators :: ChartRendering r => [WebPageGenerator r] generators =   [outputView defaultExperimentSpecsView,+   outputView defaultInfoView,    outputView $ defaultDeviationChartView {      deviationChartLeftYSeries = t,      deviationChartRightYSeries = x },