From 43de559f086557a6cc111debffe94e5d75237262 Mon Sep 17 00:00:00 2001 From: Remi Ehounou Date: Sun, 23 May 2021 16:45:16 -0400 Subject: [PATCH] Reorganised the code into a PyPI package format --- .gitignore | 1 + LICENSE => PackageCode/LICENSE | 0 .../MDAF/MDAF.py | 114 ++++++++++-------- .../SampleAlgorithms/SimmulatedAnnealing.py | 10 +- .../SimmulatedAnnealing.cpython-39.pyc | Bin 0 -> 2100 bytes .../Untitled-checkpoint.ipynb | 0 PackageCode/MDAF/TestFunctions/Brown.py | 33 +++++ .../MDAF}/TestFunctions/Bukin2.py | 0 PackageCode/MDAF/TestFunctions/Bukin4.py | 28 +++++ .../MDAF}/TestFunctions/Bukin6.py | 3 + .../MDAF}/TestFunctions/Keane.py | 0 .../MDAF}/TestFunctions/Leon.py | 0 .../MDAF}/TestFunctions/Matyas.py | 0 .../MDAF}/TestFunctions/McCormick.py | 0 .../MDAF}/TestFunctions/Miele_Cantrell.py | 0 .../MDAF}/TestFunctions/Untitled.ipynb | 0 .../__pycache__/Brown.cpython-39.pyc | Bin 0 -> 469 bytes .../__pycache__/Bukin2.cpython-39.pyc | Bin .../__pycache__/Bukin4.cpython-39.pyc | Bin 0 -> 5736 bytes .../__pycache__/Bukin6.cpython-39.pyc | Bin PackageCode/MDAF/__init__.py | 0 .../MDAF/__pycache__/__init__.cpython-39.pyc | Bin 0 -> 156 bytes PackageCode/README.md | 2 + PackageCode/pyproject.toml | 3 + PackageCode/setup.cfg | 26 ++++ .../Rémi Ehounou_Rapport_Integre.docx | Bin .../Analyse_folders_and_description.ipynb | 0 {SourceCode => Sample codes}/Testingground.py | 0 {SourceCode => Sample codes}/calcFeatures.R | 0 .../SimmulatedAnnealing.cpython-38.pyc | Bin 2063 -> 0 bytes .../SimmulatedAnnealing.cpython-39.pyc | Bin 2059 -> 0 bytes SourceCode/StatProcedures/placeholder | 1 - SourceCode/TestFunctions/Brown.py | 10 -- SourceCode/TestFunctions/Bukin4.py | 7 -- SourceCode/TestFunctions/Bukin6.py.old | 89 -------------- .../__pycache__/Brown.cpython-38.pyc | Bin 382 -> 0 bytes .../__pycache__/Brown.cpython-39.pyc | Bin 426 -> 0 bytes .../__pycache__/Bukin2.cpython-38.pyc | Bin 619 -> 0 bytes .../__pycache__/Bukin4.cpython-38.pyc | Bin 332 -> 0 bytes .../__pycache__/Bukin4.cpython-39.pyc | Bin 376 -> 0 bytes .../__pycache__/Bukin6.cpython-38.pyc | Bin 1417 -> 0 bytes .../AlgorithmAnalyser.cpython-39.pyc | Bin 2968 -> 0 bytes work.py | 13 ++ 43 files changed, 181 insertions(+), 159 deletions(-) rename LICENSE => PackageCode/LICENSE (100%) rename SourceCode/AlgorithmAnalyser.py => PackageCode/MDAF/MDAF.py (71%) rename {SourceCode => PackageCode/MDAF}/SampleAlgorithms/SimmulatedAnnealing.py (93%) create mode 100644 PackageCode/MDAF/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-39.pyc rename {SourceCode => PackageCode/MDAF}/TestFunctions/.ipynb_checkpoints/Untitled-checkpoint.ipynb (100%) create mode 100644 PackageCode/MDAF/TestFunctions/Brown.py rename {SourceCode => PackageCode/MDAF}/TestFunctions/Bukin2.py (100%) create mode 100644 PackageCode/MDAF/TestFunctions/Bukin4.py rename {SourceCode => PackageCode/MDAF}/TestFunctions/Bukin6.py (71%) rename {SourceCode => PackageCode/MDAF}/TestFunctions/Keane.py (100%) rename {SourceCode => PackageCode/MDAF}/TestFunctions/Leon.py (100%) rename {SourceCode => PackageCode/MDAF}/TestFunctions/Matyas.py (100%) rename {SourceCode => PackageCode/MDAF}/TestFunctions/McCormick.py (100%) rename {SourceCode => PackageCode/MDAF}/TestFunctions/Miele_Cantrell.py (100%) rename {SourceCode => PackageCode/MDAF}/TestFunctions/Untitled.ipynb (100%) create mode 100644 PackageCode/MDAF/TestFunctions/__pycache__/Brown.cpython-39.pyc rename {SourceCode => PackageCode/MDAF}/TestFunctions/__pycache__/Bukin2.cpython-39.pyc (100%) create mode 100644 PackageCode/MDAF/TestFunctions/__pycache__/Bukin4.cpython-39.pyc rename {SourceCode => PackageCode/MDAF}/TestFunctions/__pycache__/Bukin6.cpython-39.pyc (100%) create mode 100644 PackageCode/MDAF/__init__.py create mode 100644 PackageCode/MDAF/__pycache__/__init__.cpython-39.pyc create mode 100644 PackageCode/README.md create mode 100644 PackageCode/pyproject.toml create mode 100644 PackageCode/setup.cfg rename Rémi Ehounou_Rapport_Integre.docx => References/Rémi Ehounou_Rapport_Integre.docx (100%) rename {SourceCode => Sample codes}/Analyse_folders_and_description.ipynb (100%) rename {SourceCode => Sample codes}/Testingground.py (100%) rename {SourceCode => Sample codes}/calcFeatures.R (100%) delete mode 100644 SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-38.pyc delete mode 100644 SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-39.pyc delete mode 100644 SourceCode/StatProcedures/placeholder delete mode 100644 SourceCode/TestFunctions/Brown.py delete mode 100644 SourceCode/TestFunctions/Bukin4.py delete mode 100644 SourceCode/TestFunctions/Bukin6.py.old delete mode 100644 SourceCode/TestFunctions/__pycache__/Brown.cpython-38.pyc delete mode 100644 SourceCode/TestFunctions/__pycache__/Brown.cpython-39.pyc delete mode 100644 SourceCode/TestFunctions/__pycache__/Bukin2.cpython-38.pyc delete mode 100644 SourceCode/TestFunctions/__pycache__/Bukin4.cpython-38.pyc delete mode 100644 SourceCode/TestFunctions/__pycache__/Bukin4.cpython-39.pyc delete mode 100644 SourceCode/TestFunctions/__pycache__/Bukin6.cpython-38.pyc delete mode 100644 SourceCode/__pycache__/AlgorithmAnalyser.cpython-39.pyc create mode 100644 work.py diff --git a/.gitignore b/.gitignore index 4d11aec..c75ae86 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ pkg/ src/ snippets/ +PackageCode/setup.py diff --git a/LICENSE b/PackageCode/LICENSE similarity index 100% rename from LICENSE rename to PackageCode/LICENSE diff --git a/SourceCode/AlgorithmAnalyser.py b/PackageCode/MDAF/MDAF.py similarity index 71% rename from SourceCode/AlgorithmAnalyser.py rename to PackageCode/MDAF/MDAF.py index d0b4f78..3195e59 100644 --- a/SourceCode/AlgorithmAnalyser.py +++ b/PackageCode/MDAF/MDAF.py @@ -42,7 +42,7 @@ class counter: self.count += 1 return self.func(*args, **kwargs) -def simulate(algName, algPath, funcname, funcpath, objs, args, initpoint): +def simulate(algName, algPath, funcname, funcpath, args, initpoint): # loading the heuristic object into the namespace and memory spec = importlib.util.spec_from_file_location(algName, algPath) heuristic = importlib.util.module_from_spec(spec) @@ -63,7 +63,7 @@ def simulate(algName, algPath, funcname, funcpath, objs, args, initpoint): #This timer calculates directly the CPU time of the process (Nanoseconds) tic = time.process_time_ns() # running the test by calling the heuritic script with the test function as argument - quality = heuristic.main(testfunc, objs, initpoint, args) + quality = heuristic.main(testfunc, initpoint, args) toc = time.process_time_ns() # ^^ The timer ends right above this; the CPU time is then calculated below by simple difference ^^ @@ -78,34 +78,61 @@ def simulate(algName, algPath, funcname, funcpath, objs, args, initpoint): converged = 0 return cpuTime, quality, numCalls, converged -def measure(heuristicpath, heuristic_name, funcpath, funcname, objs, args, scale, connection): +def measure(heuristicpath, funcpath, args, connection): ''' - This function runs each optimization process of the heuristic with one test function + This function runs a set of optimization flows for each test function. it returns the mean and standard deviation of the performance results ''' + #defining the heuristic's name + heuristic_name = path.splitext(path.basename(heuristicpath))[0] + + #defining the test function's name + funcname = path.splitext(path.basename(funcpath))[0] + # Seeding the random module for generating the initial point of the optimizer: Utilising random starting point for experimental validity r.seed(int(time.time())) + # guetting the representation of the function + funcChars = representfunc(funcpath) + + n = funcChars['dimmensions'] + upper = funcChars['upper'] + lower = funcChars['lower'] + + if upper is not list: upper = [upper for i in range(n)] + if lower is not list: lower = [lower for i in range(n)] + + + scale = list() + for i in range(n): + scale.append(upper[i] - lower[i]) + # Defining random initial points to start testing the algorithms - initpoints = [[r.random() * scale, r.random() * scale] for run in range(30)] #update the inner as [r.random() * scale for i in range(testfuncDimmensions)] + initpoints = [[r.random() * scale[i] + lower[i] for i in range(n)] for run in range(30)] #update the inner as [r.random() * scale for i in range(testfuncDimmensions)] # building the iterable arguments - partfunc = partial(simulate, heuristic_name, heuristicpath, funcname, funcpath, objs, args) - - with multiprocessing.Pool(processes = 3) as pool: + partfunc = partial(simulate, heuristic_name, heuristicpath, funcname, funcpath, args) + + n_proc = multiprocessing.cpu_count() # Guetting the number of cpus + with multiprocessing.Pool(processes = n_proc) as pool: # running the simulations newRun = pool.map(partfunc,initpoints) - cpuTime = [resl[0] for resl in newRun] - quality = [resl[1] for resl in newRun] - numCalls = [resl[2] for resl in newRun] - converged = [resl[3] for resl in newRun] + cpuTime = array([resl[0] for resl in newRun]) + quality = array([resl[1] for resl in newRun]) + numCalls = array([resl[2] for resl in newRun]) + converged = array([resl[3] for resl in newRun]) + + cpuTime = cpuTime[~(isnan(cpuTime))] + quality = quality[~(isnan(quality))] + numCalls = numCalls[~(isnan(numCalls))] + converged = converged[~(isnan(converged))] results = dict() - results['cpuTime'] = array([statistics.mean(cpuTime), statistics.stdev(cpuTime)]) - results['quality'] = array([statistics.mean(quality), statistics.stdev(quality)]) - results['numCalls'] = array([statistics.mean(numCalls), statistics.stdev(numCalls)]) - results['convRate'] = array([statistics.mean(converged), statistics.stdev(converged)]) + results['cpuTime'] = array([statistics.fmean(cpuTime), statistics.stdev(cpuTime)]) + results['quality'] = array([statistics.fmean(quality), statistics.stdev(quality)]) + results['numCalls'] = array([statistics.fmean(numCalls), statistics.stdev(numCalls)]) + results['convRate'] = array([statistics.fmean(converged), statistics.stdev(converged)]) connection.send((results,newRun)) @@ -133,7 +160,7 @@ def writerepresentation(funcpath, charas): with open(funcpath,"w") as file: file.write(newContent) -def representfunc(funcpath): +def representfunc(funcpath, forced = False): #defining the function name funcname = path.splitext(path.basename(funcpath))[0] # loading the function to be represented @@ -153,6 +180,8 @@ def representfunc(funcpath): if not ('Represented' in results): print("Warning, the Representation of the Test Function has not been specified\n===\n******Calculating the Characteristics******") n = int(results['dimmensions']) + blocks = int(1+10/n) + if blocks< 3: blocks=3 # Importing FLACCO using rpy2 flacco = importr('flacco') @@ -164,12 +193,17 @@ def representfunc(funcpath): r_unlist = robjs.r['unlist'] rtestfunc = rinterface.rternalize(funcmodule.main) - ### - lower = r_unlist(rvector(results['lower'])) - upper = r_unlist(rvector(results['upper'])) - X = flacco.createInitialSample(n_obs = 500, dim = n, control = rlist(**{'init_sample.type' : 'lhs', 'init_sample.lower' : lower, 'init_sample.upper' : upper})) + # Verify if a list of limits has been specified for all dimensions or if all dimensions will use the same boundaries + if (type(results['lower']) is list): + lowerval = r_unlist(rvector(results['lower'])) + upperval = r_unlist(rvector(results['upper'])) + else: + lowerval = results['lower'] + upperval = results['upper'] + + X = flacco.createInitialSample(n_obs = 500, dim = n, control = rlist(**{'init_sample.type' : 'lhs', 'init_sample.lower' : lowerval, 'init_sample.upper' : upperval})) y = rapply(X, 1, rtestfunc) - testfuncobj = flacco.createFeatureObject(X = X, y = y, fun = rtestfunc, lower = lower, upper = upper, blocks = 10) + testfuncobj = flacco.createFeatureObject(**{'X': X, 'y': y, 'fun': rtestfunc, 'lower': lowerval, 'upper': upperval, 'blocks': blocks, 'force': forced}) # these are the retained features. Note that some features are being excluded for being problematic and to avoid overcomplicating the neural network.... the feature sets are redundant and the most relevant ones have been retained # the excluded feature sets are: 'bt', 'ela_level' @@ -186,7 +220,13 @@ def representfunc(funcpath): -def doe(heuristicpath, heuristic_name, testfunctionpaths, funcnames, objs, args, scale): +def doe(heuristicpath, testfunctionpaths, args): + + #defining the function's name + funcnames = [path.splitext(path.basename(funcpath))[0] for funcpath in testfunctionpaths] + + #defining the heuristic's name + heuristic_name = path.splitext(path.basename(heuristicpath))[0] # logic variables to deal with the processes proc = [] @@ -197,20 +237,18 @@ def doe(heuristicpath, heuristic_name, testfunctionpaths, funcnames, objs, args, funcname = funcnames[idx] # Creating the connection objects for communication between the heuristic and this module connections[funcname] = multiprocessing.Pipe(duplex=False) - proc.append(multiprocessing.Process(target=measure, name=funcname, args=(heuristicpath, heuristic_name, funcpath, funcname, objs, args, scale, connections[funcname][1]))) + proc.append(multiprocessing.Process(target=measure, name=funcname, args=(heuristicpath, funcpath, args, connections[funcname][1]))) # defining the response variables responses = {} failedfunctions = {} processtiming = {} - # defining some logic variables - + # Starting the subprocesses for each testfunction for idx,process in enumerate(proc): process.start() - # Waiting for all the runs to be - # multiprocessing.connection.wait([process.sentinel for process in proc]) + # Waiting for all the runs to be done for process in proc: process.join() for process in proc: @@ -227,26 +265,8 @@ def doe(heuristicpath, heuristic_name, testfunctionpaths, funcnames, objs, args, print("\n\n||||| Responses: [mean,stdDev] |||||") for process in proc: print(process.name + "____\n" + str(responses[process.name][0]) + "\n_________________") - #return output + #return the performance values return responses -if __name__ == '__main__': - heuristicpath = "SampleAlgorithms/SimmulatedAnnealing.py" - heuristic_name = "SimmulatedAnnealing" - testfunctionpaths = ["TestFunctions/Bukin2.py", "TestFunctions/Bukin4.py", "TestFunctions/Brown.py"] - funcnames = ["Bukin2", "Bukin4", "Brown"] - # testfunctionpaths = ["/home/remi/Documents/MDAF-GitLAB/SourceCode/TestFunctions/Bukin4.py"] - # funcnames = ["Bukin4"] - - - - objs = 0 - args = {"high": 200, "low": -200, "t": 1000, "p": 0.95} - scale = 1 - - # data = doe (heuristicpath, heuristic_name, testfunctionpaths, funcnames, objs, args, scale) - # print([point[2] for point in data['Bukin2'][1]]) - representfunc("TestFunctions/Bukin2.py") - # %% diff --git a/SourceCode/SampleAlgorithms/SimmulatedAnnealing.py b/PackageCode/MDAF/SampleAlgorithms/SimmulatedAnnealing.py similarity index 93% rename from SourceCode/SampleAlgorithms/SimmulatedAnnealing.py rename to PackageCode/MDAF/SampleAlgorithms/SimmulatedAnnealing.py index 90cf488..9756f56 100644 --- a/SourceCode/SampleAlgorithms/SimmulatedAnnealing.py +++ b/PackageCode/MDAF/SampleAlgorithms/SimmulatedAnnealing.py @@ -31,15 +31,15 @@ def Quality(Sc,objective,func): print("Error is: "+str(error)) return 1/abs(error) -def main(func, obj, S, args): +def main(func, S, args): r.seed(int(time.time())) route = list() #Parsing arguments - y = obj - high = args["high"] - low = args["low"] + y = args["objs"] t = args["t"] p = args["p"] + high = 20 + low = -20 Best = list() Best[:] = cp.deepcopy(S) @@ -47,7 +47,7 @@ def main(func, obj, S, args): route.append(Best[:]) while True: print('\n\n\n') - R = tweak(cp.deepcopy(S),p,sigma,high,low) + R = tweak(cp.deepcopy(S),p,sigma,high, low) print(R) print(S) Qr = Quality(R,y,func) diff --git a/PackageCode/MDAF/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-39.pyc b/PackageCode/MDAF/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e9c2a205b4bbdf281a3226513153e49bc26c394 GIT binary patch literal 2100 zcmZuy&2JM&6rb5IukE$-K?(^$$m*%C+8EJFt*R6n2%t(d0!)jrgu>$4I7{}!nH?7; ztWTyQJyfE{_LSV<(o0YM5BMAAR`nFAH!f8#^!L^#0jaZ^dGkK!&71e$`n6hxVO;+G z`Tb3ovA+m;dl*2z!p!bt5lrxib$9`djtOW)Mr?I#KISkr*o$7?| zb!x&A_7m2r3rCayr-UoYfYXAvS+jD8Q`lOQYe)KtNMr0uaX(7cC!%W;Z!$`NgkQ$Y z1Qx{<&)JBN_$s@1YiQ?O8T;k|+p?smjE9!sxgm_7jG>d8Im_(@mOH12dnUKu!WnRI zZASdhn8}vewzqv|+shf;GuI@?SxrNmQQFmZ*7c*HX=@wK_5u)tL~|)AX4*+o8T(PQ z)G^vh^FE}*UhHdYGwf}W{v*vp&65{QPDB3Rc55?@gO&{9u(g_Y2XT<7to6<6%GHmr zh3fjsrB*u~$Zl{s6+x@*BPhX2)JtWkHsh?-4&!(b`6>`ANfP)`nDmzVJK9!{0)J}? z_Om(`#;3Vw)OiEY;c^y~u1WOCumEWiE&C2jZct2rM0EE672h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Nhkd+#%E7C&7_eWGoj-nMuIp1CGm`sC65U6 zqwZmpyd(@HOcN;42sD^C2X480>t6Rh8L>7&g_d8EVaLtYIb7EB+UnpUD?VUa>KHJE zb!$=hz?M<@g9@+^P(CcRrI941qxVp9G{R%!b_}wGGhvNw!;|??lC`F@2Nw)--hn*$ z+V-&}e^>%!EzX|np?9LMW${2bj8w!b7yh*+n(d1+XzTX;;dYPS#u@G(=o3Y!vRF#L z8v_}3Wu>#Jf`7WOFGs9!3(KjtHotV|Gs8n2KEFSBFgg9=^E-zR=c~o2xjP>>hu<{I)BCI0=rp~5J-oAeHklc5 w^8D4M>2NYjn=jMm)q9Jy;a4{f)_>RguwPej@73jxr}OdZxcMZl`U{`xAAf~be*gdg literal 0 HcmV?d00001 diff --git a/SourceCode/TestFunctions/__pycache__/Bukin6.cpython-39.pyc b/PackageCode/MDAF/TestFunctions/__pycache__/Bukin6.cpython-39.pyc similarity index 100% rename from SourceCode/TestFunctions/__pycache__/Bukin6.cpython-39.pyc rename to PackageCode/MDAF/TestFunctions/__pycache__/Bukin6.cpython-39.pyc diff --git a/PackageCode/MDAF/__init__.py b/PackageCode/MDAF/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/PackageCode/MDAF/__pycache__/__init__.cpython-39.pyc b/PackageCode/MDAF/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a31932afa6b9c53e379d8e5655ce653ea5ba283 GIT binary patch literal 156 zcmYe~<>g`kf=hQ+CV=S2AOaaM0yz#qT+9L_QW%06G#UL?G8BP?5yUS?{fzwFRQ;mV z+)RC!{N&Qy)Vz{neP0(xH(mG45+6q={owr4qU2QP{FGF%FocMY&&=42", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/PackageCode/setup.cfg b/PackageCode/setup.cfg new file mode 100644 index 0000000..a260fa9 --- /dev/null +++ b/PackageCode/setup.cfg @@ -0,0 +1,26 @@ +[metadata] +name = MDAF +version = 0.1 +description =A Framework for the Analysis and Benchmarking of Metaheuristics +url = https://git.rehounou.ca/remi/MDAF +author = Remi Ehounou +author_email = remi.ehounou@outlook.com +license = MIT +long_description = file: README.md +long_description_content_type = text/markdown +classifiers = + Programming Language :: Python :: 3 + License :: OSI Approved :: MIT License + Operating System :: OS Independent + + +[options] +package_dir = + = . +include_package_data = True +packages = find: +python_requires = >=3.6 +install_requires = + numpy + importlib + rpy2 == 3.4.4 diff --git a/Rémi Ehounou_Rapport_Integre.docx b/References/Rémi Ehounou_Rapport_Integre.docx similarity index 100% rename from Rémi Ehounou_Rapport_Integre.docx rename to References/Rémi Ehounou_Rapport_Integre.docx diff --git a/SourceCode/Analyse_folders_and_description.ipynb b/Sample codes/Analyse_folders_and_description.ipynb similarity index 100% rename from SourceCode/Analyse_folders_and_description.ipynb rename to Sample codes/Analyse_folders_and_description.ipynb diff --git a/SourceCode/Testingground.py b/Sample codes/Testingground.py similarity index 100% rename from SourceCode/Testingground.py rename to Sample codes/Testingground.py diff --git a/SourceCode/calcFeatures.R b/Sample codes/calcFeatures.R similarity index 100% rename from SourceCode/calcFeatures.R rename to Sample codes/calcFeatures.R diff --git a/SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-38.pyc b/SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-38.pyc deleted file mode 100644 index adf81c687a0575ad02bc1df7a5d9c80fcefab5c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2063 zcmZt{O>Y}TbY}L$>-E}B(vT)i0SgI`IW(voKq#~nC?67v+PbB5r7GQeHqIvdmDw>> z((%bf4F{xhgp+fugt+q``U~cU;F7<9IPl)sNs7d*X5PHddGF18vv-^%-Qa@{ijTt`(o80Ek z6B4$#%WDAJ+~akCbDZ`_*FT0+$VQiHS4254GT7C!GA-nLyzd}yHfjJ7{}g7$VUa{q zMaFbYKO^^VjT}WKn^;F=*A{_fJ2t0^arPq{xyn*RIV(iD=aG9+*)QP)aNs%w`R@~p ztdqT9@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=)0;3Gfgw^wW Gul_G}g4I+2 diff --git a/SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-39.pyc b/SourceCode/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-39.pyc deleted file mode 100644 index 4300cc8daece49ef4bb77f0dbf0f4b5a75fe815a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2059 zcmZuy&2Jk;6rY*>@Or&=J{r=bsVc*P$~`nydjO%(QlNZDC~E6MRZCU6^=_O^cGu4A zm@4V`f{PjsNaYBpv>6L|#+{oQ-&!wfxsOg{`-^ab=iC{S3QGHc0#GTGVxjHysr~!au<* zA}oq2uGyH6`KRpR-I1fY5{K3i+p%S!#I_xAEh6!w7`fWgOgqa=yJv}eUfXZr3^=$B zBmR5LVry(S*gd}+Xa@JJb;)s7OBgHdca2kY!!&L=#(}fF7{oX?TuREBar3^+!n9TC zh_*6(0O_Qcg~r}WdRwIb#PG!M{3VmKkpKH)J4B%I&9v8-iQ3AF)pn9)!!%TJbTiN6 zFirB_<-wkD)RQ>enSoBxz{2<}4@84E0bMTVLFrmVpAH+4Ceey-uxLSf`T-d`091TO z$g9uUbG|7e9*Jk363QYDWpd0%R=#w=4)_uqS;~$qFT)_MOYA4HYquvEDARz{ipy6d1@=;OYMaBnyU`!2 z!BClM|M7O*Rmrz;DJkb5WBj!=DO9(g4X)E6e_^uyl{-UZOYL1=!!3nraUGjuseS*J zlzrJuiVvEv%gd}7TkQ>EW0Q<@VL(!K8D}7qTp0^QV}*~4mW`Y2%D0GTlViq-$<)M~ z1=1^Bs!UH`2BiqFFz)eyUl1N{NH&3Y={}AJT|S*xR`NgaNU=lIuCl0l$NUI+R`!^U zY|T;CR)n-s4Mzg70%!qxfHq*Yl=PKz=xTAqwU1_G--|UCIis4k4=cx%WmektBA4z_ zRZldkx~5%S89Spuc{(V$o)#tab)X&8jy0+)A5}EjH})4*Z9C9)-B@DUTfvQwX6~~* z;EcWpEEiXp@}kONUDuCLRXER!JYbCztO{&qf{~pa`vor+k%z_+(=$8l1(#Q$Ukn^YKPp!iKN%sCP zbJ{Mw@uJed;?=3uXcn)^_6xrIYIhs9=ME`b(-Ti3p8t<$Q!cvb%(|qKk##JFD@l)Y z@0Xux{C;EK@_m25ap&usUwwJ+!N%Ry)zzn?Q@lOJH)V)6>E~4APe&bR{nq`BcJJxJ zZ=e6M|Ln$VGP&=n=7&uv&*brw=ErfNE@42reBWMQC6R^Ck~~bC(`qgo1`11?CG}pM z4PqIpp^T@T){Mme1FccSabzrN9a|+?EYA^DbO*+Z;&{;Q;|X)a!642fxdK-CVwG)S zcxHHP+)a8oRr!jxX5|G^x6u2Bw~ZajUeR$Ro`l%&z0+LDx5*TR*0CuZStB)mw7lRl+(oAjxjg-QMn(Bd{0#^<>!Y_w|m2^YA{=h3u_B_%)$3+!Edjq+OpeS!O+ zH^ezm7NFr_=ZZyO@)~Tm<_u0zTk;YRb2O&;Tgr=4-9 z&>E!51o$&-sD3})NmL=}B{w!DQeMRNG=b%rZ-jXotGAZ*qhT6frx&lFe*{GtloPAx H`Cj#3`LESZ diff --git a/SourceCode/StatProcedures/placeholder b/SourceCode/StatProcedures/placeholder deleted file mode 100644 index 8d1c8b6..0000000 --- a/SourceCode/StatProcedures/placeholder +++ /dev/null @@ -1 +0,0 @@ - diff --git a/SourceCode/TestFunctions/Brown.py b/SourceCode/TestFunctions/Brown.py deleted file mode 100644 index f7dade4..0000000 --- a/SourceCode/TestFunctions/Brown.py +++ /dev/null @@ -1,10 +0,0 @@ -def main(args): - ''' - - #_# dimmensions: 0 - ''' - result = 0 - for i,x in enumerate(args[0:-1]): - result += (x**2)**(args[i+1]**2+1) + (args[i+1]**2)**(x**2 + 1) - - return result diff --git a/SourceCode/TestFunctions/Bukin4.py b/SourceCode/TestFunctions/Bukin4.py deleted file mode 100644 index dbf4fb0..0000000 --- a/SourceCode/TestFunctions/Bukin4.py +++ /dev/null @@ -1,7 +0,0 @@ -def main(args): - ''' - #_# dimmensions: 2 - - #_# dimmensions: 2.0 - ''' - return 100*args[1]**2+0.01*abs(args[0]+10) diff --git a/SourceCode/TestFunctions/Bukin6.py.old b/SourceCode/TestFunctions/Bukin6.py.old deleted file mode 100644 index c99cc2b..0000000 --- a/SourceCode/TestFunctions/Bukin6.py.old +++ /dev/null @@ -1,89 +0,0 @@ -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 - - #_# 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 deleted file mode 100644 index 03a71f8e09a9fcaaa95865a2032e9ef3bc2b2880..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 382 zcmZ8dJx{|h5WREUDik__DBXfOWdSxMgen9TBMYz~zM|Sfks1f=L{Q{R!0%w@zwisZ zGG#+zV}Wxjq>3lKcVG7Te5c)R2MC|x>-9U?4K<5`j_-^+v~(Bim;L#F+Lj$&+V W(_l^(spi7nEEnZO4*lIPBK!jTTTIvh diff --git a/SourceCode/TestFunctions/__pycache__/Brown.cpython-39.pyc b/SourceCode/TestFunctions/__pycache__/Brown.cpython-39.pyc deleted file mode 100644 index d0530fff56451bfe8add2661e844bbf199e6dc88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 426 zcmZ8dJ5R$f5I#F;RSKOzYP%J6$^cG+lDUK$a?>C^LO(~8@3@Q zw`&=}>9xo8W)D$G|DxYxu@GG9IFWj%w^gM}Tm#AAzEOD6%u0q2-w{Sys zrHi`aI-Qw<#09y317&aWJ@T&;!F|O=><3ANJ<@3ZFc?lY_G5D}9Qo5ERS_R2jQhu2 zn@K7oV;As8D!G%JHxGp?!dTk5x`6^UmvqR0DtpW$k5slAwjj$`D;m2ZVd;zyZ0{Em FegXaDTu=Z2 diff --git a/SourceCode/TestFunctions/__pycache__/Bukin2.cpython-38.pyc b/SourceCode/TestFunctions/__pycache__/Bukin2.cpython-38.pyc deleted file mode 100644 index 0321d4bfff2919e06f1325ab78644cb78d4f0caa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 619 zcmWIL<>g`kf)5d!dL@TC&`e)45V3rG^;R!2!jMrOdLqVMcKrmGU5zCGuaazfCh1KDFA_0 zL1Iy2u0mo_da;#4PG)h5LVlV;T26jqNijseD7B=tD9;Ka1{UJt;#7`TR!GUr%}vcK z&dkpP>NMiw#3rg|Fnq;drU1kLB`8MHt3}qiKdfr8e+lF;yaYw&OHh2TWYA>1#R3Z2 zA~qlwO#BiLNi8mME6qzT0fn5tQ)zZ)o{?Tb)n#LPU9am6e^fg`kf)5`Cs{n}<#u}hHNrn_=VFnR~6qXVOAfFY;XA@^=W)xu%X8@YPUS-0i00heM$_go& zxw)x%#hLke#a0SNU|}v!ObI;$F3y)JKnq@itb7S_UwXC3I`@ZFE%q;g9EO)54{0*q zVoppd22w1EMd`&W8HzZ7qQAsLQj1I6O7oISK-TCxm1bw=ndlW%-eSp3%*+EBSPU|d kfvpH+h@U1SmWHa^HWN5Qtd#xJ_9iW0A6=MIRF3v diff --git a/SourceCode/TestFunctions/__pycache__/Bukin4.cpython-39.pyc b/SourceCode/TestFunctions/__pycache__/Bukin4.cpython-39.pyc deleted file mode 100644 index 0bd0846c408a106ac1fcb6b52d7235d737a3a59c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmYe~<>g`k0yWRBggPMo7{oyaOhAqU5Et_Ri4=wu#ukPsh7_h?22JKYotq5eHpC%)i b2HS%~a02CSaoFVMrl-JTH167>I&J;EE&7DOZSys3>S>?W#8cf-gnTS?A;R_aGCRl(^HN7tW)v(bzmmOOKQRK%en8a$=?pLtU`bqS*j8=`? z{kjidgYut!py|Bu!qCrfWCt?!e;>{I=-)a}3Y40X#Ap0uzMj54&JHAHB}rRJ>L+RE zu!4JXta6ZqeOLouB`0Y-N=R2WkJ7s!-tOIJ1&_QSM)?6n*I+1@F`hY`h~!r4m`S25 Zys9-9mXIhG_o9hNLw}#XQB_&dKLI4fWN`oh diff --git a/SourceCode/__pycache__/AlgorithmAnalyser.cpython-39.pyc b/SourceCode/__pycache__/AlgorithmAnalyser.cpython-39.pyc deleted file mode 100644 index 9baf9b0f999e291872bdc1d68988dd6f4e2c2b04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2968 zcmbtW&5s;M6|d^9p6TiN+z+u{63B!Is8Gax7r|2F>Z2P=g9%M4yEJ_ff@)t?|Z;WQ;98d7TdPU?iNZCS`{>xG_eD`5q# zn^s4DSc5JL1MY?O0pXRu(6E8Finhr~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