added more fumctions for testing

This commit is contained in:
Remi Ehounou
2021-04-05 00:46:44 -04:00
parent 46c3d76ef3
commit 5d6490f734
4 changed files with 12 additions and 5 deletions

View File

@ -11,11 +11,11 @@ r.seed(int(time.time()))
heuristicpath = "/home/remi/Documents/MDAF-GitLAB/SourceCode/SampleAlgorithms/SimmulatedAnnealing.py"
heuristic_name = "SimmulatedAnnealing"
testfunctionpaths = ["/home/remi/Documents/MDAF-GitLAB/SourceCode/TestFunctions/Bukin2.py"]
funcnames = ["Bukin2"]
testfunctionpaths = ["/home/remi/Documents/MDAF-GitLAB/SourceCode/TestFunctions/Bukin2.py", "/home/remi/Documents/MDAF-GitLAB/SourceCode/TestFunctions/Bukin4.py", "/home/remi/Documents/MDAF-GitLAB/SourceCode/TestFunctions/Bukin6.py"]
funcnames = ["Bukin2", "Bukin4", "Bukin6"]
objs = 0
args = {"high": 200, "low": -200, "t": 100, "p": 0.8}
scale = 3
args = {"high": 200, "low": -200, "t": 100, "p": 0.95}
scale = 2.5
def doe(heuristicpath, heuristic_name, testfunctionpaths, funcnames, objs, args, scale):

View File

@ -72,7 +72,7 @@ def main(func, obj, S, args, connection):
route.append(Best[:])
print(route)
if t < 0 or Quality(Best,y,func) > 1000:
if t < 0 or Quality(Best,y,func) > 50:
break
#print('the Best Quality obtained was:{}'.format(Quality(Best,y)))
print("Final Quality is: {}".format(Quality(Best,y,func)))

View File

@ -0,0 +1,2 @@
def main(args):
return 100*args[1]**2+0.01*abs(args[0]+10)

View File

@ -0,0 +1,5 @@
from math import sqrt, fabs
def main(args):
return 100*sqrt(fabs(args[1]-0.01*args[0]**2))+0.01*fabs(args[0]+10)