Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | None |
Tested with: GHC 7.4.1
The module defines the simulation experiments. They automate the process of generating and analyzing the results. Moreover, this module is open to extensions, allowing you to define your own output views for the simulations results, for example, such views that would allow saving the results in PDF or as charts. To decrease the number of dependencies, such possible extenstions are not included in this package, although simple views are provided.
- data Experiment = Experiment {}
- defaultExperiment :: Experiment
- runExperiment :: Experiment -> Simulation ExperimentData -> IO ()
- runExperimentParallel :: Experiment -> Simulation ExperimentData -> IO ()
- data ExperimentData = ExperimentData {}
- experimentDataInStartTime :: EventQueue -> [(String, SeriesEntity)] -> Simulation ExperimentData
- experimentSeriesProviders :: ExperimentData -> [String] -> [SeriesProvider]
- experimentMixedSignal :: ExperimentData -> [SeriesProvider] -> Signal ()
- class Series s where
- seriesEntity :: String -> s -> SeriesEntity
- data SeriesEntity = SeriesEntity {}
- data SeriesProvider = SeriesProvider {
- providerName :: String
- providerToDouble :: Maybe (Dynamics Double)
- providerToInt :: Maybe (Dynamics Int)
- providerToString :: Maybe (Dynamics String)
- providerSignal :: Maybe (Signal ())
- class View v where
- outputView :: v -> Generator
- data Generator = Generator {
- generateReporter :: Experiment -> FilePath -> IO Reporter
- data Reporter = Reporter {
- reporterInitialise :: IO ()
- reporterFinalise :: IO ()
- reporterSimulate :: ExperimentData -> Dynamics (Dynamics ())
- reporterTOCHtml :: Int -> HtmlWriter ()
- reporterHtml :: Int -> HtmlWriter ()
- data DirectoryName
- resolveDirectoryName :: Maybe FilePath -> DirectoryName -> Map String String -> IO String
- data FileName
- resolveFileName :: Maybe FilePath -> FileName -> Map String String -> IO String
Documentation
data Experiment Source
It defines the simulation experiment.
Experiment | |
|
defaultExperiment :: ExperimentSource
The default experiment.
runExperiment :: Experiment -> Simulation ExperimentData -> IO ()Source
Run the simulation experiment sequentially. For example,
it can be a Monte-Carlo simulation dependentent on the external
Parameter
values.
runExperimentParallel :: Experiment -> Simulation ExperimentData -> IO ()Source
Run the simulation experiment parallelly.
Make sure that you compile with -threaded
and supply +RTS -N2 -RTS
to the generated Haskell executable on dual core processor,
or you won't get any parallelism. Generally, the mentioned
N
parameter should correspond to the number of cores for
your processor.
data ExperimentData Source
It describes the source simulation data used in the experiment.
ExperimentData | |
|
experimentDataInStartTime :: EventQueue -> [(String, SeriesEntity)] -> Simulation ExperimentDataSource
Prepare data for the simulation experiment in start time from the series with the specified labels.
experimentSeriesProviders :: ExperimentData -> [String] -> [SeriesProvider]Source
Return the SeriesProvider
values from the experiment data by the specified labels.
experimentMixedSignal :: ExperimentData -> [SeriesProvider] -> Signal ()Source
Get a mixed signal for the specified providers based on the experimental data. This signal is triggered when the provided signals are triggered. The mixed signal is also triggered in the integration time points if there is at least one provider without signal.
Represents the series. It is usually something, or an array of something, or a list of such values which can be simulated.
seriesEntity :: String -> s -> SeriesEntitySource
Return the simulatable entity with the specified name for the given series.
Series s => Series [s] | |
Series (Var Double) | |
Series (Var Int) | |
Series (Var String) | |
Series (UVar Double) | |
Series (UVar Int) | |
Series (Ref Double) | |
Series (Ref Int) | |
Series (Ref String) | |
Series (Dynamics Double) | |
Series (Dynamics Int) | |
Series (Dynamics String) | |
Series (Simulation Double) | |
Series (Simulation Int) | |
Series (Simulation String) | |
(Show i, Ix i, Series s) => Series (Array i s) |
data SeriesEntity Source
Defines the simulatable entity.
SeriesEntity | |
|
data SeriesProvider Source
This is provider of the simulatable data.
SeriesProvider | |
|
Defines a view in which the simulation results should be saved. You should extend this type class to define your own views such as the PDF document.
outputView :: v -> GeneratorSource
Create a generator of the reporter.
This is a generator of the reporter.
Generator | |
|
Defines what creates the simulation reports.
Reporter | |
|
data DirectoryName Source
Specifies the directory name, unique or writable.
WritableDirectoryName String | The directory which is overwritten in case if it existed before. |
UniqueDirectoryName String | The directory which is always unique, when a prefix is added to the name in case of need. |
resolveDirectoryName :: Maybe FilePath -> DirectoryName -> Map String String -> IO StringSource
Resolve the directory name relative to the passed in directory as the first argument, replacing the specified strings according the map.
Specifies the file name, unique or writable.
WritableFileName String String | The file which is overwritten in case if it existed before. The first field defines a name or its prototype. The second field is the file extension. |
UniqueFileName String String | The file which is always unique, when a prefix is added to the name in case of need. The first field defines a name or its prototype. The second field is the file exension. |