algo: use jDE from the GA package
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-02-23 17:56:33 +01:00
parent 7317a023dc
commit 22e2703ed2
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

View File

@ -9,10 +9,10 @@
"sort"
"sync"
"git.dotya.ml/wanderer/math-optim/algo/cec2020"
"git.dotya.ml/wanderer/math-optim/algo/de"
"git.dotya.ml/wanderer/math-optim/algo/ga"
"git.dotya.ml/wanderer/math-optim/bench"
c20 "git.dotya.ml/wanderer/math-optim/bench/cec2020"
"git.dotya.ml/wanderer/math-optim/bench/cec2020"
"git.dotya.ml/wanderer/math-optim/report"
"git.dotya.ml/wanderer/math-optim/stats"
)
@ -418,10 +418,8 @@ funcCount := len(bench.Functions)
func DoCEC2020jDE(wg *sync.WaitGroup, m *sync.Mutex) {
defer wg.Done()
cec2020.LogPrintln("starting")
// funcCount is the number of bench functions available and tested.
funcCount := len(c20.Functions)
funcCount := len(cec2020.Functions)
// stats for the current algo.
algoStats := make([][]stats.Stats, funcCount)
// ch serves as a way to get the actual computed output.
@ -438,7 +436,7 @@ funcCount := len(c20.Functions)
cr := 0.9
for i := range algoStats {
jDE := cec2020.NewjDE()
jDE := ga.NewjDE()
// params:
// Generations, minimum bench iterations, mutation strategy, parameter
@ -451,7 +449,7 @@ funcCount := len(c20.Functions)
// 0..17 to choose a mutation strategy,
// 0..1 to select a parameter self-adaptation scheme,
// np >= 4 as initial population size.
jDE.Init(-1, 30, 0, 0, np, f, cr, c20.Dimensions, c20.FuncNames[i], ch, chAlgoMeans)
jDE.Init(-1, 30, 0, 0, np, f, cr, cec2020.Dimensions, cec2020.FuncNames[i], ch, chAlgoMeans)
go jDE.Run()
}
@ -466,8 +464,8 @@ funcCount := len(c20.Functions)
saveAlgoMeans(*aM)
}
pCh := make(chan report.PicList, funcCount*len(c20.Dimensions))
pMeanCh := make(chan report.PicList, funcCount*len(c20.Dimensions))
pCh := make(chan report.PicList, funcCount*len(cec2020.Dimensions))
pMeanCh := make(chan report.PicList, funcCount*len(cec2020.Dimensions))
for _, algoStat := range algoStats {
go plotAllDims(algoStat, "plot", ".pdf", pCh, pMeanCh)