5.2. pyopus.problems.glbc
— Global optimization test functions¶
Global optimization bound constrained test problems (PyOPUS subsystem name: GLBC)
Implemented by Árpád Bűrmen and Jernej Olenšek.
All test functions in this module are maps from \(R\) to \(R^n\).
Gradient is not implemented and is in some cases even impossible to implement (e.g. Quartic noisy function).
The functions can be wrapped into RandomDelay
objects to introduce a random delay in function evaluation.
The Yao et. al. set and the Hedar set have some functions in common.
The “Hump” function from the Hedar set is named “SixHump” here. Hedar’s
version of the Rosenbrock problem is obtained by setting hedar to True
.
The Yang set of test functions extends the Easom’s function to n dimensions.
The Zakharov test function is extended beyond K=2.
Yang’s version of problems is obtained by setting yang to True
.
Equality constrained function is omitted (nonlinear equality constraint).
Both stochastic functions are also omitted.
The functions were taken from [yao], [hedar], and [yang].
This module is independent of PyOPUS, meaning that it can be taken as is and used as a module in some other package. It depends only on the cpi module.
- yao
Yao X., Liu Y., Lin G.: Evolutionary programming made faster. IEEE Transactions on Evolutionary Computation, vol. 3, pp. 82-102, 1999.
- hedar
Hedar A.: Global optimization test problems. http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO.htm
- yang
Yang X.-S.: Test Problems in Optimization. arXiv preprint at http://arxiv.org/abs/1008.0549, 2010.
-
class
pyopus.problems.glbc.
Ackley
(n=30, yang=False)[source]¶ Ackley function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Beale
[source]¶ Beale function (n=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Bohachevsky
(j=1)[source]¶ Bohachevsky functions (n=2, j=1,2,3).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Booth
[source]¶ Booth function (n=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Branin
(n=2)[source]¶ Branin function (n=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Colville
[source]¶ Colville function (n=4).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
DifferentPowerSum
(n=30)[source]¶ Sum of different powers function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
DixonPrice
(n=30)[source]¶ Dixon and Price function (n>=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Easom
(n=2, yang=False)[source]¶ Easom function (n=2). The generalization for n>2 was given by Yang. n>2 assumes Yang’s version is requested.
See the
GlobalProblem
class for more information.
-
pyopus.problems.glbc.
GlobalBCsuite
= [<class 'pyopus.problems.glbc.Quadratic'>, <class 'pyopus.problems.glbc.SchwefelA'>, <class 'pyopus.problems.glbc.SchwefelB'>, <class 'pyopus.problems.glbc.SchwefelC'>, <class 'pyopus.problems.glbc.Rosenbrock'>, <class 'pyopus.problems.glbc.Step'>, <class 'pyopus.problems.glbc.QuarticNoisy'>, <class 'pyopus.problems.glbc.SchwefelD'>, <class 'pyopus.problems.glbc.Rastrigin'>, <class 'pyopus.problems.glbc.Ackley'>, <class 'pyopus.problems.glbc.Griewank'>, <class 'pyopus.problems.glbc.Penalty1'>, <class 'pyopus.problems.glbc.Penalty2'>, <class 'pyopus.problems.glbc.ShekelFoxholes'>, <class 'pyopus.problems.glbc.Kowalik'>, <class 'pyopus.problems.glbc.SixHump'>, <class 'pyopus.problems.glbc.Branin'>, <class 'pyopus.problems.glbc.GoldsteinPrice'>, <class 'pyopus.problems.glbc.Hartman'>, <class 'pyopus.problems.glbc.Shekel'>, <class 'pyopus.problems.glbc.Beale'>, <class 'pyopus.problems.glbc.Bohachevsky'>, <class 'pyopus.problems.glbc.Booth'>, <class 'pyopus.problems.glbc.Colville'>, <class 'pyopus.problems.glbc.DixonPrice'>, <class 'pyopus.problems.glbc.Easom'>, <class 'pyopus.problems.glbc.Levy'>, <class 'pyopus.problems.glbc.Matyas'>, <class 'pyopus.problems.glbc.Michalewicz'>, <class 'pyopus.problems.glbc.Perm'>, <class 'pyopus.problems.glbc.Perm0'>, <class 'pyopus.problems.glbc.Powell'>, <class 'pyopus.problems.glbc.PowerSum'>, <class 'pyopus.problems.glbc.Schwefel'>, <class 'pyopus.problems.glbc.Shubert'>, <class 'pyopus.problems.glbc.Sphere'>, <class 'pyopus.problems.glbc.SumSquares'>, <class 'pyopus.problems.glbc.Trid'>, <class 'pyopus.problems.glbc.Zakharov'>, <class 'pyopus.problems.glbc.DifferentPowerSum'>, <class 'pyopus.problems.glbc.Yang1'>, <class 'pyopus.problems.glbc.Yang2'>, <class 'pyopus.problems.glbc.Yang3'>]¶ A list holding references to all function classes in this module.
-
class
pyopus.problems.glbc.
GlobalProblem
(n)[source]¶ Base class for global optimization test functions
The full name of the problem is in the
name
member. The lower and the upper bounds are in thexl
andxh
member.The position and the function value for the best known solution are given by
xmin
andfmin
.Objects of this class are callable. The calling convention is
object(x)
where x is the input values vector. The function value at x is returned.
Most functions are variably dimensional (n can be specified as an argument to the constructor).
Example: create an instance of the Schwefel C function with n=40 and evaluate it at the origin:
from pyopus.optimizer.glbc import SchwefelC from numpy import zeros sc=SchwefelC(n=40) # Evaluate the function at the origin f=sc(zeros(40))
-
class
pyopus.problems.glbc.
GoldsteinPrice
(n=2)[source]¶ Goldstein-Price function (n=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Griewank
(n=30)[source]¶ Generalized Griewank function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Hartman
(n=3)[source]¶ Hartman function (n=3 or n=6).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Kowalik
(n=4)[source]¶ Kowalik function (n=4).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Levy
(n=30)[source]¶ Levy function (n>=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Matyas
[source]¶ Matyas function (n=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Michalewicz
(n=10)[source]¶ Michalewicz function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Penalty1
(n=30)[source]¶ Generalized penalty function 1 (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Penalty2
(n=30)[source]¶ Generalized penalty function 2 (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Perm
(n=20, beta=0.5)[source]¶ Perm function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Perm0
(n=30, beta=10, yang=False)[source]¶ Perm function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Powell
(n=32, beta=0.5)[source]¶ Powell function (n=4k, k>0).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
PowerSum
(n=4, b=None)[source]¶ Power sum function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Quadratic
(n=30)[source]¶ Quadratic function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
QuarticNoisy
(n=30)[source]¶ Quartic noisy function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Rastrigin
(n=30)[source]¶ Generalized Rastrigin function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Rosenbrock
(n=30, yang=False, hedar=False)[source]¶ Generalized Rosenbrock function (n>=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Schwefel
(n=30, yang=False)[source]¶ Schwefel function (n>=1), slightly modified SchwefelD with a general global minimum valid for arbitrary n.
Yang’s version is obtained with yang set to
True
.See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
SchwefelA
(n=30)[source]¶ Schwefel 2.22 function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
SchwefelB
(n=30)[source]¶ Schwefel 1.2 function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
SchwefelC
(n=30)[source]¶ Schwefel 2.21 function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
SchwefelD
(n=30)[source]¶ Schwefel 2.26 function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Shekel
(n=4, m=5)[source]¶ Shekel function (n=4, m=5, 7, or 10).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
ShekelFoxholes
(n=2)[source]¶ Shekel foxholes function (n=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Shubert
(m=5)[source]¶ Shubert function (n=2).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
SixHump
(n=2, yang=False)[source]¶ Six-hump camel-back function (n=2).
This function is named “Hump” in Hedar’s set of test problems.
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Sphere
(n=30)[source]¶ Sphere function (n>=1). Also known as DeJong’s sphere function.
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Step
(n=30)[source]¶ Step function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
SumSquares
(n=30, yang=False)[source]¶ Sphere function (n>=1). Also known as DeJong’s weighted sphere function.
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Trid
(n=10)[source]¶ Trid function (n>=1).
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Yang1
(n=10)[source]¶ Yang2 function (n>=1). See (21) in the corresponding paper.
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Yang2
(n=10)[source]¶ Yang2 function (n>=1). See (21) in the corresponding paper.
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Yang3
(n=10)[source]¶ Yang2 function (n>=1). See (24) in the corresponding paper.
See the
GlobalProblem
class for more information.
-
class
pyopus.problems.glbc.
Zakharov
(n=10, K=2)[source]¶ Zakharov function (n>=1).
See the
GlobalProblem
class for more information.
Example file glbc.py in folder demo/problems/
# Global optimization problems
from pyopus.problems.glbc import GlobalBCsuite
if __name__=='__main__':
print("Global optimization problems (bound constrained, initial point at 1/4 range)")
for ii in range(len(GlobalBCsuite)):
prob=GlobalBCsuite[ii]()
x0=prob.xl*0.25+prob.xh*0.75
print("%2d: %40s n=%2d: f0=%e" % (ii, prob.name, prob.n, prob(x0)))
print()