packages feed

local-search 0.0.2 → 0.0.3

raw patch · 2 files changed

+17/−10 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Control.Search.Local.Tree: instance (Eq nme) => Eq (LSTree nme)
- Control.Search.Local.Tree: instance (Ord nme) => Ord (LSTree nme)
+ Control.Search.Local.Tree: instance Eq nme => Eq (LSTree nme)
+ Control.Search.Local.Tree: instance Ord nme => Ord (LSTree nme)
- Control.Search.Local: basicExchange :: (Eq a) => [a] -> [[a]]
+ Control.Search.Local: basicExchange :: Eq a => [a] -> [[a]]
- Control.Search.Local: exchange :: (Eq a) => Int -> Int -> [a] -> [[a]]
+ Control.Search.Local: exchange :: Eq a => Int -> Int -> [a] -> [[a]]
- Control.Search.Local: firstImprov :: (Ord nme) => LSTree nme -> [nme]
+ Control.Search.Local: firstImprov :: Ord nme => LSTree nme -> [nme]
- Control.Search.Local: improvement :: (Ord nme) => LSTree nme -> LSTree nme
+ Control.Search.Local: improvement :: Ord nme => LSTree nme -> LSTree nme
- Control.Search.Local: maxFirstTabu :: (Ord nme) => Int -> LSTree nme -> [nme]
+ Control.Search.Local: maxFirstTabu :: Ord nme => Int -> LSTree nme -> [nme]
- Control.Search.Local: maxImprov :: (Ord nme) => LSTree nme -> [nme]
+ Control.Search.Local: maxImprov :: Ord nme => LSTree nme -> [nme]
- Control.Search.Local: minFirstTabu :: (Ord nme) => Int -> LSTree nme -> [nme]
+ Control.Search.Local: minFirstTabu :: Ord nme => Int -> LSTree nme -> [nme]
- Control.Search.Local: minImprov :: (Ord nme) => LSTree nme -> [nme]
+ Control.Search.Local: minImprov :: Ord nme => LSTree nme -> [nme]
- Control.Search.Local: nShuffle :: (RandomGen g) => g -> LSTree nme -> LSTree nme
+ Control.Search.Local: nShuffle :: RandomGen g => g -> LSTree nme -> LSTree nme
- Control.Search.Local: nSort :: (Ord nme) => LSTree nme -> LSTree nme
+ Control.Search.Local: nSort :: Ord nme => LSTree nme -> LSTree nme
- Control.Search.Local: priceSolution :: (NumericallyPriced a b) => a -> b
+ Control.Search.Local: priceSolution :: NumericallyPriced a b => a -> b
- Control.Search.Local: randomWalk :: (RandomGen g) => g -> LSTree nme -> [nme]
+ Control.Search.Local: randomWalk :: RandomGen g => g -> LSTree nme -> [nme]
- Control.Search.Local: sImprovement :: (Ord nme) => LSTree nme -> LSTree nme
+ Control.Search.Local: sImprovement :: Ord nme => LSTree nme -> LSTree nme
- Control.Search.Local: saTemp :: (Num a) => a -> a -> [a]
+ Control.Search.Local: saTemp :: Num a => a -> a -> [a]
- Control.Search.Local: simpleTabu :: (Eq nme) => Int -> LSTree nme -> [nme]
+ Control.Search.Local: simpleTabu :: Eq nme => Int -> LSTree nme -> [nme]
- Control.Search.Local: tabu :: (Eq nme) => Int -> [nme] -> LSTree nme -> LSTree nme
+ Control.Search.Local: tabu :: Eq nme => Int -> [nme] -> LSTree nme -> LSTree nme
- Control.Search.Local: thresholdWorsening :: (NumericallyPriced nme a) => a -> LSTree nme -> LSTree nme
+ Control.Search.Local: thresholdWorsening :: NumericallyPriced nme a => a -> LSTree nme -> LSTree nme
- Control.Search.Local: varyingThresholdWorsening :: (NumericallyPriced nme a) => [a] -> LSTree nme -> LSTree nme
+ Control.Search.Local: varyingThresholdWorsening :: NumericallyPriced nme a => [a] -> LSTree nme -> LSTree nme
- Control.Search.Local.Neighbourhood: basicExchange :: (Eq a) => [a] -> [[a]]
+ Control.Search.Local.Neighbourhood: basicExchange :: Eq a => [a] -> [[a]]
- Control.Search.Local.Neighbourhood: exchange :: (Eq a) => Int -> Int -> [a] -> [[a]]
+ Control.Search.Local.Neighbourhood: exchange :: Eq a => Int -> Int -> [a] -> [[a]]
- Control.Search.Local.Neighbourhood: priceSolution :: (NumericallyPriced a b) => a -> b
+ Control.Search.Local.Neighbourhood: priceSolution :: NumericallyPriced a b => a -> b
- Control.Search.Local.Transformation: improvement :: (Ord nme) => LSTree nme -> LSTree nme
+ Control.Search.Local.Transformation: improvement :: Ord nme => LSTree nme -> LSTree nme
- Control.Search.Local.Transformation: nShuffle :: (RandomGen g) => g -> LSTree nme -> LSTree nme
+ Control.Search.Local.Transformation: nShuffle :: RandomGen g => g -> LSTree nme -> LSTree nme
- Control.Search.Local.Transformation: nSort :: (Ord nme) => LSTree nme -> LSTree nme
+ Control.Search.Local.Transformation: nSort :: Ord nme => LSTree nme -> LSTree nme
- Control.Search.Local.Transformation: sImprovement :: (Ord nme) => LSTree nme -> LSTree nme
+ Control.Search.Local.Transformation: sImprovement :: Ord nme => LSTree nme -> LSTree nme
- Control.Search.Local.Transformation: tabu :: (Eq nme) => Int -> [nme] -> LSTree nme -> LSTree nme
+ Control.Search.Local.Transformation: tabu :: Eq nme => Int -> [nme] -> LSTree nme -> LSTree nme
- Control.Search.Local.Transformation: thresholdWorsening :: (NumericallyPriced nme a) => a -> LSTree nme -> LSTree nme
+ Control.Search.Local.Transformation: thresholdWorsening :: NumericallyPriced nme a => a -> LSTree nme -> LSTree nme
- Control.Search.Local.Transformation: varyingThresholdWorsening :: (NumericallyPriced nme a) => [a] -> LSTree nme -> LSTree nme
+ Control.Search.Local.Transformation: varyingThresholdWorsening :: NumericallyPriced nme a => [a] -> LSTree nme -> LSTree nme

Files

Control/Search/Local/Transformation.hs view
@@ -67,20 +67,27 @@     (rs,g') = makeLimitedRands g $ length ns      ns' = map (nShuffle g') (shuffle (rs :: [Int]) ns) -{- | Recursive neighbourhood ordering transformation. Could be reimplemented in -the future in a similar way to improvement, with a single level -transformation, this would allow odd combinations in lists to be used in -other multi-apply configurations. -}+{- | Single level neighbourhood ordering transformation. -}+sSort :: Ord nme=>LSTree nme -> LSTree nme+sSort t = LSTree (treeNodeName t) (sort (treeNodeChildren t)) +{- | Recursive neighbourhood ordering transformation. Implemented using multi-apply. -}+ nSort :: Ord nme=>LSTree nme -> LSTree nme -nSort t = let ns = sort (treeNodeChildren t)-          in LSTree (treeNodeName t) ns+nSort = multiLevelApply (repeat sSort) -{- | Reversal, recursive again. To be used in combination with sorting to -   place in ascending or descending order, depending on what you want. -}+{- | Single level reversal of neighbourhood order. To be used in conjunction with sorting for moving+     between finding largest and smallest elements. -} +sReverse :: LSTree nme -> LSTree nme +sReverse t = LSTree (treeNodeName t) (reverse $ treeNodeChildren t)++{- | Recursive neighbourhood reversal transformation. Implemented using multi-apply. -}+ nReverse :: LSTree nme -> LSTree nme -nReverse t = LSTree (treeNodeName t) (reverse $ treeNodeChildren t)+nReverse = multiLevelApply (repeat sReverse)++  {- |  A simple (very simple) TABU system. Based upon a limited Queue, and  direct node comparison (not the way it is usually used in the OR 
local-search.cabal view
@@ -1,5 +1,5 @@ Name:              local-search -Version:           0.0.2+Version:           0.0.3 Synopsis:          A first attempt at generalised local search within Haskell, for applications in combinatorial optimisation.  Description:       This library represents a first attempt at creating a generalised library for                    local (non-exhaustive) search in Haskell.  It is based on work presented to