From b3b1b38ac8b1f7d172815fefe50e7cb85e5aa751 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 15 Feb 2023 22:56:40 +0100 Subject: [PATCH] ga: add SOMA T3A struct --- algo/ga/somat3a.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 algo/ga/somat3a.go diff --git a/algo/ga/somat3a.go b/algo/ga/somat3a.go new file mode 100644 index 0000000..36b11db --- /dev/null +++ b/algo/ga/somat3a.go @@ -0,0 +1,36 @@ +// Copyright 2023 wanderer +// SPDX-License-Identifier: GPL-3.0-or-later + +package ga + +import ( + "git.dotya.ml/wanderer/math-optim/stats" + "gonum.org/v1/gonum/stat/distuv" +) + +// SOMAT3A holds the settings for an instance of SOMA T3A algorithm. +// nolint: unused +type SOMAT3A struct { + // Generations is the number of generations to evolve for. Disable limit + // with -1. + Generations int + // BenchMinIters is the number of iterations that the bench function will + // be re-run. + BenchMinIters int + // Dimensions in which to look for a solution. + Dimensions []int + // NP is the initial population size. + NP int + // BenchName is the human-friendly name of the benchmarking function. + BenchName string + // ch is a channel for writing back computed results. + ch chan []stats.Stats + // chAlgoMeans is a channel for writing back algo means. + chAlgoMeans chan *stats.AlgoBenchMean + + // rng is a random number generator. + rng distuv.Uniform + + // initialised denotes the initialisation state of the struct. + initialised bool +}