-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
#!/usr/bin/env python | ||
# ------------------------------------------------------------------------------------------------------% | ||
# Created by "Thieu Nguyen" at 14:37, 20/09/2020 % | ||
# Created by "Thieu Nguyen" at 11:19, 22/09/2020 % | ||
# % | ||
# Email: [email protected] % | ||
# Homepage: https://www.researchgate.net/profile/Thieu_Nguyen6 % | ||
# Github: https://github.com/thieunguyen5991 % | ||
#-------------------------------------------------------------------------------------------------------% | ||
# -------------------------------------------------------------------------------------------------------% | ||
|
||
from opfunu.cec.cec2020.constant import benchmark_function as BF | ||
from opfunu.cec.cec2020 import engineering | ||
from numpy.random import uniform | ||
|
||
for i in range(1, 26): | ||
out = BF(i) # Get object contain information about problems | ||
out = BF(i) # Get object contain information about problems | ||
D, g, h, xmin, xmax = out["D"], out["g"], out["h"], out["xmin"], out["xmax"] | ||
|
||
solution = uniform(xmin, xmax) ## Create solution based on information above | ||
problem = "p" + str(i) ## Choice the problem | ||
fx, gx, hx = getattr(engineering, problem)(solution) ## Fitness function, constraint | ||
solution = uniform(xmin, xmax) ## Create solution based on information above | ||
problem = "p" + str(i) ## Choice the problem | ||
fx, gx, hx = getattr(engineering, problem)(solution) ## Fitness function, constraint | ||
print("\n==============" + problem + "=================") | ||
print("fx:", fx) | ||
print("gx:", gx) | ||
print("hx:", hx) | ||
print("hx:", hx) | ||
|