concurrent-sa-1.0.0: Concurrent simulated annealing system.

Control.Concurrent.Annealer

Description

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.

Synopsis

Documentation

data Annealer s e Source

initAnnealerSource

Arguments

:: Ord e 
=> (s -> e)

The energy function for a state.

-> [s]

A collection of initial states.

-> Int

The size at which to maintain the population.

-> (s -> IO s)

The perturbation function.

-> IO (Annealer s e)

The annealer.

Initializes an annealer.

offerState :: s -> Annealer s e -> IO ()Source

Offer a state to the annealer. Depending on the current population, the state may or may not be kept.

getBestState :: Ord e => Annealer s e -> IO sSource

Returns the current best state in the annealer.

annealForTime :: Ord e => Int -> Int -> Annealer s e -> IO sSource

Runs several annealing threads for the specified length of time.