Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
MCSP.Heuristics.PSOBased
Contents
Synopsis
- mcspSwarm :: Ord a => Pair (String a) -> Meta (Random (NonEmpty (Swarm Edge)))
- pso :: Ord a => Pair (String a) -> Meta (Pair (Partition a))
- partitionWeights :: Pair (Partition a) -> Vector Edge -> Random (Vector Weight)
- edgeSizeWeights :: Vector Edge -> Random (Vector Weight)
- newtype PSOIterations = PSOIterations Int
- newtype PSOParticles = PSOParticles Int
- newtype PSOSeed = PSOSeed Seed
- newtype PSOFirstBestIter = PSOFirstBestIter {}
- newtype PSOPure = PSOPure Bool
- newtype PSOCombine = PSOCombine Bool
- data PSOUpdaterWeigths = PSOUpdaterWeigths {}
- data PSOInitialDistribution = PSOInitialDistribution Double Double Double Double
Documentation
mcspSwarm :: Ord a => Pair (String a) -> Meta (Random (NonEmpty (Swarm Edge))) Source #
Create an iterated PSO swarm for the MCSP problem.
partitionWeights :: Pair (Partition a) -> Vector Edge -> Random (Vector Weight) Source #
Produce random weights for an edge set such that a given partition would be the result of creating a solution using those weights.
>>>
let ps = (["a", "ba", "b"], ["a", "b", "ba"])
>>>
let es = [((0,0),2),((1,2),2),((2,0),2)]
>>>
compatibleEdges ps es
[False,True,False]
>>>
generateWith (1,2) $ partitionWeights ps es
[0.6502342,-0.8818351,7.536712e-2]
edgeSizeWeights :: Vector Edge -> Random (Vector Weight) Source #
Produce random weights for an edge set sorted in such a way that longer edges are prioritized. >>> generateWith (1,2) $ edgeSizeWeights [((0,0),4),((1,2),1),((2,0),10)] [0.30046844,0.7636702,-0.84926575]
Meta Parameters
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 |
Initial seed used for randomized operation in the PSO algorithm.
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 # |
Run PSO only, without using other heuristics.
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 # |
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 |
data PSOInitialDistribution Source #
Distribution weights used to generate the initial particles for PSO.
Constructors
PSOInitialDistribution Double Double Double Double |