bestIndPassesDownsample done
This commit is contained in:
parent
29617dd604
commit
70fd714340
@ -42,7 +42,7 @@ gpLoop pushArgs@(PushArgs {trainingData = tData}) = do
|
|||||||
-- holds the evaluation count. The list of Individuals is the population. The last parameter is
|
-- holds the evaluation count. The list of Individuals is the population. The last parameter is
|
||||||
-- the training data (possibly downsampled).
|
-- the training data (possibly downsampled).
|
||||||
gpLoop' :: PushArgs -> Int -> Int -> [Individual] -> [PushData] -> IO ()
|
gpLoop' :: PushArgs -> Int -> Int -> [Individual] -> [PushData] -> IO ()
|
||||||
gpLoop' pushArgs generation evaluations population indexedTrainingData = do
|
gpLoop' pushArgs@(PushArgs {enableDownsampling = enableDS, solutionErrorThreshold = seThresh}) generation evaluations population indexedTrainingData = do
|
||||||
print "Put information about each generation here."
|
print "Put information about each generation here."
|
||||||
when bestIndPassesDownsample $ print $ "Semi Success Generation: " <> show generation
|
when bestIndPassesDownsample $ print $ "Semi Success Generation: " <> show generation
|
||||||
let nextAction
|
let nextAction
|
||||||
@ -95,6 +95,6 @@ gpLoop' pushArgs generation evaluations population indexedTrainingData = do
|
|||||||
bestInd :: Individual
|
bestInd :: Individual
|
||||||
bestInd = case uncons evaledPop of Just (x, _) -> x; _ -> error "Error: Population is empty!"
|
bestInd = case uncons evaledPop of Just (x, _) -> x; _ -> error "Error: Population is empty!"
|
||||||
bestIndPassesDownsample :: Bool
|
bestIndPassesDownsample :: Bool
|
||||||
bestIndPassesDownsample = False -- TODO: fix this later
|
bestIndPassesDownsample = enableDS && (extractTotalFitness bestInd <= seThresh)
|
||||||
epsilonPushArgs :: PushArgs
|
epsilonPushArgs :: PushArgs
|
||||||
epsilonPushArgs = pushArgs {epsilons = Nothing} -- TODO: And this
|
epsilonPushArgs = pushArgs {epsilons = Nothing} -- TODO: And this
|
||||||
|
@ -28,6 +28,10 @@ extractFitnessCases :: Individual -> [Double]
|
|||||||
extractFitnessCases Individual {fitnessCases = Nothing} = error "Error: fitnessCases is empty!"
|
extractFitnessCases Individual {fitnessCases = Nothing} = error "Error: fitnessCases is empty!"
|
||||||
extractFitnessCases Individual {fitnessCases = Just xs} = xs
|
extractFitnessCases Individual {fitnessCases = Just xs} = xs
|
||||||
|
|
||||||
|
extractTotalFitness :: Individual -> Double
|
||||||
|
extractTotalFitness Individual {totalFitness = Nothing} = error "Error: totalFitness is empty!"
|
||||||
|
extractTotalFitness Individual {totalFitness = Just x} = x
|
||||||
|
|
||||||
-- | Makes a random individual based on the variables in a passed PushArgs.
|
-- | Makes a random individual based on the variables in a passed PushArgs.
|
||||||
makeRandomIndividual :: PushArgs -> IO Individual
|
makeRandomIndividual :: PushArgs -> IO Individual
|
||||||
makeRandomIndividual pushArgs = do
|
makeRandomIndividual pushArgs = do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user