bench

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: 2 Imported by: 0

Documentation

Overview

Package bench provides implementations of functions used for benchmarking.

Index

Constants

View Source
const (
	// Neighbourhood is the number of neighbouring values that are to be
	// generated as part of e.g. Stochastic Hill Climbing algo.
	Neighbourhood = 10
	// MaxNeighbourVariancePercent covers an arbitrary task requirement: pick
	// neighbours from max n percent of search space.
	MaxNeighbourVariancePercent = 10
	// MaxFES is the maximum number of allowed function evaluations.
	MaxFES = 10000
)

Variables

View Source
var (
	// Dimensions to compute for (spatial complexity..?).
	Dimensions = []int{5, 10, 20}

	// DimensionsGA are used with Genetic Algorithms (such as DE, see algo/de).
	DimensionsGA = []int{10, 30}

	// SchwefelParams is a struct holding the min, max allowed value of inputs
	// passed to the Schwefel function.
	SchwefelParams = funcParams{/* contains filtered or unexported fields */}
	// DeJong1Params is a struct holding the min, max allowed value of inputs
	// passed to the De Jong 1st function.
	DeJong1Params = funcParams{/* contains filtered or unexported fields */}
	// DeJong2Params is a struct holding the min, max allowed value of inputs
	// passed to the De Jong 2nd function.
	DeJong2Params = funcParams{/* contains filtered or unexported fields */}
	// RastriginParams is a struct holding the min, max allowed value of inputs
	// passed to the Rastrigin function.
	RastriginParams = funcParams{/* contains filtered or unexported fields */}
)
View Source
var FuncNames = map[int]string{
	0: "Schwefel",
	1: "De Jong 1st",
	2: "De Jong 2nd",
	3: "Rastrigin",
}

FuncNames represents a numbered list of function name.

View Source
var FunctionParams = map[string]funcParams{
	"Schwefel":    SchwefelParams,
	"De Jong 1st": DeJong1Params,
	"De Jong 2nd": DeJong2Params,
	"Rastrigin":   RastriginParams,
}

Function params maps function names to their funcParams for easier iterable access.

View Source
var Functions = map[string]func([]float64) float64{
	"Schwefel":    Schwefel,
	"De Jong 1st": DeJong1st,
	"De Jong 2nd": DeJong2nd,
	"Rastrigin":   Rastrigin,
}

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

Functions

func DeJong1st

func DeJong1st(x []float64) float64

DeJong1st computes the value of the 1st De Jong function for x.

func DeJong2nd

func DeJong2nd(x []float64) float64

DeJong2nd computes the value of the 2nd De Jong function for x.

func GetGAMaxFES

func GetGAMaxFES(dim int) int

GetGAMaxFES calculates the value of MaxFES for Genetic Algorithms. This is an arbitrary specification where MaxFES is 5000xD.

func NewfuncParams

func NewfuncParams(min, max float64) *funcParams

NewfuncParams returns a pointer to a fresh instance of funcParams. nolint: revive

func Rastrigin

func Rastrigin(x []float64) float64

Rastrigin computes the value of the Rastrigin function for x. ref: https://www.sfu.ca/~ssurjano/rastr.html

func Schwefel

func Schwefel(x []float64) float64

Schwefel computes the value of the Schwefel function for x.

Types

This section is empty.

Directories

Path Synopsis
Package cec2020 implements functions of the CEC2020 Testbed.
Package cec2020 implements functions of the CEC2020 Testbed.

Jump to

Keyboard shortcuts

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