Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
MCSP.Heuristics
Contents
Description
Heuristic for the MCSP problem.
Synopsis
- type Heuristic a = Pair (String a) -> Meta (Pair (Partition a))
- trivial :: Heuristic a
- newtype UseSingletons = UseSingletons Bool
- combine :: Ord a => Pair (String a) -> Meta (Pair (Partition a))
- greedy :: Ord a => Pair (String a) -> Meta (Pair (Partition a))
- newtype PSOCombine = PSOCombine Bool
- newtype PSOFirstBestIter = PSOFirstBestIter {}
- data PSOInitialDistribution = PSOInitialDistribution Double Double Double Double
- newtype PSOIterations = PSOIterations Int
- newtype PSOParticles = PSOParticles Int
- newtype PSOPure = PSOPure Bool
- newtype PSOSeed = PSOSeed Seed
- data PSOUpdaterWeigths = PSOUpdaterWeigths {}
- pso :: Ord a => Pair (String a) -> Meta (Pair (Partition a))
Main heuristics
type Heuristic a = Pair (String a) -> Meta (Pair (Partition a)) Source #
Heuristic for the MCSP problem.
trivial :: Heuristic a Source #
The trivial solution for MCSP problem.
Just split each string into a partition of single characters.
>>>
import MCSP.Data.Meta (evalMeta)
>>>
evalMeta (trivial ("abba", "abab"))
([a,b,b,a],[a,b,a,b])
newtype UseSingletons Source #
Enable or disable singleton analysis in combine
.
Constructors
UseSingletons Bool |
Instances
Show UseSingletons Source # | |
Defined in MCSP.Heuristics.Combine Methods showsPrec :: Int -> UseSingletons -> ShowS # show :: UseSingletons -> String # showList :: [UseSingletons] -> ShowS # | |
Eq UseSingletons Source # | |
Defined in MCSP.Heuristics.Combine Methods (==) :: UseSingletons -> UseSingletons -> Bool # (/=) :: UseSingletons -> UseSingletons -> Bool # | |
Ord UseSingletons Source # | |
Defined in MCSP.Heuristics.Combine Methods compare :: UseSingletons -> UseSingletons -> Ordering # (<) :: UseSingletons -> UseSingletons -> Bool # (<=) :: UseSingletons -> UseSingletons -> Bool # (>) :: UseSingletons -> UseSingletons -> Bool # (>=) :: UseSingletons -> UseSingletons -> Bool # max :: UseSingletons -> UseSingletons -> UseSingletons # min :: UseSingletons -> UseSingletons -> UseSingletons # | |
MetaInputVariable UseSingletons Source # | |
Defined in MCSP.Heuristics.Combine Methods |
combine :: Ord a => Pair (String a) -> Meta (Pair (Partition a)) Source #
MSCP combine heuristic.
Applies singleton analysis depending on the value of UseSingletons
.
greedy :: Ord a => Pair (String a) -> Meta (Pair (Partition a)) Source #
MCSP greedy algorithm.
Tries to solve the MCSP by repeatedly finding the longest common substring (LCS), breaking the strings with it, and inserting the LCS in the resulting partition, until no common substring is left.
newtype PSOCombine Source #
Run combine after on the partitions represented by the edge list.
Constructors
PSOCombine Bool |
Instances
Show PSOCombine Source # | |
Defined in MCSP.Heuristics.PSOBased Methods showsPrec :: Int -> PSOCombine -> ShowS # show :: PSOCombine -> String # showList :: [PSOCombine] -> ShowS # | |
Eq PSOCombine Source # | |
Defined in MCSP.Heuristics.PSOBased | |
Ord PSOCombine Source # | |
Defined in MCSP.Heuristics.PSOBased Methods compare :: PSOCombine -> PSOCombine -> Ordering # (<) :: PSOCombine -> PSOCombine -> Bool # (<=) :: PSOCombine -> PSOCombine -> Bool # (>) :: PSOCombine -> PSOCombine -> Bool # (>=) :: PSOCombine -> PSOCombine -> Bool # max :: PSOCombine -> PSOCombine -> PSOCombine # min :: PSOCombine -> PSOCombine -> PSOCombine # | |
MetaInputVariable PSOCombine Source # | |
Defined in MCSP.Heuristics.PSOBased Methods getVar :: Meta PSOCombine Source # |
newtype PSOFirstBestIter Source #
Output for the first iteration that reached the best solution in PSO.
Constructors
PSOFirstBestIter | |
Fields |
Instances
Show PSOFirstBestIter Source # | |
Defined in MCSP.Heuristics.PSOBased Methods showsPrec :: Int -> PSOFirstBestIter -> ShowS # show :: PSOFirstBestIter -> String # showList :: [PSOFirstBestIter] -> ShowS # | |
Eq PSOFirstBestIter Source # | |
Defined in MCSP.Heuristics.PSOBased Methods (==) :: PSOFirstBestIter -> PSOFirstBestIter -> Bool # (/=) :: PSOFirstBestIter -> PSOFirstBestIter -> Bool # | |
Ord PSOFirstBestIter Source # | |
Defined in MCSP.Heuristics.PSOBased Methods compare :: PSOFirstBestIter -> PSOFirstBestIter -> Ordering # (<) :: PSOFirstBestIter -> PSOFirstBestIter -> Bool # (<=) :: PSOFirstBestIter -> PSOFirstBestIter -> Bool # (>) :: PSOFirstBestIter -> PSOFirstBestIter -> Bool # (>=) :: PSOFirstBestIter -> PSOFirstBestIter -> Bool # max :: PSOFirstBestIter -> PSOFirstBestIter -> PSOFirstBestIter # min :: PSOFirstBestIter -> PSOFirstBestIter -> PSOFirstBestIter # | |
MetaOutputVariable PSOFirstBestIter Source # | |
Defined in MCSP.Heuristics.PSOBased Methods setVar :: PSOFirstBestIter -> Meta () Source # |
data PSOInitialDistribution Source #
Distribution weights used to generate the initial particles for PSO.
Constructors
PSOInitialDistribution Double Double Double Double |
Instances
newtype PSOIterations Source #
The number of iterations to run the PSO algorithm.
Constructors
PSOIterations Int |
Instances
Show PSOIterations Source # | |
Defined in MCSP.Heuristics.PSOBased Methods showsPrec :: Int -> PSOIterations -> ShowS # show :: PSOIterations -> String # showList :: [PSOIterations] -> ShowS # | |
Eq PSOIterations Source # | |
Defined in MCSP.Heuristics.PSOBased Methods (==) :: PSOIterations -> PSOIterations -> Bool # (/=) :: PSOIterations -> PSOIterations -> Bool # | |
Ord PSOIterations Source # | |
Defined in MCSP.Heuristics.PSOBased Methods compare :: PSOIterations -> PSOIterations -> Ordering # (<) :: PSOIterations -> PSOIterations -> Bool # (<=) :: PSOIterations -> PSOIterations -> Bool # (>) :: PSOIterations -> PSOIterations -> Bool # (>=) :: PSOIterations -> PSOIterations -> Bool # max :: PSOIterations -> PSOIterations -> PSOIterations # min :: PSOIterations -> PSOIterations -> PSOIterations # | |
MetaInputVariable PSOIterations Source # | |
Defined in MCSP.Heuristics.PSOBased Methods |
newtype PSOParticles Source #
The number of particles used at each iteration of the PSO algorithm.
Constructors
PSOParticles Int |
Instances
Show PSOParticles Source # | |
Defined in MCSP.Heuristics.PSOBased Methods showsPrec :: Int -> PSOParticles -> ShowS # show :: PSOParticles -> String # showList :: [PSOParticles] -> ShowS # | |
Eq PSOParticles Source # | |
Defined in MCSP.Heuristics.PSOBased | |
Ord PSOParticles Source # | |
Defined in MCSP.Heuristics.PSOBased Methods compare :: PSOParticles -> PSOParticles -> Ordering # (<) :: PSOParticles -> PSOParticles -> Bool # (<=) :: PSOParticles -> PSOParticles -> Bool # (>) :: PSOParticles -> PSOParticles -> Bool # (>=) :: PSOParticles -> PSOParticles -> Bool # max :: PSOParticles -> PSOParticles -> PSOParticles # min :: PSOParticles -> PSOParticles -> PSOParticles # | |
MetaInputVariable PSOParticles Source # | |
Defined in MCSP.Heuristics.PSOBased Methods |
Run PSO only, without using other heuristics.
Initial seed used for randomized operation in the PSO algorithm.
data PSOUpdaterWeigths Source #
Weights used for the default particle updater in PSO.
Instances
Show PSOUpdaterWeigths Source # | |
Defined in MCSP.Heuristics.PSOBased Methods showsPrec :: Int -> PSOUpdaterWeigths -> ShowS # show :: PSOUpdaterWeigths -> String # showList :: [PSOUpdaterWeigths] -> ShowS # | |
Eq PSOUpdaterWeigths Source # | |
Defined in MCSP.Heuristics.PSOBased Methods (==) :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> Bool # (/=) :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> Bool # | |
Ord PSOUpdaterWeigths Source # | |
Defined in MCSP.Heuristics.PSOBased Methods compare :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> Ordering # (<) :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> Bool # (<=) :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> Bool # (>) :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> Bool # (>=) :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> Bool # max :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> PSOUpdaterWeigths # min :: PSOUpdaterWeigths -> PSOUpdaterWeigths -> PSOUpdaterWeigths # | |
MetaInputVariable PSOUpdaterWeigths Source # | |
Defined in MCSP.Heuristics.PSOBased Methods |