WIP: lambda Individuuen
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
-- In order to use it for a certain problem, basically, you have to make your
|
||||
-- solution type an instance of 'Individual' and then simply call the 'run'
|
||||
-- function.
|
||||
module GA where
|
||||
module GA ( Environment,new, population, mutate, crossover1,crossover, Evaluator, fitness, Individual, GA.run, tournament, N, R, Population, steps, bests, runTests) where
|
||||
|
||||
import Control.Arrow hiding (first, second)
|
||||
import Data.List.NonEmpty ((<|))
|
||||
|
||||
@@ -11,8 +11,8 @@ import System.IO
|
||||
import Szenario191
|
||||
|
||||
data Options = Options
|
||||
{ iterations :: N,
|
||||
populationSize :: N
|
||||
{ iterations :: !N,
|
||||
populationSize :: !N
|
||||
}
|
||||
|
||||
options :: Parser Options
|
||||
|
||||
16
src/Test.hs
16
src/Test.hs
@@ -1,13 +1,29 @@
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
{-# LANGUAGE Trustworthy #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
|
||||
module Main where
|
||||
|
||||
import qualified GA
|
||||
import Protolude
|
||||
import qualified Seminar
|
||||
import qualified LambdaCalculus
|
||||
import Data.Typeable
|
||||
import qualified Type.Reflection as Ref
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
_ <- GA.runTests
|
||||
_ <- Seminar.runTests
|
||||
_ <- putStrLn $ ((show (typeRepArgs (Ref.SomeTypeRep (Ref.TypeRep @(Int->Int->Int->Text))))) :: Text)
|
||||
_ <- putStrLn $ ((show (typeRepArgs (Ref.SomeTypeRep (Ref.TypeRep @(Text))))) :: Text)
|
||||
_ <- putStrLn (LambdaCalculus.toLambdaExpressionShort LambdaCalculus.testIntToClassCorrect)
|
||||
_ <- putStrLn $ ((show (LambdaCalculus.res 1)) :: Text)
|
||||
_ <- putStrLn $ ((show (LambdaCalculus.res 2)) :: Text)
|
||||
_ <- putStrLn $ ((show (LambdaCalculus.res 3)) :: Text)
|
||||
return ()
|
||||
|
||||
Reference in New Issue
Block a user