algo: use jDE from the GA package
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7317a023dc
commit
22e2703ed2
16
algo/algo.go
16
algo/algo.go
@ -9,10 +9,10 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"git.dotya.ml/wanderer/math-optim/algo/cec2020"
|
|
||||||
"git.dotya.ml/wanderer/math-optim/algo/de"
|
"git.dotya.ml/wanderer/math-optim/algo/de"
|
||||||
|
"git.dotya.ml/wanderer/math-optim/algo/ga"
|
||||||
"git.dotya.ml/wanderer/math-optim/bench"
|
"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/report"
|
||||||
"git.dotya.ml/wanderer/math-optim/stats"
|
"git.dotya.ml/wanderer/math-optim/stats"
|
||||||
)
|
)
|
||||||
@ -418,10 +418,8 @@ func DojDE(wg *sync.WaitGroup, m *sync.Mutex) {
|
|||||||
func DoCEC2020jDE(wg *sync.WaitGroup, m *sync.Mutex) {
|
func DoCEC2020jDE(wg *sync.WaitGroup, m *sync.Mutex) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
||||||
cec2020.LogPrintln("starting")
|
|
||||||
|
|
||||||
// funcCount is the number of bench functions available and tested.
|
// funcCount is the number of bench functions available and tested.
|
||||||
funcCount := len(c20.Functions)
|
funcCount := len(cec2020.Functions)
|
||||||
// stats for the current algo.
|
// stats for the current algo.
|
||||||
algoStats := make([][]stats.Stats, funcCount)
|
algoStats := make([][]stats.Stats, funcCount)
|
||||||
// ch serves as a way to get the actual computed output.
|
// ch serves as a way to get the actual computed output.
|
||||||
@ -438,7 +436,7 @@ func DoCEC2020jDE(wg *sync.WaitGroup, m *sync.Mutex) {
|
|||||||
cr := 0.9
|
cr := 0.9
|
||||||
|
|
||||||
for i := range algoStats {
|
for i := range algoStats {
|
||||||
jDE := cec2020.NewjDE()
|
jDE := ga.NewjDE()
|
||||||
|
|
||||||
// params:
|
// params:
|
||||||
// Generations, minimum bench iterations, mutation strategy, parameter
|
// Generations, minimum bench iterations, mutation strategy, parameter
|
||||||
@ -451,7 +449,7 @@ func DoCEC2020jDE(wg *sync.WaitGroup, m *sync.Mutex) {
|
|||||||
// 0..17 to choose a mutation strategy,
|
// 0..17 to choose a mutation strategy,
|
||||||
// 0..1 to select a parameter self-adaptation scheme,
|
// 0..1 to select a parameter self-adaptation scheme,
|
||||||
// np >= 4 as initial population size.
|
// 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()
|
go jDE.Run()
|
||||||
}
|
}
|
||||||
@ -466,8 +464,8 @@ func DoCEC2020jDE(wg *sync.WaitGroup, m *sync.Mutex) {
|
|||||||
saveAlgoMeans(*aM)
|
saveAlgoMeans(*aM)
|
||||||
}
|
}
|
||||||
|
|
||||||
pCh := make(chan report.PicList, funcCount*len(c20.Dimensions))
|
pCh := make(chan report.PicList, funcCount*len(cec2020.Dimensions))
|
||||||
pMeanCh := make(chan report.PicList, funcCount*len(c20.Dimensions))
|
pMeanCh := make(chan report.PicList, funcCount*len(cec2020.Dimensions))
|
||||||
|
|
||||||
for _, algoStat := range algoStats {
|
for _, algoStat := range algoStats {
|
||||||
go plotAllDims(algoStat, "plot", ".pdf", pCh, pMeanCh)
|
go plotAllDims(algoStat, "plot", ".pdf", pCh, pMeanCh)
|
||||||
|
Loading…
Reference in New Issue
Block a user