go(de): add InitAndRun
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
2216b93426
commit
93dc845fbb
|
@ -106,6 +106,18 @@ func (j *JDE) Init(generations, mutStrategy, adptScheme, np int, f, cr float64,
|
|||
pop.Init()
|
||||
}
|
||||
|
||||
// InitAndRun initialises the jDE algorithm, performs sanity checks on the
|
||||
// inputs and calls the Run method.
|
||||
func (j *JDE) InitAndRun(generations, mutStrategy, adptScheme, np int, f, cr float64, dimensions []int, bench string, ch chan []stats.Stats) {
|
||||
if j == nil {
|
||||
jDELogger.Fatalln("jDE is nil, NewjDE() needs to be called first. exiting...")
|
||||
}
|
||||
|
||||
j.Init(generations, mutStrategy, adptScheme, np, f, cr, dimensions, bench, ch)
|
||||
|
||||
j.Run()
|
||||
}
|
||||
|
||||
// Run self-adapting differential evolution algorithm.
|
||||
func (j *JDE) Run() {
|
||||
if j == nil {
|
||||
|
|
Loading…
Reference in New Issue