diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..dd4360d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "magicstack.magicpython" + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..46d4532 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,19 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + + + { + "name": "Python: Current File", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "cwd": "${fileDirname}" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7dc6613 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "python.pythonPath": "/usr/bin/python3.8", + "python.testing.pytestArgs": [ + "Sample codes" + ], + "python.testing.unittestEnabled": false, + "python.testing.nosetestsEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/SourceCode/AlgorithmAnalyser.py b/SourceCode/AlgorithmAnalyser.py index a05ff87..3f61813 100644 --- a/SourceCode/AlgorithmAnalyser.py +++ b/SourceCode/AlgorithmAnalyser.py @@ -20,6 +20,8 @@ from scipy import signal, misc, ndimage + + def measure(heuristicpath, heuristic_name, funcpath, funcname, objs, args, scale, connection): ''' This function runs each optimization process of the heuristic with one test function @@ -126,8 +128,8 @@ def representfunc(funcpath): # Valleys and Bassins # Alternative filter used for calculating derivatives - derfilt = array([1.0, -2, 1.0], dtype=float32) - alpha = signal.sepfir2d(ck, derfilt, [1]) + signal.sepfir2d(ck, [1], derfilt) + #derfilt = array([1.0, -2, 1.0], dtype=float32) + #alpha = signal.sepfir2d(ck, derfilt, [1]) + signal.sepfir2d(ck, [1], derfilt) # Currently used filter for Valley detection hor = array([[0,1,1],[-1,0,1], [-1,-1,0]]) @@ -169,16 +171,16 @@ def representfunc(funcpath): # Noisyness: use the previously generated DOE and calculate a noisyness factor; average of derivative # Displaying the plots for development purposes - img1 = plt.figure() - ax2 = img1.add_subplot(111) - ax2.imshow(alpha) + #img1 = plt.figure() + #ax2 = img1.add_subplot(111) + #ax2.imshow(alpha) img2 = plt.figure() ax3 = img2.add_subplot(111) ax3.imshow(beta) plt.show() - + print("should be plotted") # Writing the calculated representation into the test function file # results['Represented'] = True @@ -242,7 +244,9 @@ if __name__ == '__main__': args = {"high": 200, "low": -200, "t": 1000, "p": 0.95} scale = 1 - doe (heuristicpath, heuristic_name, testfunctionpaths, funcnames, objs, args, scale) + #doe (heuristicpath, heuristic_name, testfunctionpaths, funcnames, objs, args, scale) - #representfunc("/home/remi/Documents/MDAF-GitLAB/SourceCode/TestFunctions/Bukin6.py") + representfunc("TestFunctions/Bukin6.py") + +# %% diff --git a/SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-38.pyc b/SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-38.pyc new file mode 100644 index 0000000..8c9b131 Binary files /dev/null and b/SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-38.pyc differ diff --git a/SourceCode/TestFunctions/Bukin6.py b/SourceCode/TestFunctions/Bukin6.py index 1f9d71a..c99cc2b 100644 --- a/SourceCode/TestFunctions/Bukin6.py +++ b/SourceCode/TestFunctions/Bukin6.py @@ -59,6 +59,30 @@ def main(args): #_# dimmensions: 2.0 + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + #_# dimmensions: 2.0 #_# Valleys: True ''' diff --git a/SourceCode/TestFunctions/Bukin6.py.old b/SourceCode/TestFunctions/Bukin6.py.old new file mode 100644 index 0000000..741ad14 --- /dev/null +++ b/SourceCode/TestFunctions/Bukin6.py.old @@ -0,0 +1,86 @@ +from math import sqrt, fabs + + +def main(args): + ''' + #_# dimmensions: 2 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + + #_# dimmensions: 2.0 + #_# Valleys: True + ''' + return 100*sqrt(fabs(args[1]-0.01*args[0]**2))+0.01*fabs(args[0]+10) diff --git a/SourceCode/TestFunctions/__pycache__/Brown.cpython-38.pyc b/SourceCode/TestFunctions/__pycache__/Brown.cpython-38.pyc new file mode 100644 index 0000000..03a71f8 Binary files /dev/null and b/SourceCode/TestFunctions/__pycache__/Brown.cpython-38.pyc differ diff --git a/SourceCode/TestFunctions/__pycache__/Bukin2.cpython-38.pyc b/SourceCode/TestFunctions/__pycache__/Bukin2.cpython-38.pyc new file mode 100644 index 0000000..0321d4b Binary files /dev/null and b/SourceCode/TestFunctions/__pycache__/Bukin2.cpython-38.pyc differ diff --git a/SourceCode/TestFunctions/__pycache__/Bukin4.cpython-38.pyc b/SourceCode/TestFunctions/__pycache__/Bukin4.cpython-38.pyc new file mode 100644 index 0000000..29d78e7 Binary files /dev/null and b/SourceCode/TestFunctions/__pycache__/Bukin4.cpython-38.pyc differ diff --git a/SourceCode/TestFunctions/__pycache__/Bukin6.cpython-38.pyc b/SourceCode/TestFunctions/__pycache__/Bukin6.cpython-38.pyc new file mode 100644 index 0000000..66e72d1 Binary files /dev/null and b/SourceCode/TestFunctions/__pycache__/Bukin6.cpython-38.pyc differ