pigy-genetics
Safe HaskellNone
LanguageHaskell2010

Pigy.Image

Description

Image blending using a genetics strategy.

Synopsis

Documentation

data Genotype Source #

A versioned genotype.

Constructors

GenotypeV0 Genotype

Version 0.

GenotypeV1 Genotype

Version 1.

Instances

Instances details
Eq Genotype Source # 
Instance details

Defined in Pigy.Image

Methods

(==) :: Genotype -> Genotype -> Bool

(/=) :: Genotype -> Genotype -> Bool

Ord Genotype Source # 
Instance details

Defined in Pigy.Image

Methods

compare :: Genotype -> Genotype -> Ordering

(<) :: Genotype -> Genotype -> Bool

(<=) :: Genotype -> Genotype -> Bool

(>) :: Genotype -> Genotype -> Bool

(>=) :: Genotype -> Genotype -> Bool

max :: Genotype -> Genotype -> Genotype

min :: Genotype -> Genotype -> Genotype

Show Genotype Source # 
Instance details

Defined in Pigy.Image

Methods

showsPrec :: Int -> Genotype -> ShowS

show :: Genotype -> String

showList :: [Genotype] -> ShowS

Binary Genotype Source # 
Instance details

Defined in Pigy.Image

Methods

put :: Genotype -> Put

get :: Get Genotype

putList :: [Genotype] -> Put

Phenable Genotype Source # 
Instance details

Defined in Pigy.Image

Uniform Genotype Source # 
Instance details

Defined in Pigy.Image

Methods

uniformM :: StatefulGen g m => g -> m Genotype

Upgradeable Genotype Genotype Source # 
Instance details

Defined in Pigy.Image

Upgradeable Genotype Genotype Source # 
Instance details

Defined in Pigy.Image

newGenotype Source #

Arguments

:: StatefulGen g IO 
=> g

The random-number generator.

-> IO Genotype

The action to create the genotype.

Create a new genotype at random.

toChromosome Source #

Arguments

:: Genotype

The genotype.

-> Chromosome

The chromosome.

Convert a genotype to a chromosome.

fromChromosome Source #

Arguments

:: Chromosome

The chromosome.

-> Maybe Genotype

The genotype, if the chromosome was valid.

Convert a chromosome to a genotype.

fromChromosome' Source #

Arguments

:: Binary a 
=> Chromosome

The chromosome.

-> Maybe a

The serializable, if the chromosome was valid.

Convert a chromosome to something serializable.

crossover Source #

Arguments

:: MonadFail m 
=> StatefulGen g m 
=> g

The random-number generator.

-> [Genotype]

The genotypes to be crossed.

-> m Genotype

The action to cross the genotypes.

Perform crossover between genotypes.

toPngBytes Source #

Arguments

:: Phenotype

The phenotype.

-> ByteString

The PNG image bytes.

Convert a phenotype to a PNG image.

writeImage Source #

Arguments

:: MonadIO m 
=> FilePath

The path to the PNG file.

-> Phenotype

The phenotype.

-> m ()

The action to write the PNG file.

Write a phenotype to a PNG file.

toImage Source #

Arguments

:: Phenotype

The phenotype.

-> Image PixelRGBA8

The image.

Convert a phenotype to an image.