HSGEP-0.1.0: Gene Expression Programming evolutionary algorithm in HaskellSource codeContentsIndex
GEP.Rmonad
Description

Monad based on state for passing random number state around for GEP. The choice of Mersenne.Pure64 was for performance, and the pure version will play nicely with threading.

Author: mjsottile@computer.org

Synopsis
type GEPMonad a = Rmonad PureMT a
nextF :: Double -> Rmonad PureMT Double
nextR :: Int -> Rmonad PureMT Int
nextRDifferent :: Int -> Int -> Rmonad PureMT Int
nextRList :: Int -> Int -> Rmonad PureMT [Int]
nextRListUnique :: Int -> [Int] -> Int -> Rmonad PureMT [Int]
nextRListPairs :: Int -> Int -> Rmonad PureMT [(Int, Int)]
generatePairs :: Int -> Rmonad PureMT [(Int, Int)]
runRmonad :: Rmonad PureMT a -> PureMT -> (a, PureMT)
Documentation
type GEPMonad a = Rmonad PureMT aSource
The GEPMonad is just a specific instance of the State monad where the state is just the PureMT PRNG state.
nextFSource
:: DoubleUpper bound.
-> Rmonad PureMT Double
Generate a random number as a Double between 0.0 and the given upper bound.
nextRSource
:: IntUpper bound.
-> Rmonad PureMT Int
Generate a random integer between 1 and the upper bound (inclusive).
nextRDifferentSource
:: IntUpper bound.
-> IntInteger to avoid.
-> Rmonad PureMT Int
Generate a random integer in the specified range that is NOT equal to the integer provided.
nextRListSource
:: IntNumber of integers to generate
-> IntUpper bound for each integer.
-> Rmonad PureMT [Int]
Generate a list of random integers.
nextRListUnique :: Int -> [Int] -> Int -> Rmonad PureMT [Int]Source
Generate a list of n random integers such that each entry occurs at most once. Each number in the list must be unique.
nextRListPairs :: Int -> Int -> Rmonad PureMT [(Int, Int)]Source
generatePairs :: Int -> Rmonad PureMT [(Int, Int)]Source
Document me!
runRmonad :: Rmonad PureMT a -> PureMT -> (a, PureMT)Source
Run function for the Rmonad.
Produced by Haddock version 2.6.1