-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Concurrent simulated annealing system. -- -- An extremely lightweight system for concurrent simulated annealing. @package concurrent-sa @version 1.0.1 -- | The traditional simulated annealing is to maintain a current state, -- and repeatedly perturb it, keeping or discarding the perturbed state -- depending on the difference in an energy function and a -- temperature, which changes as a function of time. This -- concurrent SA implementation maintains a population of current states -- which are perturbed, and lower-ranked states are deleted according to -- a temperature function. It is intended as a lightweight approach to -- parallelizing optimization problems. module Control.Concurrent.Annealer -- | An annealer. Maintains a population of states and a perturbation -- function. data Annealer s e -- | initAnnealer initPop energyFunc popSize perturb -- initializes an annealer. initAnnealer :: Ord e => [s] -> (s -> e) -> Int -> (s -> IO s) -> IO (Annealer s e) -- | Offer a state to the annealer. Depending on the current population, -- the state may or may not be kept. offerState :: s -> Annealer s e -> IO () -- | Returns the current best state in the annealer. getBestState :: Ord e => Annealer s e -> IO s -- | annealForTime nThreads microTime annealer runs -- nThreads annealing threads for the specified length of time. annealForTime :: Ord e => Int -> Int -> Annealer s e -> IO s