cec2020

package
v0.0.0-...-7a5de80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cec2020 implements functions of the CEC2020 Testbed. Function definitions and overview: https://github.com/P-N-Suganthan/2020-Bound-Constrained-Opt-Benchmark/blob/d8b4c52f161562cd462e9b3352885e8df6fd2e41/Definitions%20of%20%20CEC2020%20benchmark%20suite%20Bound%20Constrained.pdf Example implementation: https://github.com/danney9512/CEC2020-Bound-Constrained-Opt_mpmL-SHADE/blob/master/mpmL-SHADE_source code/src/problem_test_functions.h

Index

Constants

This section is empty.

Variables

View Source
var (
	// Dimensions to bench.
	Dimensions = []int{
		5,
		10,
		15,
		20,
	}
	// MaxFES as specified for each dimension.
	MaxFES = []int{
		50000,
		1000000,
		3000000,
		10000000,
	}
)
View Source
var FuncNames = map[int]string{
	0: "Bent Cigar",
	1: "Schwefel Modified",
	2: "Lunacek Bi-Rastrigin",
	3: "Rosenbrock-Griewank",
	4: "Hybrid1",
	5: "Hybrid2",
	6: "Hybrid3",
	7: "Composition1",
	8: "Composition2",
	9: "Composition3",
}

FuncNames represents a numbered list of function name.

View Source
var Functions = map[string]func([]float64) float64{
	"Bent Cigar":           BentCigar,
	"Schwefel Modified":    Schwefel,
	"Lunacek Bi-Rastrigin": LunacekBiRastrigin,
	"Rosenbrock-Griewank":  RosenbrockGriewank,
	"Hybrid1":              Hybrid1,
	"Hybrid2":              Hybrid2,
	"Hybrid3":              Hybrid3,
	"Composition1":         Composition1,
	"Composition2":         Composition2,
	"Composition3":         Composition3,
}

Functions is a string-func map of function names and specific bench funcs for easier iterable access.

View Source
var SearchRange = bench.NewfuncParams(searchRangeMin, searchRangeMax)

SearchRange specifies the CEC2020 search range.

Functions

func Ackley

func Ackley(x []float64) float64

Ackley is the "Ackley's Function" of CEC2020.

func Asy

func Asy(x []float64, beta float64)

Asy is the asymptotic function.

func BentCigar

func BentCigar(x []float64) float64

BentCigar is the "Bent Cigar Function" of CEC2020.

func Composition1

func Composition1(x []float64) float64

Composition1 is the "Composition Function 1" of CEC2020.

func Composition2

func Composition2(x []float64) float64

Composition2 is the "Composition Function 2" of CEC2020.

func Composition3

func Composition3(x []float64) float64

Composition3 is the "Composition Function 3" of CEC2020.

func Discus

func Discus(x []float64) float64

Discus is the "Discus Function" of CEC2020.

func GetMaxFES

func GetMaxFES(dim int) int

GetMaxFES returns maxFES for the passed dimension, given that it's present in the MaxFES slice, returns -1 otherwise.

func Griewank

func Griewank(x []float64) float64

Griewank is the "Griewank's Function" of CEC2020. ref: https://www.sfu.ca/~ssurjano/griewank.html

func HGBat

func HGBat(x []float64) float64

HGBat is the "HGBat Function" of CEC2020.

func Happycat

func Happycat(x []float64) float64

Happycat is the "Happycat Function" of CEC2020.

func HighConditionedElliptic

func HighConditionedElliptic(x []float64) float64

HighConditionedElliptic is the "High Conditioned Elliptic Function" of CEC2020.

func Hybrid1

func Hybrid1(x []float64) float64

Hybrid1 is the "Hybrid Function 1" of CEC2020.

func Hybrid2

func Hybrid2(x []float64) float64

Hybrid2 is the "Hybrid Function 2" of CEC2020.

func Hybrid3

func Hybrid3(x []float64) float64

Hybrid3 is the "Hybrid Function 3" of CEC2020.

func LoadInputData

func LoadInputData(nx int) (map[int][][]float64, map[int][][]float64)

LoadInputData loads matrices and shift/rotation/shuffle input data and returns them as maps.

func LunacekBiRastrigin

func LunacekBiRastrigin(x []float64) float64

LunacekBiRastrigin is the "Shifted and Rotated Lunacek bi-Rastrigin Function" of CEC2020. ref: https://al-roomi.org/benchmarks/unconstrained/n-dimensions/229-lunacek-s-bi-rastrigin-function.

func Rastrigin

func Rastrigin(x []float64) float64

Rastrigin calculates the value of the Rastrigin function for x.

func Rosenbrock

func Rosenbrock(x []float64) float64

Rosenbrock is the "Rosenbrock's Function" of CEC2020. ref: https://infinity77.net/global_optimization/test_functions_nd_R.html#go_benchmark.Rosenbrock

func RosenbrockGriewank

func RosenbrockGriewank(x []float64) float64

RosenbrockGriewank is the "Expanded Rosenbrock's plus Griewank's Function" of CEC2020.

func Rotate

func Rotate(x []float64, mr []float64)

Rotate rotates values of x based on values of mr.

func Schaffer

func Schaffer(x, y float64) float64

Schaffer is the Schaffer's function.

func SchafferExpanded

func SchafferExpanded(x []float64) float64

SchafferExpanded is the "Expanded Schaffer's Function" of CEC2020.

func Schwefel

func Schwefel(x []float64) float64

Schwefel is the "Shifted and Rotated Schwefel's Function" of CEC2020.

func SchwefelModified

func SchwefelModified(x []float64) float64

SchwefelModified is the "Modified Schwefel's Function" of CEC2020 with summation of g(zi) where zi = xi + 4.209687462275036e+002 and g(zi) = zi * sin(|zi|^(1/2)) ... if |zi| <= 500, g(zi) = (500-mod(zi,500)) * sin(sqrt(|500-mod(zi,500)|)) - (zi-500^2)/10000D ... if zi > 500, g(zi) = (mod(|zi|,500)-500) * sin(sqrt(|mod(|zi|,500)-500|)) - (zi-500^2)/10000D ... if zi < -500.

func Shift

func Shift(x []float64, os []float64)

Shift shifts values of x based on values of os.

func ShiftRotate

func ShiftRotate(x []float64, os []float64, mr []float64, shiftRate float64, shift, rotate bool)

ShiftRotate shifts and/or rotates the input x based on the request params shift and rotate (bool), using the values of os and/or mr.

func Weierstrass

func Weierstrass(x []float64) float64

Weierstrass is the "Weierstrass Function" of CEC2020 with a=0.5, b=3 and kmax=20.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL