From 3ce33b3a5088e49713106e6af9fb82792f9f887b Mon Sep 17 00:00:00 2001 From: Remi Ehounou Date: Sat, 11 Sep 2021 00:46:56 -0400 Subject: [PATCH] MDAF-V1 --- MDAF/MDAF.py | 50 +++++++++++--- MDAF/SampleAlgorithms/SimmulatedAnnealing.py | 24 +++---- .../SimmulatedAnnealing.cpython-39.pyc | Bin 2100 -> 1752 bytes MDAF/TestFunctions/Ackley2.py | 28 +++++++- MDAF/TestFunctions/Alpine.py | 38 +++++++++++ MDAF/TestFunctions/Brown.py | 9 ++- MDAF/TestFunctions/Bukin2.py | 9 ++- MDAF/TestFunctions/Bukin4.py | 9 +++ MDAF/TestFunctions/Bukin6.py | 7 ++ MDAF/TestFunctions/Easom.py | 18 ++++++ MDAF/TestFunctions/Keane.py | 54 ++++++++++++---- MDAF/TestFunctions/Leon.py | 56 ++++++++++++---- MDAF/TestFunctions/Matyas.py | 59 +++++++++++------ MDAF/TestFunctions/McCormick.py | 57 ++++++++++------ MDAF/TestFunctions/Miele_Cantrell.py | 61 ++++++++++++------ MDAF/TestFunctions/Periodic.py | 37 +++++++++++ MDAF/TestFunctions/PowellSingular2.py | 38 +++++++++++ MDAF/TestFunctions/Price1.py | 35 ++++++++++ MDAF/TestFunctions/Price2.py | 37 +++++++++++ MDAF/TestFunctions/Quartic.py | 36 +++++++++++ MDAF/TestFunctions/Rastriring.py | 38 +++++++++++ MDAF/TestFunctions/Scahffer.py | 37 +++++++++++ MDAF/TestFunctions/Schwefel.py | 38 +++++++++++ MDAF/TestFunctions/Sphere.py | 36 +++++++++++ MDAF/TestFunctions/Step.py | 38 +++++++++++ MDAF/TestFunctions/Step2.py | 38 +++++++++++ MDAF/TestFunctions/Styblinski-Tang.py | 38 +++++++++++ MDAF/TestFunctions/SumSquare.py | 36 +++++++++++ MDAF/TestFunctions/Wayburn.py | 37 +++++++++++ MDAF/TestFunctions/Zettle.py | 35 ++++++++++ MDAF/TestFunctions/Zirilli.py | 35 ++++++++++ .../__pycache__/Brown.cpython-39.pyc | Bin 5963 -> 6074 bytes .../__pycache__/Bukin2.cpython-39.pyc | Bin 5253 -> 5357 bytes .../__pycache__/Bukin4.cpython-39.pyc | Bin 5736 -> 5842 bytes .../__pycache__/Bukin6.cpython-39.pyc | Bin 5783 -> 5889 bytes MDAF/__init__.py | 6 +- MDAF/__pycache__/MDAF.cpython-39.pyc | Bin 9991 -> 11380 bytes MDAF/__pycache__/__init__.cpython-39.pyc | Bin 281 -> 343 bytes README.md | 9 ++- .../test_flows.cpython-39-pytest-6.2.4.pyc | Bin 3040 -> 2969 bytes .../test_funcs.cpython-39-pytest-6.2.4.pyc | Bin 888 -> 888 bytes tests/test_flows.py | 2 - tests/{deprecated_funcs.py => test_funcs.py} | 0 43 files changed, 966 insertions(+), 119 deletions(-) create mode 100644 MDAF/TestFunctions/Alpine.py create mode 100644 MDAF/TestFunctions/Easom.py create mode 100644 MDAF/TestFunctions/Periodic.py create mode 100644 MDAF/TestFunctions/PowellSingular2.py create mode 100644 MDAF/TestFunctions/Price1.py create mode 100644 MDAF/TestFunctions/Price2.py create mode 100644 MDAF/TestFunctions/Quartic.py create mode 100644 MDAF/TestFunctions/Rastriring.py create mode 100644 MDAF/TestFunctions/Scahffer.py create mode 100644 MDAF/TestFunctions/Schwefel.py create mode 100644 MDAF/TestFunctions/Sphere.py create mode 100644 MDAF/TestFunctions/Step.py create mode 100644 MDAF/TestFunctions/Step2.py create mode 100644 MDAF/TestFunctions/Styblinski-Tang.py create mode 100644 MDAF/TestFunctions/SumSquare.py create mode 100644 MDAF/TestFunctions/Wayburn.py create mode 100644 MDAF/TestFunctions/Zettle.py create mode 100644 MDAF/TestFunctions/Zirilli.py rename tests/{deprecated_funcs.py => test_funcs.py} (100%) diff --git a/MDAF/MDAF.py b/MDAF/MDAF.py index 9c2c3bc..c319860 100644 --- a/MDAF/MDAF.py +++ b/MDAF/MDAF.py @@ -6,7 +6,7 @@ import multiprocessing import time import re from numpy import random as rand -from numpy import array, isnan, NaN, asarray +from numpy import array, isnan, NaN, asarray, linspace, append, meshgrid, ndarray import statistics from functools import partial import shutil @@ -130,12 +130,13 @@ def measure(heuristicpath, funcpath, args, connection, sampleSize = 30): quality = quality[~(isnan(quality))] numCalls = numCalls[~(isnan(numCalls))] converged = converged[~(isnan(converged))] + results = dict() - 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)]) + results['cpuTime'] = array([statistics.fmean(cpuTime), statistics.stdev(cpuTime)]) if cpuTime.size > 0 else array([]) + results['quality'] = array([statistics.fmean(quality), statistics.stdev(quality)]) if quality.size > 0 else array([]) + results['numCalls'] = array([statistics.fmean(numCalls), statistics.stdev(numCalls)]) if numCalls.size > 0 else array([]) + results['convRate'] = array([statistics.fmean(converged), statistics.stdev(converged)]) if converged.size > 0 else array([]) connection.send((results,newRun,funcChars)) @@ -220,6 +221,10 @@ def representfunc(funcpath, forced = False): pyfeats[feature] = asarray(rawfeats) writerepresentation(funcpath, pyfeats) + + for feat in results.keys(): + if isinstance(results[feat],ndarray): + results[feat] = results[feat].reshape(results[feat].shape[:-1]) return results @@ -325,6 +330,29 @@ def plotfuncs(funcpaths, feature, low_limit = 0, high_limit = 200): plt.show(block=True) return representations +def visualize2D(funcpath, min = -10, max=10): + if funcpath.find('@') == 0: + funcpath = path.dirname(__file__) + '/TestFunctions/' + funcpath[1:] + + # loading the test function object into the namespace and memory + testspec = importlib.util.spec_from_file_location(path.splitext(path.basename(funcpath))[0], funcpath) + func = importlib.util.module_from_spec(testspec) + testspec.loader.exec_module(func) + + # create the 2D mx + x = linspace(min,max) + y = linspace(min,max) + X, Y = meshgrid(x, y) + vals = array([[X[i][j],Y[i][j]] for i in range(X.shape[0]) for j in range(X.shape[1])]) + z = array([func.main(arg) for arg in vals]) + Z = z.reshape([50,50]) + fig = plt.figure() + ax = plt.axes(projection='3d') + ax.plot_surface(X,Y,Z) + plt.show() + + + def model(features, doe_data): X_train, X_test, y_train, y_test = train_test_split(features, doe_data, random_state=1) @@ -336,11 +364,13 @@ def model(features, doe_data): if __name__== "__main__": + testfuns = ['@Ackley2.py', '@Alpine.py', '@Brown.py', '@Bukin2.py', '@Bukin4.py', '@Bukin6.py', '@Easom.py', '@Keane.py', '@Leon.py', '@Matyas.py', '@McCormick.py', '@Miele_Cantrell.py', '@Periodic.py', '@PowellSingular2.py', '@Price1.py', '@Price2.py', '@Quartic.py', '@Rastriring.py', '@Scahffer.py', '@Schwefel.py', '@Sphere.py', '@Step.py', '@Step2.py', '@Styblinski-Tang.py', '@SumSquare.py', '@Wayburn.py', '@Zettle.py', '@Zirilli.py'] + #visualize2D('@Easom.py', -10,10) + #feats = array([representfunc(testfun)['ela_meta'] for testfun in testfuns[7:10]]) #plotfuncs(['@Bukin2.py','@Bukin6.py'], 'ela_meta') - testfuns = ['@Bukin2.py','@Bukin4.py','@Leon.py'] - perf = doe('@SimmulatedAnnealing.py', testfuns,{"t": 1000, "p": 0.95, "objs": 0},measurementSampleSize=2) + #perf = doe('@SimmulatedAnnealing.py', testfuns[3:4],{"t": 1000, "p": 0.95, "objs": 0},measurementSampleSize=30) - feats = [representfunc(testfun)['ela_meta'] for testfun in testfuns] - - features = array(feats) + #perfs = array([[perf[func][0]['cpuTime'][0], perf[func][0]['numCalls'][0], perf[func][0]['quality'][0], perf[func][0]['convRate'][0]] for func in perf.keys()]) + #features = array(feats) + #model(features, perfs) # %% diff --git a/MDAF/SampleAlgorithms/SimmulatedAnnealing.py b/MDAF/SampleAlgorithms/SimmulatedAnnealing.py index 9756f56..2b21c8a 100644 --- a/MDAF/SampleAlgorithms/SimmulatedAnnealing.py +++ b/MDAF/SampleAlgorithms/SimmulatedAnnealing.py @@ -28,7 +28,7 @@ def Quality(Sc,objective,func): error = [func_output[i]-objective[i] for i in range(len(func_output))] else: error = func_output - objective - print("Error is: "+str(error)) + #print("Error is: "+str(error)) return 1/abs(error) def main(func, S, args): @@ -48,35 +48,35 @@ def main(func, S, args): while True: print('\n\n\n') R = tweak(cp.deepcopy(S),p,sigma,high, low) - print(R) - print(S) + #print(R) + #print(S) Qr = Quality(R,y,func) Qs = Quality(S,y,func) try: P = m.e**((Qr-Qs)/t) except: pass - print('QUALITY_R///{}'.format(Qr)) - print('QUALITY_S///{}'.format(Qs)) - print('fraction is:{}'.format(P)) + #print('QUALITY_R///{}'.format(Qr)) + #print('QUALITY_S///{}'.format(Qs)) + #print('fraction is:{}'.format(P)) if (Qr > Qs) or (r.random() < P): - print('NEW_S') + #print('NEW_S') S[:] = R[:] if t > 0.01: t-= t/10 - print('t = {}'.format(t)) + #print('t = {}'.format(t)) if (Quality(S,y,func) > Quality(Best,y,func)): - print('new Best****:{}'.format(Best)) + #print('new Best****:{}'.format(Best)) Best[:] = S[:] route.append(Best[:]) - print(route) + #print(route) 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))) - print("final Temperature is: {}".format(t)) + #print("Final Quality is: {}".format(Quality(Best,y,func))) + #print("final Temperature is: {}".format(t)) return Quality(Best,y,func) diff --git a/MDAF/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-39.pyc b/MDAF/SampleAlgorithms/__pycache__/SimmulatedAnnealing.cpython-39.pyc index 6e9c2a205b4bbdf281a3226513153e49bc26c394..3df95fd7a6a0e7ab12e8fe52e5e505966a26029f 100644 GIT binary patch delta 422 zcmYLFJ4*vW5Z<}nyUXj$gJ8^qpiM#$qDBj&Cn9RBthCc6c!`k^F`EM+ZmK8*Y$Edq zw6PHcK?K1+Ay~+DcHTd*uy9XB2WDsZ=JCz9_mNk_s2WCqNZXk;tM;AI1K7lKm|&Z0 zD;0cz8dNZ&%q4sSGJrACqZYN9pnXV_EmB~3tX%6Z$oYbb(=>rwv|Rk&2R;ZvR`Dr3 zE313d752X(E)C=MN@=?(PW($n_L=KM2s{Ee-}ZESmaDe5&=J%NrYU_? zKZ)ONyme2PUGH@6$#F~aDU4uOn;Cc1BYtpb^O#rk)Hu*`pvD!iCCoGUtR-L^U2Po} za7xb>X-H~UU=%daSX_yFe?e0+#%M|+{CjuQVXdm&;FEZvCn1M7`cfqCG5pc+5`O6B E7fl>lyZ`_I delta 810 zcmYLH&rcIU6rQ)cvn-{%TS^1PCS)~6tTCd7gCU?%L}Ox9ENbjQ+^}0{pg)+M#!#l= zfF>k(AepNNh|zE|8vP^q6U^Q`_CL^@ZV8*h)Cx2txTCLU<`hwdu+H9@&FD>FC@DbWVl73u9y#fCL6N6)KPt zDN^ZcUq{-h1;!f8t41?k7todh&EZZ&SO2|OkUJyuBVkdSdfMZ&4LUt5Alkw z*j{sS9>8xNzv!?0sPDO!7*e*}5};-|V$AMvE3gi2kv>W&M1zRzK1v~SPLW6pd)+vI zD9g#Ab3}x*P7Z)wLrs!a3gf(B`&VfO{a*e;M;q(f2RU|x!Obydf{ zG438C=^{CJY9_xJm&#Zuo(`xi8RZq7@RS%7h9J9oFuZQC$^mSiY*tX3J+#l(`qhv0 zT+~nZm3Y=U`Olc#X*-KA?mm9B^m_UE)YQ~==M0y6xWfDuUTxIXb!>Oa^vS}j<It+>?#+29cI)9g?_L=3E7)*1Q@7W>skY=ERO|kRx7hMGs(dTCTND)X zm4sdjYt4}Pyv4%aQqh$&^u}#gKrzdz!NVbjS`1-qRvN74bEY9xblF6*Qi=_qtwv?a z8Z92iu*ELO&vXHv$u6CEgYQJWlr(5C3MO_Z>3L*xkV4+k&LNY7ELa$s+9)D6tqg`^ n1I^ahRb@l#ty*&{*6Pi~omoh-%krr?mno{SUn-lHpUm0+DUHG# diff --git a/MDAF/TestFunctions/Ackley2.py b/MDAF/TestFunctions/Ackley2.py index 28b886b..d51cc77 100644 --- a/MDAF/TestFunctions/Ackley2.py +++ b/MDAF/TestFunctions/Ackley2.py @@ -11,5 +11,29 @@ def main(args): >>> main([0, 0]) -200.0 - ''' - return -200 * m.e**(-0.02 * m.sqrt(args[0]**2 + args[1]**2)) \ No newline at end of file + + #_# cm_angle: array([[5.65927783e+00], [7.35496768e-01], [5.78026016e+00], [7.89658853e-01], [1.64629829e+02], [1.21305405e+01], [2.36845276e-01], [4.62474283e-02], [0.00000000e+00], [4.30000000e-02]]) + #_# cm_conv: array([[0.23076923], [0.01923077], [0.76923077], [0.23076923], [0. ], [0.013 ]]) + #_# cm_grad: array([[0.67776659], [0.08057764], [0. ], [0.027 ]]) + #_# ela_conv: array([[ 8.99000000e-01], [ 0.00000000e+00], [-1.28437313e+01], [ 1.30097926e+01], [ 1.00000000e+03], [ 8.50000000e-02]]) + #_# ela_curv: array([[1.67138684e+00], [2.11477874e+00], [2.47871167e+00], [2.35585418e+00], [2.81304349e+00], [3.84712253e+00], [4.91521801e-01], [0.00000000e+00], [1.00947417e+00], [1.27750804e+00], [1.07231230e+01], [1.84915518e+00], [3.91414501e+00], [1.12977041e+03], [8.10226920e+01], [0.00000000e+00], [1.14593818e+00], [1.56903313e+00], [2.91410632e+00], [1.88909835e+00], [2.84062445e+00], [2.56326184e+01], [3.39935335e+00], [0.00000000e+00], [8.40000000e+03], [7.48000000e-01]]) + #_# ela_distr: array([[-0.67013865], [-0.09235035], [ 1. ], [ 0. ], [ 0.024 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.00000000e+00], [1.75106294e-02], [9.00000000e-02], [1.02247191e-02], [1.00000000e-02], [8.50000000e+01], [1.10000000e+02], [1.26500000e+02], [1.25000000e+02], [1.35000000e+02], [1.75000000e+02], [1.94170081e+01], [1.27400000e+04], [7.85000000e-01]]) + #_# ela_meta: array([[-6.08058266e-03], [-1.24578212e+02], [ 1.63005925e-03], [ 2.18786048e-03], [ 1.34219690e+00], [-7.02427127e-03], [ 8.91942646e-01], [ 1.00359484e+00], [ 9.42910444e-01], [ 0.00000000e+00], [ 7.00000000e-03]]) + #_# basic: array([[ 2. ], [ 500. ], [ -32. ], [ -32. ], [ 32. ], [ 32. ], [-196.11101183], [ -82.53967011], [ 6. ], [ 6. ], [ 36. ], [ 36. ], [ 1. ], [ 0. ], [ 0. ]]) + #_# disp: array([[ 1.43172836e-01], [ 2.29370520e-01], [ 3.22785149e-01], [ 4.98604939e-01], [ 1.45153158e-01], [ 2.29371341e-01], [ 3.18457221e-01], [ 5.00075741e-01], [-2.86475351e+01], [-2.57655639e+01], [-2.26422983e+01], [-1.67638623e+01], [-2.80625149e+01], [-2.52978395e+01], [-2.23733696e+01], [-1.64112812e+01], [ 0.00000000e+00], [ 8.00000000e-03]]) + #_# limo: array([[ 1.91414000e-02], [ 7.04396915e-03], [ 2.47223669e+00], [ 4.22072748e-01], [-9.63566714e-03], [-1.92775958e-03], [ 2.50758701e+00], [ 1.55577807e+00], [ 1.01938498e+00], [ 1.01237543e+00], [ 1.79774226e+00], [ 7.17105814e-01], [ 0.00000000e+00], [ 3.30000000e-02]]) + #_# nbc: array([[ 1.01253954], [ 0.93528579], [ 0.70792465], [ 0.10676121], [-0.23871564], [ 0. ], [ 0.023 ]]) + #_# pca: array([[1. ], [1. ], [1. ], [1. ], [0.51329024], [0.51329019], [0.44184058], [0.34219476], [0. ], [0.002 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.021 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.02 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.024 ]]) + #_# ic: array([[0.76113587], [0.50550551], [1.01159111], [0.16516517], [0.35140562], [0. ], [0.153 ]]) + + #_# Represented: 1 + + ''' + return -200 * m.e**(-0.02 * m.sqrt(args[0]**2 + args[1]**2)) + + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Alpine.py b/MDAF/TestFunctions/Alpine.py new file mode 100644 index 0000000..b74b4ae --- /dev/null +++ b/MDAF/TestFunctions/Alpine.py @@ -0,0 +1,38 @@ +import math + +def main(args): + ''' + >>> (main([0,0]) - 0)<0.001 + True + + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: -10 + #_# minimum: [0,0] + + #_# cm_angle: array([[1.51864326e+00], [5.34186818e-01], [1.13769921e+00], [6.01461615e-01], [1.04599092e+02], [4.22931285e+01], [3.99368522e-01], [1.77424245e-01], [0.00000000e+00], [4.10000000e-02]]) + #_# cm_conv: array([[0.46153846], [0.25 ], [0.48076923], [0.51923077], [0. ], [0.012 ]]) + #_# cm_grad: array([[0.25422972], [0.15759445], [0. ], [0.028 ]]) + #_# ela_conv: array([[ 5.49000000e-01], [ 0.00000000e+00], [-9.65901820e-01], [ 3.67214694e+00], [ 1.00000000e+03], [ 1.01000000e-01]]) + #_# ela_curv: array([[2.42619601e-01], [3.20078135e+00], [5.52064754e+00], [5.50463872e+00], [7.36057390e+00], [1.32601509e+01], [2.88883096e+00], [0.00000000e+00], [1.00366087e+00], [1.58589209e+00], [6.83833374e+00], [2.81557142e+00], [5.79921113e+00], [1.54395057e+02], [1.45430442e+01], [0.00000000e+00], [1.00365450e+00], [1.31915593e+00], [2.27082230e+01], [2.14233097e+00], [4.20450173e+00], [2.46681056e+03], [1.83077553e+02], [0.00000000e+00], [8.40000000e+03], [8.49000000e-01]]) + #_# ela_distr: array([[ 0.25150949], [-0.27290042], [ 1. ], [ 0. ], [ 0.016 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.88758092e+00], [4.70404069e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [1.00000000e+01], [3.50000000e+01], [4.09500000e+01], [4.00000000e+01], [4.50000000e+01], [1.00000000e+02], [1.50201044e+01], [4.18500000e+03], [3.17000000e-01]]) + #_# ela_meta: array([[0.01734519], [1.57345526], [0.09271256], [0.1030968 ], [1.11200464], [0.01547931], [0.12118168], [1.03294402], [0.11114866], [0. ], [0.007 ]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+01], [-1.00000000e+01], [ 1.00000000e+01], [ 1.00000000e+01], [-1.01319516e+01], [ 1.74084063e+01], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.81723285], [ 1.02288078], [ 1.00043181], [ 0.91285508], [ 0.94977571], [ 1.02392436], [ 1.0226333 ], [ 0.95015092], [-1.90889021], [ 0.23897563], [ 0.00451003], [-0.91017497], [-0.51416167], [ 0.2449211 ], [ 0.23170416], [-0.51032053], [ 0. ], [ 0.009 ]]) + #_# limo: array([[ 0.16281056], [ 0.12956626], [ 1.98950747], [ 1.3449436 ], [ 0.07059703], [ 0.01217696], [ 7.43415949], [10.64830298], [ 1.09951251], [ 1.00718078], [ 1.70875965], [ 0.7110877 ], [ 0. ], [ 0.027 ]]) + #_# nbc: array([[ 0.13314903], [ 0.74751908], [ 0.1546862 ], [ 0.22427331], [-0.51183856], [ 0. ], [ 0.031 ]]) + #_# pca: array([[1. ], [1. ], [1. ], [1. ], [0.50758756], [0.50758756], [0.3850794 ], [0.38716446], [0. ], [0.002 ]]) + #_# gcm: array([[4. ], [0.11111111], [0.88888889], [0.52777778], [0.24241125], [0.25 ], [0.25032008], [0.25694859], [0.00648962], [0.11111111], [0.11805556], [0.11111111], [0.13888889], [0.01388889], [0.47222222], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0. ], [1. ], [0.25694859], [0.02777778], [0. ], [0.022 ], [4. ], [0.11111111], [0.88888889], [0.75 ], [0.23441552], [0.25 ], [0.25096224], [0.26366 ], [0.01218501], [0.02777778], [0.0625 ], [0.02777778], [0.16666667], [0.06944444], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0. ], [1. ], [0.26366 ], [0.02777778], [0. ], [0.022 ], [4. ], [0.11111111], [0.88888889], [0.75 ], [0.23766183], [0.25 ], [0.24248077], [0.27737663], [0.01848444], [0.02777778], [0.0625 ], [0.02777778], [0.16666667], [0.06944444], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0. ], [1. ], [0.27737663], [0.02777778], [0. ], [0.024 ]]) + #_# ic: array([[0.75502423], [1.00600601], [1.46273336], [0.48548549], [0.44176707], [0. ], [0.166 ]]) + + #_# Represented: 1 + + ''' + vals = [(x*math.sin(x)+0.1*x) for i,x in enumerate(args)] + return sum(vals) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Brown.py b/MDAF/TestFunctions/Brown.py index 99680a5..ecc8bbc 100644 --- a/MDAF/TestFunctions/Brown.py +++ b/MDAF/TestFunctions/Brown.py @@ -1,6 +1,9 @@ def main(args): ''' - + >>> (main([0,0]) - 0)<0.001 + True + + #_# dimmensions: 6 #_# upper: 4 #_# lower: -1 @@ -31,3 +34,7 @@ def main(args): result += (x**2)**(args[i+1]**2+1) + (args[i+1]**2)**(x**2 + 1) return result + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Bukin2.py b/MDAF/TestFunctions/Bukin2.py index 13ac998..cc2d86a 100644 --- a/MDAF/TestFunctions/Bukin2.py +++ b/MDAF/TestFunctions/Bukin2.py @@ -1,6 +1,9 @@ def main(args): ''' - + >>> (main([-10,0]) - 0)<0.001 + True + + #_# dimmensions: 2 #_# upper: [-5, 3] #_# lower: [-15, -3] @@ -27,3 +30,7 @@ def main(args): ''' return 100*(args[1]-0.01*args[0]**2+1)+0.01*(args[0]+10)**2 + +if __name__ == "__main__": + import doctest + doctest.testmod() \ No newline at end of file diff --git a/MDAF/TestFunctions/Bukin4.py b/MDAF/TestFunctions/Bukin4.py index 9045aee..1e1276d 100644 --- a/MDAF/TestFunctions/Bukin4.py +++ b/MDAF/TestFunctions/Bukin4.py @@ -1,5 +1,9 @@ def main(args): ''' + >>> (main([-10,0]) - 0)<0.001 + True + + #_# dimmensions: 2 #_# upper: [-5, 3] #_# lower: [-15, -3] @@ -26,3 +30,8 @@ def main(args): ''' return 100*args[1]**2+0.01*abs(args[0]+10) + + +if __name__ == "__main__": + import doctest + doctest.testmod() \ No newline at end of file diff --git a/MDAF/TestFunctions/Bukin6.py b/MDAF/TestFunctions/Bukin6.py index c34abbf..006ba62 100644 --- a/MDAF/TestFunctions/Bukin6.py +++ b/MDAF/TestFunctions/Bukin6.py @@ -3,6 +3,9 @@ from math import sqrt, fabs def main(args): ''' + >>> (main([-10,1]) - 0)<0.001 + True + #_# dimmensions: 2 #_# upper: [-5, 3] #_# lower: [-15, -3] @@ -29,3 +32,7 @@ def main(args): ''' return 100*sqrt(fabs(args[1]-0.01*args[0]**2))+0.01*fabs(args[0]+10) + +if __name__ == "__main__": + import doctest + doctest.testmod() \ No newline at end of file diff --git a/MDAF/TestFunctions/Easom.py b/MDAF/TestFunctions/Easom.py new file mode 100644 index 0000000..b19e9fa --- /dev/null +++ b/MDAF/TestFunctions/Easom.py @@ -0,0 +1,18 @@ +import math + +def main(args): + ''' + >>> (main([3.1415,3.1415]) + 1) < 0.001 + True + + + #_# dimmensions: 2 + #_# upper: 100 + #_# lower: -100 + #_# minimum: [3.1415, 3.1415] + ''' + return -1*math.cos(args[0])*math.cos(args[1])*math.exp(-(args[0]-math.pi)**2-(args[1]-math.pi)**2) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Keane.py b/MDAF/TestFunctions/Keane.py index 8cb23fd..f38db33 100644 --- a/MDAF/TestFunctions/Keane.py +++ b/MDAF/TestFunctions/Keane.py @@ -1,14 +1,40 @@ -#Import math library -import math - - -def main(args): - ''' - #_# dimmensions: 2 - #_# upper: 10 - #_# lower: 0 - #_# minimum: [0, 1.39325] - ''' - for x in args: - if(x<0 | x>10): return 0 - return (math.sin(args[0]-args[1])**2*math.sin(args[0]+args[1])**2)/(math.sqrt(args[0]**2+args[1]**2)) +#Import math library +import math + + +def main(args): + ''' + >>> (main([0.01,3]) + 0) < 0.001 + True + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: 0.01 + #_# minimum: [0, 1.39325] + + #_# cm_angle: array([[7.13994878e-01], [2.04021604e-01], [7.26144234e-01], [1.75288688e-01], [1.18714400e+02], [2.56929617e+01], [2.29691859e-01], [1.84411364e-01], [0.00000000e+00], [4.50000000e-02]]) + #_# cm_conv: array([[0.30769231], [0.34615385], [0.51923077], [0.48076923], [0. ], [0.014 ]]) + #_# cm_grad: array([[0.32559195], [0.1399167 ], [0. ], [0.032 ]]) + #_# ela_conv: array([[ 5.67000000e-01], [ 0.00000000e+00], [-5.83334499e-03], [ 3.94656059e-02], [ 1.00000000e+03], [ 1.41000000e-01]]) + #_# ela_curv: array([[2.09782421e-04], [3.10445933e-02], [1.24814951e-01], [1.00555952e-01], [1.59286817e-01], [9.15655561e-01], [1.41777370e-01], [0.00000000e+00], [1.00246224e+00], [1.23391134e+00], [3.30031514e+01], [1.64848696e+00], [2.83895859e+00], [3.54024800e+03], [3.02192774e+02], [0.00000000e+00], [1.00753890e+00], [2.04357927e+00], [3.17496268e+02], [3.48697875e+00], [1.16989282e+01], [5.76141700e+04], [4.07366133e+03], [0.00000000e+00], [8.40000000e+03], [1.25100000e+00]]) + #_# ela_distr: array([[3.90425118e+00], [2.23397555e+01], [1.20000000e+01], [0.00000000e+00], [1.80000000e-02]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [8.96637744e-07], [1.54478517e-02], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [2.00000000e+01], [2.50000000e+01], [3.31000000e+01], [3.00000000e+01], [4.00000000e+01], [7.00000000e+01], [1.02193123e+01], [3.40000000e+03], [4.04000000e-01]]) + #_# ela_meta: array([[0.12972729], [0.10467623], [0.00604455], [0.00616543], [1.01999874], [0.18884208], [0.14639839], [1.29628423], [0.25475847], [0. ], [0.008 ]]) + #_# basic: array([[2.00000000e+00], [5.00000000e+02], [1.00000000e-02], [1.00000000e-02], [1.00000000e+01], [1.00000000e+01], [4.80399974e-09], [6.14179357e-01], [6.00000000e+00], [6.00000000e+00], [3.60000000e+01], [3.60000000e+01], [1.00000000e+00], [0.00000000e+00], [0.00000000e+00]]) + #_# disp: array([[ 0.80655474], [ 0.944084 ], [ 0.98931651], [ 1.00239241], [ 0.83291543], [ 0.92725977], [ 0.96167909], [ 0.98859526], [-1.00968589], [-0.29185309], [-0.05576241], [ 0.01248716], [-0.85614308], [-0.37272169], [-0.19635673], [-0.05843801], [ 0. ], [ 0.01 ]]) + #_# limo: array([[5.69755302e-03], [8.78283277e-02], [4.71205796e-02], [2.75751683e-02], [6.25311589e-01], [4.20168495e-01], [1.27760750e+01], [3.78058931e+01], [1.07115757e+00], [1.02370744e+00], [3.87765279e-02], [7.14316865e-01], [0.00000000e+00], [3.30000000e-02]]) + #_# nbc: array([[ 0.1261895 ], [ 0.73775195], [ 0.12994374], [ 0.23723227], [-0.30515559], [ 0. ], [ 0.031 ]]) + #_# pca: array([[1. ], [1. ], [0.66666667], [1. ], [0.50704555], [0.50704511], [0.50694142], [0.4590337 ], [0. ], [0.002 ]]) + #_# gcm: array([[6. ], [0.16666667], [0.83333333], [0.77777778], [0.0546632 ], [0.16666667], [0.18570551], [0.30845187], [0.09587695], [0.02777778], [0.03703704], [0.02777778], [0.05555556], [0.01434438], [0.22222222], [0.02777778], [0.16666667], [0.16666667], [0.36111111], [0.12171612], [1. ], [0.17756709], [0.02777778], [0. ], [0.024 ], [5. ], [0.13888889], [0.86111111], [0.77777778], [0.1667842 ], [0.2 ], [0.20692636], [0.22545222], [0.02728811], [0.02777778], [0.04444444], [0.02777778], [0.08333333], [0.0248452 ], [0.22222222], [0.13888889], [0.2 ], [0.19444444], [0.27777778], [0.05343162], [1. ], [0.1667842 ], [0.02777778], [0. ], [0.023 ], [4. ], [0.11111111], [0.88888889], [0.66666667], [0.07031096], [0.25 ], [0.22564623], [0.47839658], [0.17971943], [0.02777778], [0.08333333], [0.08333333], [0.13888889], [0.06415003], [0.33333333], [0.05555556], [0.25 ], [0.22222222], [0.5 ], [0.19641855], [1. ], [0.30067242], [0.02777778], [0. ], [0.031 ]]) + #_# ic: array([[ 0.72181626], [-0.27527528], [ 0.01750827], [-1.1961962 ], [ 0.47389558], [ 0. ], [ 0.171 ]]) + + #_# Represented: 1 + + ''' + for x in args: + if( x < 0 or x>10 ): return 100 + return (math.sin(args[0]-args[1])**2 * math.sin(args[0]+args[1])**2)/(math.sqrt(args[0]**2+args[1]**2)) + +if __name__ == "__main__": + import doctest + doctest.testmod() \ No newline at end of file diff --git a/MDAF/TestFunctions/Leon.py b/MDAF/TestFunctions/Leon.py index 7df89d8..444bd73 100644 --- a/MDAF/TestFunctions/Leon.py +++ b/MDAF/TestFunctions/Leon.py @@ -1,14 +1,42 @@ -#Import math library - - -def main(args): - ''' - #_# dimmensions: 2 - #_# upper: 1.2 - #_# lower: -1.2 - #_# minimum: [1, 1] - ''' - for x in args: - if x < -1.2 or x > 1.2: - return 0 - return (100*(args[1]-args[0])**2)+(1-args[0])**2 +#Import math library + + +def main(args): + ''' + >>> (main([1,1]) + 0) < 0.001 + True + + + #_# dimmensions: 2 + #_# upper: 1.2 + #_# lower: -1.2 + #_# minimum: [1, 1] + + #_# cm_angle: array([[2.10542603e-01], [2.72828609e-02], [2.13436119e-01], [2.65579669e-02], [1.51992391e+02], [2.94589423e+01], [1.70644204e-01], [1.20347799e-01], [0.00000000e+00], [4.30000000e-02]]) + #_# cm_conv: array([[0.15384615], [0.03846154], [0.96153846], [0.03846154], [0. ], [0.015 ]]) + #_# cm_grad: array([[0.61595303], [0.18604517], [0. ], [0.028 ]]) + #_# ela_conv: array([[ 1.00000000e+00], [ 0.00000000e+00], [-3.22804188e+01], [ 3.22804188e+01], [ 1.00000000e+03], [ 5.10000000e-02]]) + #_# ela_curv: array([[1.78279061e+00], [1.16451891e+02], [2.52239097e+02], [2.38088464e+02], [3.62255731e+02], [6.55510933e+02], [1.67106250e+02], [0.00000000e+00], [1.00002731e+00], [1.00459719e+00], [1.20212429e+00], [1.01160307e+00], [1.02140902e+00], [2.03164862e+01], [1.54951271e+00], [0.00000000e+00], [4.68926193e+01], [4.01827782e+02], [3.98899501e+02], [4.02008357e+02], [4.02157224e+02], [4.22544636e+02], [2.68456809e+01], [0.00000000e+00], [8.40000000e+03], [3.89000000e-01]]) + #_# ela_distr: array([[ 1.52929351], [ 1.74544029], [12. ], [ 0. ], [ 0.029 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [2.99314186e-10], [4.70682836e-02], [1.10000000e-01], [1.00000000e-02], [1.00000000e-02], [4.50000000e+01], [5.50000000e+01], [5.84500000e+01], [6.00000000e+01], [6.00000000e+01], [9.00000000e+01], [5.80382145e+00], [5.93500000e+03], [1.44000000e-01]]) + #_# ela_meta: array([[-5.56482247e-03], [ 9.54844057e+01], [ 2.98215620e-01], [ 3.66171877e+00], [ 1.22787625e+01], [ 7.03397803e-01], [ 2.63864648e-01], [ 1.04934975e+00], [ 1.00000000e+00], [ 0.00000000e+00], [ 6.00000000e-03]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.20000000e+00], [-1.20000000e+00], [ 1.20000000e+00], [ 1.20000000e+00], [ 1.49779966e-02], [ 5.36822922e+02], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 0.00000000e+00]]) + #_# disp: array([[ 0.37953991], [ 0.53302129], [ 0.70960306], [ 0.87624411], [ 0.34748594], [ 0.46859688], [ 0.63333187], [ 0.78061069], [-0.77797041], [-0.58552617], [-0.36411726], [-0.15517262], [-0.80323673], [-0.65415066], [-0.45136393], [-0.27006553], [ 0. ], [ 0.009 ]]) + #_# limo: array([[ 2.39839104e+00], [ 1.01208570e-01], [ 2.21689468e+02], [ 1.62392144e+02], [-9.99739218e-01], [-9.27939037e-01], [ 1.14453736e+00], [ 3.45698635e-01], [ 1.00869209e+00], [ 1.01966929e+00], [ 1.96104882e+02], [ 7.13420999e-01], [ 0.00000000e+00], [ 2.50000000e-02]]) + #_# nbc: array([[ 0.6833929 ], [ 0.91742318], [ 0.47692233], [ 0.13387147], [-0.1520694 ], [ 0. ], [ 0.026 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.51039485], [0.51039466], [0.99992363], [0.3439774 ], [0. ], [0.002 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.02 ], [2. ], [0.05555556], [0.94444444], [0.83333333], [0.48352763], [0.5 ], [0.5 ], [0.51647237], [0.02329546], [0.08333333], [0.08333333], [0.08333333], [0.08333333], [0. ], [0.16666667], [0.44444444], [0.5 ], [0.5 ], [0.55555556], [0.07856742], [1. ], [0.48352763], [0.02777778], [0. ], [0.02 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.022 ]]) + #_# ic: array([[ 0.63092359], [ 2.72772773], [38.59993618], [ 2.02702703], [ 0.33935743], [ 0. ], [ 0.147 ]]) + + #_# Represented: 1 + + ''' + for x in args: + if x < -1.2 or x > 1.2: + return 0 + return (100*(args[1]-args[0])**2)+(1-args[0])**2 + + +if __name__ == "__main__": + import doctest + doctest.testmod() \ No newline at end of file diff --git a/MDAF/TestFunctions/Matyas.py b/MDAF/TestFunctions/Matyas.py index e103a9a..d997e4c 100644 --- a/MDAF/TestFunctions/Matyas.py +++ b/MDAF/TestFunctions/Matyas.py @@ -1,20 +1,39 @@ - -def main(args): - ''' - >>> main([0,1]) - 0.26 - - - #_# dimmensions: 2 - #_# upper: 10 - #_# lower: -10 - #_# minimum: [0, 0] - ''' - for x in args: - if x < -10 or x > 10: - return 0 - return (0.26*(args[0]**2+args[1]**2))-(0.48*args[0]*args[1]) - -if __name__ == "__main__": - import doctest - doctest.testmod() + +def main(args): + ''' + >>> main([0,1]) + 0.26 + + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: -10 + #_# minimum: [0, 0] + + #_# cm_angle: array([[1.67665613e+00], [3.12117578e-01], [1.77116080e+00], [2.14030392e-01], [1.54152066e+02], [3.01167436e+01], [1.73757960e-01], [1.29449566e-01], [0.00000000e+00], [3.88000000e-01]]) + #_# cm_conv: array([[0.15384615], [0.03846154], [0.90384615], [0.09615385], [0. ], [0.069 ]]) + #_# cm_grad: array([[0.62302116], [0.15974139], [0. ], [0.237 ]]) + #_# ela_conv: array([[ 1. ], [ 0. ], [ -6.19936772], [ 6.19936772], [1000. ], [ 1.431 ]]) + #_# ela_curv: array([[1.16496033e-01], [1.85957158e+00], [4.70930631e+00], [4.40562779e+00], [6.98770896e+00], [1.28886450e+01], [3.18263815e+00], [0.00000000e+00], [1.00022507e+00], [1.02869338e+00], [1.40641407e+00], [1.07967875e+00], [1.26970899e+00], [1.17800888e+01], [1.01879089e+00], [0.00000000e+00], [2.46767181e+01], [2.49996758e+01], [2.62976605e+01], [2.50000892e+01], [2.50006216e+01], [2.84454372e+02], [1.83462255e+01], [0.00000000e+00], [8.40000000e+03], [8.37300000e+00]]) + #_# ela_distr: array([[1.49741683], [1.66474433], [9. ], [0. ], [0.116 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [9.72156751e-23], [3.06604026e-02], [1.10000000e-01], [1.00000000e-02], [1.00000000e-02], [3.00000000e+01], [3.00000000e+01], [3.59500000e+01], [3.50000000e+01], [4.00000000e+01], [5.00000000e+01], [6.05926121e+00], [3.68500000e+03], [2.61900000e+00]]) + #_# ela_meta: array([[-6.02700179e-03], [ 1.78902298e+01], [ 3.70313575e-04], [ 2.63092840e-02], [ 7.10459616e+01], [ 7.00414646e-01], [ 3.60339384e-01], [ 1.05364436e+00], [ 1.00000000e+00], [ 0.00000000e+00], [ 2.00000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+01], [-1.00000000e+01], [ 1.00000000e+01], [ 1.00000000e+01], [ 2.49545909e-02], [ 9.36878861e+01], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.21414662], [ 0.33734688], [ 0.476038 ], [ 0.72871994], [ 0.19533448], [ 0.30366329], [ 0.41946402], [ 0.64605276], [-8.21145451], [-6.9241237 ], [-5.4749273 ], [-2.83463041], [-8.25373464], [-7.14256833], [-5.95475986], [-3.63056025], [ 0. ], [ 0.019 ]]) + #_# limo: array([[ 0.00923437], [ 0.0187724 ], [ 4.64436493], [ 3.36198822], [-0.99645946], [-0.76579606], [ 1.4350995 ], [ 1.30730324], [ 1.00327543], [ 1.03205863], [ 4.09201677], [ 0.71692158], [ 0. ], [ 0.08 ]]) + #_# nbc: array([[ 0.9692341 ], [ 0.9247079 ], [ 0.615248 ], [ 0.12547091], [-0.15670592], [ 0. ], [ 0.141 ]]) + #_# pca: array([[1. ], [1. ], [0.66666667], [1. ], [0.51736999], [0.51736999], [0.85671748], [0.34519856], [0. ], [0.005 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.146 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.125 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.215 ]]) + #_# ic: array([[0.66510282], [1.06606607], [1.33390569], [0.34534535], [0.41164659], [0. ], [3.473 ]]) + + #_# Represented: 1 + + ''' + for x in args: + if x < -10 or x > 10: + return 0 + return (0.26*(args[0]**2+args[1]**2))-(0.48*args[0]*args[1]) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/McCormick.py b/MDAF/TestFunctions/McCormick.py index 19bc74d..626cd48 100644 --- a/MDAF/TestFunctions/McCormick.py +++ b/MDAF/TestFunctions/McCormick.py @@ -1,19 +1,38 @@ -import math -def main(args): - ''' - >>> main([-0.547, -1.547]) - 0 - - #_# dimmensions: 2 - #_# upper: [4, 3] - #_# lower: [-1.5, -3] - #_# minimum: [-0.547, -1.547] - - ''' - for args[0] in args: - if args[0] < -1.5 or args[0] > 4: - return 0 - if args[1] < -3 or args[1] > 3: - return 0 - return math.sin(args[0]+args[1])+(args[0]-args[1])**2-(3*args[0]/2)+(5*args[1]/2)+1 - +import math +def main(args): + ''' + >>> main([-0.547, -1.547]) + 0 + + #_# dimmensions: 2 + #_# upper: [4, 3] + #_# lower: [-1.5, -3] + #_# minimum: [-0.547, -1.547] + + + #_# cm_angle: array([[4.79655921e-01], [8.11936213e-02], [4.88211174e-01], [1.07483727e-01], [1.33682197e+02], [3.67619007e+01], [2.30397221e-01], [1.37221691e-01], [0.00000000e+00], [2.01000000e-01]]) + #_# cm_conv: array([[0.21153846], [0.26923077], [0.42307692], [0.5 ], [0. ], [0.027 ]]) + #_# cm_grad: array([[0.49274828], [0.20494858], [0. ], [0.109 ]]) + #_# ela_conv: array([[ 5.23000000e-01], [ 6.40000000e-02], [-4.33119868e-02], [ 4.52749148e-01], [ 1.00000000e+03], [ 9.30000000e-01]]) + #_# ela_curv: array([[0.00000000e+00], [6.60123298e-02], [1.13726422e+00], [8.27679117e-01], [2.26227704e+00], [2.99972944e+00], [1.07998791e+00], [0.00000000e+00], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [1.00000000e+00], [2.34705377e+31], [1.33653041e+32], [2.76738243e+43], [3.06857759e+32], [1.76598753e+33], [4.20642129e+45], [3.41185819e+44], [2.40000000e-01], [6.91200000e+03], [6.00200000e+00]]) + #_# ela_distr: array([[ 0.0181841 ], [-1.63507361], [12. ], [ 0. ], [ 0.061 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.39811853e+01], [2.69896532e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [1.50000000e+01], [3.50000000e+01], [3.86500000e+01], [3.50000000e+01], [4.00000000e+01], [9.00000000e+01], [1.21824306e+01], [3.95500000e+03], [2.61600000e+00]]) + #_# ela_meta: array([[7.30261112e-01], [1.13852108e+00], [9.51105546e-03], [7.09257303e-01], [7.45718818e+01], [7.29753124e-01], [7.45345090e-01], [5.48101514e+01], [8.54982158e-01], [0.00000000e+00], [2.10000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-3.00000000e+00], [-1.50000000e+00], [ 3.00000000e+00], [ 4.00000000e+00], [-9.13214414e-01], [ 3.70619827e+00], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 8.00000000e-03]]) + #_# disp: array([[ 0.69824464], [ 0.57516619], [ 0.60862598], [ 0.72790887], [ 0.62815957], [ 0.51038512], [ 0.5407675 ], [ 0.68677358], [-0.90741644], [-1.27752888], [-1.17691106], [-0.81821236], [-1.09792521], [-1.44567528], [-1.35596587], [-0.92485687], [ 0. ], [ 0.046 ]]) + #_# limo: array([[ 0.56331375], [ 0.20065392], [ 1.2654151 ], [ 0.70848297], [ 0.21529824], [ 0.16062147], [64.72433949], [78.56284868], [19.38461576], [19.9408798 ], [ 0.70889543], [ 0.52253235], [ 0. ], [ 0.129 ]]) + #_# nbc: array([[ 0.09254937], [ 0.53435349], [ 0.06239459], [ 0.39324102], [-0.12397028], [ 0. ], [ 0.295 ]]) + #_# pca: array([[1. ], [1. ], [0.66666667], [0.66666667], [0.54333567], [0.50009135], [0.6210759 ], [0.61850382], [0. ], [0.006 ]]) + #_# gcm: array([[3. ], [0.08333333], [0.91666667], [0.47222222], [0.17149337], [0.33333333], [0.31433059], [0.51417604], [0.17212984], [0.08333333], [0.17592593], [0.16666667], [0.27777778], [0.09755235], [0.52777778], [0.16666667], [0.33333333], [0.27777778], [0.55555556], [0.2003084 ], [1. ], [0.51417604], [0.02777778], [0. ], [0.057 ], [3. ], [0.08333333], [0.91666667], [0.83333333], [0.24650735], [0.33333333], [0.36352909], [0.38996356], [0.07634631], [0.02777778], [0.05555556], [0.02777778], [0.11111111], [0.04811252], [0.16666667], [0.27777778], [0.33333333], [0.33333333], [0.38888889], [0.05555556], [1. ], [0.38996356], [0.02777778], [0. ], [0.065 ], [5. ], [0.13888889], [0.86111111], [0.38888889], [0.04852265], [0.2 ], [0.08843509], [0.61095929], [0.23656898], [0.02777778], [0.12222222], [0.05555556], [0.41666667], [0.16620306], [0.61111111], [0.02777778], [0.2 ], [0.08333333], [0.58333333], [0.23107371], [1. ], [0.61095929], [0.02777778], [0. ], [0.11 ]]) + #_# ic: array([[ 0.65342543], [ 0.48548549], [ 0.44120929], [-0.15515516], [ 0.35140562], [ 0. ], [ 0.614 ]]) + + #_# Represented: 1 + + ''' + for args[0] in args: + if args[0] < -1.5 or args[0] > 4: + return 0 + if args[1] < -3 or args[1] > 3: + return 0 + return math.sin(args[0]+args[1])+(args[0]-args[1])**2-(3*args[0]/2)+(5*args[1]/2)+1 + diff --git a/MDAF/TestFunctions/Miele_Cantrell.py b/MDAF/TestFunctions/Miele_Cantrell.py index d1e8c92..e9d9679 100644 --- a/MDAF/TestFunctions/Miele_Cantrell.py +++ b/MDAF/TestFunctions/Miele_Cantrell.py @@ -1,20 +1,41 @@ -import math - - -def main(args): - ''' - >>> main([0, 1, 1, 1]) - 0.0 - - #_# dimmensions: 4 - #_# upper: 1 - #_# lower: -1 - #_# minimum: [0, 1, 1, 1] - - ''' - for x in args: - if x < -1 or x > 1: - return 0 - return (math.exp(-args[0])-args[1])**4+(100*(args[1]-args[2])**6)+(math.tan(args[2]-args[3]))**4+args[0]**8 - - +import math + + +def main(args): + ''' + >>> main([0, 1, 1, 1]) + 0.0 + + #_# dimmensions: 4 + #_# upper: 1 + #_# lower: -1 + #_# minimum: [0, 1, 1, 1] + + + #_# cm_angle: array([[3.75299977e-01], [9.16367331e-02], [3.89890198e-01], [8.09797236e-02], [1.16758566e+02], [2.78473090e+01], [1.23458075e-02], [1.11111097e-01], [0.00000000e+00], [7.60000000e-02]]) + #_# cm_conv: array([[0.32704403], [0.16981132], [0.7672956 ], [0.2327044 ], [0. ], [0.037 ]]) + #_# cm_grad: array([[0.55759138], [0.15129977], [0. ], [0.05 ]]) + #_# ela_conv: array([[ 9.84000000e-01], [ 0.00000000e+00], [-1.81107191e+12], [ 1.81107195e+12], [ 1.00000000e+03], [ 1.83000000e-01]]) + #_# ela_curv: array([[4.59251014e-03], [4.59432669e+01], [7.25903432e+16], [2.26265004e+02], [2.25001761e+03], [2.90361227e+19], [1.45180613e+18], [0.00000000e+00], [1.12825899e+00], [4.79171886e+01], [9.64763787e+09], [4.36604639e+02], [1.19082182e+04], [3.63515965e+12], [1.82331555e+11], [5.00000000e-03], [2.00415263e+01], [6.50203180e+02], [2.88747261e+29], [6.19921213e+03], [7.87865180e+04], [1.15210157e+32], [5.76772202e+30], [2.50000000e-03], [4.55820000e+04], [7.60800000e+00]]) + #_# ela_distr: array([[2.22266946e+01], [4.93011988e+02], [2.00000000e+00], [0.00000000e+00], [3.10000000e-02]]) + #_# ela_local: array([[1.80000000e+02], [9.00000000e-01], [8.74382175e-10], [2.61767590e-02], [5.00000000e-03], [5.55865922e-03], [2.00000000e-02], [1.26000000e+02], [2.52000000e+02], [2.70180000e+02], [2.79000000e+02], [2.97000000e+02], [3.51000000e+02], [3.70031589e+01], [5.42160000e+04], [8.29600000e+00]]) + #_# ela_meta: array([[3.89680793e-03], [1.85923905e+12], [2.67768085e+12], [5.01387923e+12], [1.87247081e+00], [2.72361921e-02], [3.75224754e-03], [1.19786016e+01], [5.83302049e-02], [0.00000000e+00], [1.30000000e-02]]) + #_# basic: array([[ 4.00000000e+00], [ 5.00000000e+02], [-1.00000000e+00], [-1.00000000e+00], [ 1.00000000e+00], [ 1.00000000e+00], [ 1.66137655e-04], [ 9.29611415e+14], [ 3.00000000e+00], [ 3.00000000e+00], [ 8.10000000e+01], [ 8.10000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.50914018], [ 0.55768631], [ 0.68735244], [ 0.80703134], [ 0.5012527 ], [ 0.53109761], [ 0.65052227], [ 0.77077511], [-0.76539352], [-0.68969595], [-0.48750867], [-0.30089438], [-0.78236498], [-0.73554846], [-0.54821177], [-0.35957594], [ 0. ], [ 0.01 ]]) + #_# limo: array([[ 1.44205073e+14], [ 1.00491339e-01], [ 1.44205311e+14], [ 1.24049908e+15], [-1.27176047e-12], [-7.08803604e-02], [ 5.40668459e+01], [ 3.65392091e+02], [ 1.05485027e+01], [ 1.68505590e+00], [ 5.30094670e+14], [ 4.90433891e-01], [ 0.00000000e+00], [ 7.50000000e-02]]) + #_# nbc: array([[ 0.81787766], [ 0.95413745], [ 0.64535624], [ 0.07938043], [-0.03958228], [ 0. ], [ 0.027 ]]) + #_# pca: array([[1. ], [1. ], [0.2 ], [1. ], [0.26471831], [0.2647148 ], [1. ], [0.22098215], [0. ], [0.003 ]]) + #_# gcm: array([[1. ], [0.01234568], [0.98765432], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.01234568], [0. ], [0.124 ], [1. ], [0.01234568], [0.98765432], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.01234568], [0. ], [0.108 ], [1. ], [0.01234568], [0.98765432], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.01234568], [0. ], [0.106 ]]) + #_# ic: array([[ 0.64944594], [ 9.85485485], [26.09346574], [ 2.38738739], [ 0.43373494], [ 0. ], [ 0.189 ]]) + + #_# Represented: 1 + + ''' + for x in args: + if x < -1 or x > 1: + return 0 + return (math.exp(-args[0])-args[1])**4+(100*(args[1]-args[2])**6)+(math.tan(args[2]-args[3]))**4+args[0]**8 + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Periodic.py b/MDAF/TestFunctions/Periodic.py new file mode 100644 index 0000000..0bddd36 --- /dev/null +++ b/MDAF/TestFunctions/Periodic.py @@ -0,0 +1,37 @@ +import math + +def main(args): + ''' + >>> (main([0,0]) - 0.9)<0.001 + True + + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: -10 + #_# minimum: [0,0] + + #_# cm_angle: array([[1.75593580e+00], [2.65321236e-01], [4.87617228e-01], [2.59067658e-01], [1.31559946e+02], [4.22034384e+01], [8.81116275e-01], [6.32096982e-02], [0.00000000e+00], [6.81000000e-01]]) + #_# cm_conv: array([[0.28846154], [0.32692308], [0.46153846], [0.53846154], [0. ], [0.13 ]]) + #_# cm_grad: array([[0.27864322], [0.13841195], [0. ], [0.433 ]]) + #_# ela_conv: array([[4.16000000e-01], [0.00000000e+00], [9.44507865e-02], [4.63473862e-01], [1.00000000e+03], [2.05200000e+00]]) + #_# ela_curv: array([[1.96335006e-02], [7.90494696e-01], [9.40517924e-01], [9.70508422e-01], [1.15146017e+00], [1.40827470e+00], [2.96278026e-01], [0.00000000e+00], [1.00042900e+00], [1.20667873e+00], [1.37489634e+01], [1.74597326e+00], [3.87776532e+00], [1.54010785e+03], [1.10794257e+02], [0.00000000e+00], [1.00004273e+00], [1.15887166e+00], [6.45569964e+00], [1.65200491e+00], [3.28908531e+00], [2.84602626e+02], [2.66078823e+01], [0.00000000e+00], [8.40000000e+03], [7.87500000e+00]]) + #_# ela_distr: array([[ 0.10282964], [-0.79626524], [ 4. ], [ 0. ], [ 0.066 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [9.04018379e-01], [9.55549808e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [2.50000000e+01], [3.00000000e+01], [4.13500000e+01], [4.00000000e+01], [4.50000000e+01], [9.00000000e+01], [1.30239678e+01], [4.22500000e+03], [2.58300000e+00]]) + #_# ela_meta: array([[-5.92296020e-03], [ 1.95370338e+00], [ 3.86726095e-04], [ 1.04562694e-03], [ 2.70379204e+00], [-7.97249787e-03], [ 1.22049304e-02], [ 1.04972191e+00], [ 1.38023108e-05], [ 0.00000000e+00], [ 5.90000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+01], [-1.00000000e+01], [ 1.00000000e+01], [ 1.00000000e+01], [ 1.00605701e+00], [ 2.99797225e+00], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[1.24018699], [1.09742031], [1.05147535], [1.03706056], [1.2976655 ], [1.10184985], [1.01192384], [1.01497513], [2.50946641], [1.0178444 ], [0.53781287], [0.38720762], [3.0525099 ], [1.04445318], [0.12227698], [0.15356744], [0. ], [0.047 ]]) + #_# limo: array([[ 1.02009742e-02], [ 7.78878285e-02], [ 2.22441463e-01], [ 9.89624222e-02], [-1.80105180e-01], [-1.10989188e-01], [ 7.45768785e+00], [ 2.52375269e+01], [ 1.00637086e+00], [ 1.05016349e+00], [ 1.74039998e-01], [ 7.14744674e-01], [ 0.00000000e+00], [ 2.45000000e-01]]) + #_# nbc: array([[ 0.10083485], [ 0.69048795], [ 0.09078319], [ 0.26259763], [-0.63877451], [ 0. ], [ 0.237 ]]) + #_# pca: array([[1. ], [1. ], [0.66666667], [1. ], [0.50356834], [0.5035681 ], [0.50162655], [0.33870974], [0. ], [0.012 ]]) + #_# gcm: array([[5. ], [0.13888889], [0.86111111], [0.55555556], [0.11298693], [0.2 ], [0.22371662], [0.31365693], [0.08447559], [0.02777778], [0.08888889], [0.05555556], [0.16666667], [0.06022079], [0.44444444], [0.05555556], [0.2 ], [0.22222222], [0.33333333], [0.11520245], [1. ], [0.23060847], [0.02777778], [0. ], [0.177 ], [3. ], [0.08333333], [0.91666667], [0.33333333], [0.12484877], [0.33333333], [0.24342663], [0.6317246 ], [0.26512862], [0.05555556], [0.22222222], [0.13888889], [0.47222222], [0.22047928], [0.66666667], [0.11111111], [0.33333333], [0.22222222], [0.66666667], [0.29397237], [1. ], [0.6317246 ], [0.02777778], [0. ], [0.174 ], [6. ], [0.16666667], [0.83333333], [0.66666667], [0.08031645], [0.16666667], [0.15416039], [0.28511054], [0.09222196], [0.02777778], [0.05555556], [0.02777778], [0.11111111], [0.04303315], [0.33333333], [0.05555556], [0.16666667], [0.15277778], [0.30555556], [0.10971343], [1. ], [0.21749947], [0.02777778], [0. ], [0.19 ]]) + #_# ic: array([[ 0.84108627], [ 0.10510511], [ 0.35038422], [-0.25525526], [ 0.51004016], [ 0. ], [ 1.611 ]]) + + #_# Represented: 1 + + ''' + return 1 + (math.sin(args[0]))**2 + (math.sin(args[1]))**2 - 0.1*math.exp(-1*(args[0]**2+args[1]**2)) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/PowellSingular2.py b/MDAF/TestFunctions/PowellSingular2.py new file mode 100644 index 0000000..05794a0 --- /dev/null +++ b/MDAF/TestFunctions/PowellSingular2.py @@ -0,0 +1,38 @@ +def main(args): + ''' + >>> main([0,1]) + 0.26 + + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: -10 + #_# minimum: [0, 0] + + #_# cm_angle: array([[1.72687084e+00], [3.37616437e-01], [1.71737114e+00], [3.02628823e-01], [1.56338002e+02], [2.86853412e+01], [1.67456186e-01], [1.24716212e-01], [0.00000000e+00], [4.41000000e-01]]) + #_# cm_conv: array([[0.15384615], [0.03846154], [0.90384615], [0.09615385], [0. ], [0.095 ]]) + #_# cm_grad: array([[0.61833837], [0.16843864], [0. ], [0.275 ]]) + #_# ela_conv: array([[ 1. ], [ 0. ], [ -5.64305849], [ 5.64305849], [1000. ], [ 2.429 ]]) + #_# ela_curv: array([[1.63575377e-01], [2.20415461e+00], [4.94818747e+00], [4.51813203e+00], [6.93836237e+00], [1.38423798e+01], [3.41567146e+00], [0.00000000e+00], [1.00040299e+00], [1.02549743e+00], [1.66816563e+00], [1.08077600e+00], [1.19961834e+00], [4.93317726e+01], [3.60726942e+00], [0.00000000e+00], [2.41146862e+01], [2.49993697e+01], [2.50169546e+01], [2.50000062e+01], [2.50005403e+01], [2.98899674e+01], [3.52427484e-01], [0.00000000e+00], [8.40000000e+03], [8.95900000e+00]]) + #_# ela_distr: array([[ 1.49614177], [ 1.67232497], [10. ], [ 0. ], [ 0.177 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [5.30648854e-21], [4.28445835e-02], [1.10000000e-01], [1.00000000e-02], [1.00000000e-02], [3.00000000e+01], [3.00000000e+01], [3.72500000e+01], [3.50000000e+01], [4.00000000e+01], [5.00000000e+01], [6.60482682e+00], [3.81500000e+03], [4.88600000e+00]]) + #_# ela_meta: array([[-5.99180556e-03], [ 1.73424739e+01], [ 1.13296648e-02], [ 3.02061952e-02], [ 2.66611553e+00], [ 6.76088550e-01], [ 3.08804921e-01], [ 1.05378572e+00], [ 1.00000000e+00], [ 0.00000000e+00], [ 4.50000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+01], [-1.00000000e+01], [ 1.00000000e+01], [ 1.00000000e+01], [ 3.94123323e-02], [ 9.58060311e+01], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 6.00000000e-03]]) + #_# disp: array([[ 0.20017882], [ 0.3466614 ], [ 0.47152394], [ 0.73189895], [ 0.18256697], [ 0.29941406], [ 0.42068075], [ 0.64680121], [-8.35813625], [-6.82739241], [-5.52257801], [-2.80165759], [-8.38289195], [-7.18460842], [-5.94100128], [-3.62210378], [ 0. ], [ 0.08 ]]) + #_# limo: array([[ 0.0076275 ], [ 0.04352783], [ 4.59032574], [ 3.37431915], [-0.99680174], [-0.78645868], [ 1.6684111 ], [ 1.89992235], [ 1.00276411], [ 1.05808151], [ 4.06565053], [ 0.71617234], [ 0. ], [ 0.251 ]]) + #_# nbc: array([[ 0.97588027], [ 0.92925913], [ 0.66072979], [ 0.12028974], [-0.16369731], [ 0. ], [ 0.557 ]]) + #_# pca: array([[1. ], [1. ], [0.66666667], [1. ], [0.50010419], [0.50009539], [0.84862858], [0.33652414], [0. ], [0.005 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.317 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.348 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.398 ]]) + #_# ic: array([[0.66930481], [1.04604605], [1.39683512], [0.36536537], [0.37550201], [0. ], [2.859 ]]) + + #_# Represented: 1 + + ''' + for x in args: + if x < -10 or x > 10: + return 0 + return (0.26*(args[0]**2+args[1]**2))-(0.48*args[0]*args[1]) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Price1.py b/MDAF/TestFunctions/Price1.py new file mode 100644 index 0000000..94c52a1 --- /dev/null +++ b/MDAF/TestFunctions/Price1.py @@ -0,0 +1,35 @@ +def main(args): + ''' + >>> main([5,5]) + 0 + + + #_# dimmensions: 2 + #_# upper: 500 + #_# lower: -500 + #_# minimum: [5, -5] + + #_# cm_angle: array([[8.42995060e+01], [1.48465167e+01], [8.85937471e+01], [1.22477660e+01], [1.56556548e+02], [1.64601666e+01], [2.62117969e-01], [1.07318701e-01], [0.00000000e+00], [3.81000000e-01]]) + #_# cm_conv: array([[0.23076923], [0.01923077], [0.90384615], [0.09615385], [0. ], [0.077 ]]) + #_# cm_grad: array([[0.66304389], [0.11459043], [0. ], [0.176 ]]) + #_# ela_conv: array([[ 1.0000000e+00], [ 0.0000000e+00], [-5.4165993e+04], [ 5.4165993e+04], [ 1.0000000e+03], [ 1.0510000e+00]]) + #_# ela_curv: array([[1.11653166e+02], [5.87342803e+02], [7.76324203e+02], [8.09746028e+02], [9.75220399e+02], [1.27658179e+03], [2.68311668e+02], [0.00000000e+00], [1.00877643e+00], [1.39213209e+00], [4.66136091e+00], [1.90521110e+00], [3.34958045e+00], [1.10941818e+02], [1.15327155e+01], [0.00000000e+00], [1.00000002e+00], [1.00000129e+00], [1.00065585e+00], [1.00000229e+00], [1.00000435e+00], [1.10032917e+00], [7.36581030e-03], [0.00000000e+00], [8.40000000e+03], [5.63500000e+00]]) + #_# ela_distr: array([[ 0.45479172], [-0.44239297], [ 2. ], [ 0. ], [ 0.078 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [2.36306319e-10], [3.39801109e-02], [3.00000000e-02], [1.08988764e-02], [1.00000000e-02], [2.50000000e+01], [3.00000000e+01], [3.32000000e+01], [3.50000000e+01], [3.50000000e+01], [4.00000000e+01], [3.13983851e+00], [3.41000000e+03], [2.00400000e+00]]) + #_# ela_meta: array([[-6.08141078e-03], [ 1.61741156e+05], [ 4.69187877e-01], [ 4.87943868e-01], [ 1.03997544e+00], [-4.82793266e-03], [ 9.99975314e-01], [ 1.00020587e+00], [ 9.99975022e-01], [ 0.00000000e+00], [ 5.90000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-5.00000000e+02], [-5.00000000e+02], [ 5.00000000e+02], [ 5.00000000e+02], [ 1.42515936e+02], [ 4.55661620e+05], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 0.00000000e+00]]) + #_# disp: array([[ 1.54548192e-01], [ 2.36533792e-01], [ 3.20672384e-01], [ 5.01832640e-01], [ 1.61683546e-01], [ 2.35092782e-01], [ 3.19484619e-01], [ 5.02431697e-01], [-4.41822856e+02], [-3.98978176e+02], [-3.55008369e+02], [-2.60336217e+02], [-4.30399953e+02], [-3.92710925e+02], [-3.49383323e+02], [-2.55456484e+02], [ 0.00000000e+00], [ 7.00000000e-02]]) + #_# limo: array([[ 2.30080234e+00], [ 2.94677297e-03], [ 7.45052475e+02], [ 2.78527250e+02], [-6.90102908e-03], [ 2.84166012e-03], [ 2.56700894e+00], [ 1.63021264e+00], [ 1.00639041e+00], [ 1.00376955e+00], [ 5.69442133e+02], [ 7.17132783e-01], [ 0.00000000e+00], [ 2.48000000e-01]]) + #_# nbc: array([[ 0.97863618], [ 0.92457637], [ 0.69441449], [ 0.12402379], [-0.24483581], [ 0. ], [ 0.222 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.51467844], [0.51467818], [0.99998406], [0.34316251], [0. ], [0.071 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.269 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.258 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.303 ]]) + #_# ic: array([[ 0.7410432 ], [ 3.04804805], [233.00614107], [ 2.56756757], [ 0.40160643], [ 0. ], [ 5.173 ]]) + + #_# Represented: 1 + + ''' + return (abs(args[0])-5)**2 + (abs(args[1])-5)**2 + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Price2.py b/MDAF/TestFunctions/Price2.py new file mode 100644 index 0000000..6fc57b3 --- /dev/null +++ b/MDAF/TestFunctions/Price2.py @@ -0,0 +1,37 @@ +import math + +def main(args): + ''' + >>> main([0,0]) + 0.9 + + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: -10 + #_# minimum: [0, 0] + + #_# cm_angle: array([[1.75661603e+00], [2.63859171e-01], [5.96095293e-01], [2.63941004e-01], [1.16275803e+02], [4.20577763e+01], [8.57863898e-01], [6.87176980e-02], [0.00000000e+00], [4.08000000e-01]]) + #_# cm_conv: array([[0.30769231], [0.32692308], [0.48076923], [0.51923077], [0. ], [0.187 ]]) + #_# cm_grad: array([[0.23494251], [0.10227272], [0. ], [0.266 ]]) + #_# ela_conv: array([[4.64000000e-01], [0.00000000e+00], [5.63853017e-02], [4.64547915e-01], [1.00000000e+03], [1.21400000e+00]]) + #_# ela_curv: array([[1.04408920e-01], [8.03585314e-01], [9.49148744e-01], [9.89240017e-01], [1.15995337e+00], [1.40275676e+00], [2.81185531e-01], [0.00000000e+00], [1.00361930e+00], [1.22644620e+00], [1.81060905e+01], [1.65552178e+00], [3.49431880e+00], [2.45973637e+03], [1.74681314e+02], [0.00000000e+00], [1.00293880e+00], [1.20920596e+00], [7.35366857e+00], [1.68309027e+00], [2.83416024e+00], [5.43824586e+02], [3.99362058e+01], [0.00000000e+00], [8.40000000e+03], [5.58300000e+00]]) + #_# ela_distr: array([[ 0.07393764], [-0.70855076], [ 1. ], [ 0. ], [ 0.069 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [9.02004974e-01], [9.77772030e-01], [1.00000000e-02], [1.11363636e-02], [1.00000000e-02], [2.00000000e+01], [3.00000000e+01], [4.28000000e+01], [4.00000000e+01], [5.00000000e+01], [1.00000000e+02], [1.38228328e+01], [4.37000000e+03], [2.59800000e+00]]) + #_# ela_meta: array([[-5.75969383e-03], [ 1.95291200e+00], [ 7.92387276e-04], [ 1.30316768e-03], [ 1.64460954e+00], [-7.75440336e-03], [ 1.15951933e-02], [ 1.21334296e+00], [-3.10059796e-04], [ 0.00000000e+00], [ 5.30000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+01], [-1.00000000e+01], [ 1.00000000e+01], [ 1.00000000e+01], [ 1.00273010e+00], [ 2.99081922e+00], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 1.30996457], [ 1.06566854], [ 1.11128617], [ 1.07920693], [ 1.30522843], [ 0.99655391], [ 1.1112091 ], [ 1.07463121], [ 3.23828116], [ 0.68605646], [ 1.16263576], [ 0.82749554], [ 3.13030347], [-0.0353417 ], [ 1.14051703], [ 0.76538855], [ 0. ], [ 0.156 ]]) + #_# limo: array([[ 0.01212125], [ 0.02998847], [ 0.21010248], [ 0.0971796 ], [ 0.02243501], [ 0.02596672], [ 7.60024436], [11.45182318], [ 1.04233173], [ 1.0270098 ], [ 0.16533836], [ 0.716751 ], [ 0. ], [ 0.482 ]]) + #_# nbc: array([[ 0.10731126], [ 0.69371051], [ 0.07385441], [ 0.26244542], [-0.62853101], [ 0. ], [ 0.426 ]]) + #_# pca: array([[1. ], [1. ], [0.66666667], [1. ], [0.50998132], [0.50998089], [0.50812326], [0.34345339], [0. ], [0.027 ]]) + #_# gcm: array([[7. ], [0.19444444], [0.80555556], [0.66666667], [0.09454594], [0.14285714], [0.11484541], [0.29185606], [0.07241316], [0.02777778], [0.04761905], [0.02777778], [0.11111111], [0.03090826], [0.33333333], [0.02777778], [0.14285714], [0.11111111], [0.36111111], [0.11275243], [1. ], [0.18140016], [0.02777778], [0. ], [0.396 ], [6. ], [0.16666667], [0.83333333], [0.75 ], [0.11878172], [0.16666667], [0.15022098], [0.26560387], [0.05358846], [0.02777778], [0.04166667], [0.02777778], [0.08333333], [0.02324056], [0.25 ], [0.05555556], [0.16666667], [0.13888889], [0.30555556], [0.0860663 ], [1. ], [0.26560387], [0.02777778], [0. ], [0.335 ], [4. ], [0.11111111], [0.88888889], [0.44444444], [0.12066382], [0.25 ], [0.2662074 ], [0.34692138], [0.09797158], [0.05555556], [0.13888889], [0.13888889], [0.22222222], [0.06804138], [0.55555556], [0.13888889], [0.25 ], [0.26388889], [0.33333333], [0.08784105], [1. ], [0.23343294], [0.02777778], [0. ], [0.279 ]]) + #_# ic: array([[ 0.84539897], [ 0.10510511], [ 0.33459891], [-0.23523524], [ 0.53413655], [ 0. ], [ 2.83 ]]) + + #_# Represented: 1 + + ''' + return 1 + math.sin(args[0])**2 + math.sin(args[1])**2 - 0.1*math.exp(-args[0]**2 - args[1]**2) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Quartic.py b/MDAF/TestFunctions/Quartic.py new file mode 100644 index 0000000..04fe39a --- /dev/null +++ b/MDAF/TestFunctions/Quartic.py @@ -0,0 +1,36 @@ +def main(args): + ''' + >>> (main([0,0]) - 0)<0.001 + True + + + #_# dimmensions: 2 + #_# upper: 1.28 + #_# lower: -1.28 + #_# minimum: [0,0] + + #_# cm_angle: array([[2.28732911e-01], [3.42198479e-02], [2.27981888e-01], [2.88543430e-02], [1.41047881e+02], [3.07397993e+01], [2.96369677e-01], [3.09950141e-01], [0.00000000e+00], [3.13000000e-01]]) + #_# cm_conv: array([[0.34615385], [0.21153846], [0.75 ], [0.25 ], [0. ], [0.112 ]]) + #_# cm_grad: array([[0.73045088], [0.08506376], [0. ], [0.327 ]]) + #_# ela_conv: array([[ 1.00000000e+00], [ 0.00000000e+00], [-2.40937341e-01], [ 2.40937341e-01], [ 1.00000000e+03], [ 7.27000000e-01]]) + #_# ela_curv: array([[3.72242059e-08], [9.48329481e-02], [2.05700561e+00], [1.05267640e+00], [3.50034976e+00], [8.16463320e+00], [2.33324660e+00], [0.00000000e+00], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [1.00000000e+00], [4.09164119e+26], [8.81710349e+31], [2.16732341e+48], [8.02718253e+32], [1.13455546e+34], [4.31407945e+50], [3.05047191e+49], [0.00000000e+00], [7.20000000e+03], [5.40500000e+00]]) + #_# ela_distr: array([[ 1.37993858], [ 0.76815234], [19. ], [ 0. ], [ 0.067 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [3.43703095e-05], [1.28224441e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [1.00000000e+01], [6.00000000e+01], [6.50500000e+01], [7.00000000e+01], [7.00000000e+01], [8.00000000e+01], [1.26230309e+01], [6.59500000e+03], [5.71500000e+00]]) + #_# ela_meta: array([[-6.05810774e-03], [ 5.37082658e-01], [ 1.00626943e-03], [ 4.94907310e-03], [ 4.91823854e+00], [-6.78386609e-03], [ 9.17621371e-01], [ 2.77835123e+03], [ 9.16778369e-01], [ 0.00000000e+00], [ 1.27000000e-01]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.28000000e+00], [-1.28000000e+00], [ 1.28000000e+00], [ 1.28000000e+00], [ 1.95743463e-11], [ 2.66013724e+00], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 6.00000000e-03]]) + #_# disp: array([[ 0.74444343], [ 0.6661381 ], [ 0.65798176], [ 0.68871576], [ 0.68710578], [ 0.59756979], [ 0.58986507], [ 0.61116501], [-0.34170832], [-0.44641148], [-0.45731743], [-0.41622257], [-0.41031759], [-0.52773169], [-0.53783537], [-0.50990343], [ 0. ], [ 0.182 ]]) + #_# limo: array([[ 2.35317534e-02], [ 4.09691758e-03], [ 2.04301091e+00], [ 2.14564471e+00], [-1.88091351e-02], [-2.03757265e-01], [ 1.43046140e+02], [ 3.44477421e+02], [ 4.61654352e+01], [ 1.11911572e+01], [ 1.52328602e+00], [ 5.50207602e-01], [ 0.00000000e+00], [ 4.37000000e-01]]) + #_# nbc: array([[ 0.21375898], [ 0.87378734], [ 0.16212722], [ 0.14843798], [-0.22062627], [ 0. ], [ 0.472 ]]) + #_# pca: array([[1. ], [1. ], [1. ], [1. ], [0.51090559], [0.51090557], [0.3476604 ], [0.34073584], [0. ], [0.006 ]]) + #_# gcm: array([[2. ], [0.05555556], [0.94444444], [0.66666667], [0.23887649], [0.5 ], [0.5 ], [0.76112351], [0.3692844 ], [0.02777778], [0.16666667], [0.16666667], [0.30555556], [0.19641855], [0.33333333], [0.25 ], [0.5 ], [0.5 ], [0.75 ], [0.35355339], [1. ], [0.76112351], [0.02777778], [0. ], [0.309 ], [2. ], [0.05555556], [0.94444444], [0.58333333], [0.38622662], [0.5 ], [0.5 ], [0.61377338], [0.16089986], [0.13888889], [0.20833333], [0.20833333], [0.27777778], [0.09820928], [0.41666667], [0.33333333], [0.5 ], [0.5 ], [0.66666667], [0.23570226], [1. ], [0.61377338], [0.02777778], [0. ], [0.309 ], [3. ], [0.08333333], [0.91666667], [0.86111111], [0.23984373], [0.33333333], [0.26962253], [0.49053374], [0.13695134], [0.02777778], [0.0462963 ], [0.05555556], [0.05555556], [0.01603751], [0.13888889], [0.13888889], [0.33333333], [0.33333333], [0.52777778], [0.19444444], [1. ], [0.26962253], [0.02777778], [0. ], [0.23 ]]) + #_# ic: array([[ 0.51678994], [ 0.82582583], [ 0.53054805], [-0.31531532], [ 0.37349398], [ 0. ], [ 2.709 ]]) + + #_# Represented: 1 + + ''' + vals = [i*x**4 for i,x in enumerate(args)] + return sum(vals) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Rastriring.py b/MDAF/TestFunctions/Rastriring.py new file mode 100644 index 0000000..bcaddf7 --- /dev/null +++ b/MDAF/TestFunctions/Rastriring.py @@ -0,0 +1,38 @@ +import math + +def main(args): + ''' + >>> (main([0,0]) - 0)<0.001 + True + + + #_# dimmensions: 2 + #_# upper: 5.12 + #_# lower: -5.12 + #_# minimum: [0,0] + + #_# cm_angle: array([[5.87139339e-01], [2.50148614e-01], [5.39132964e-01], [2.87449942e-01], [1.16642840e+02], [4.26135413e+01], [4.82701426e-01], [6.47550685e-02], [0.00000000e+00], [3.73000000e-01]]) + #_# cm_conv: array([[0.26923077], [0.19230769], [0.44230769], [0.55769231], [0. ], [0.088 ]]) + #_# cm_grad: array([[0.32940512], [0.14284079], [0. ], [0.351 ]]) + #_# ela_conv: array([[ 6.52000000e-01], [ 0.00000000e+00], [-5.75302336e+00], [ 1.19391378e+01], [ 1.00000000e+03], [ 9.72000000e-01]]) + #_# ela_curv: array([[3.14155067e+00], [4.70454711e+01], [5.91093992e+01], [6.14106784e+01], [7.35309119e+01], [9.73695232e+01], [1.95193801e+01], [0.00000000e+00], [1.00069440e+00], [1.18483732e+00], [4.10205349e+00], [1.77600602e+00], [2.93799708e+00], [4.71444119e+01], [7.49427603e+00], [0.00000000e+00], [1.00007229e+00], [1.17324533e+00], [3.52835610e+00], [1.56143224e+00], [2.79027274e+00], [8.50533816e+01], [7.05663035e+00], [0.00000000e+00], [8.40000000e+03], [6.89500000e+00]]) + #_# ela_distr: array([[ 0.08411456], [-0.42273661], [ 1. ], [ 0. ], [ 0.14 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.24736370e-15], [3.14890101e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [4.00000000e+01], [5.50000000e+01], [6.71000000e+01], [7.00000000e+01], [7.50000000e+01], [1.30000000e+02], [1.63017629e+01], [6.80000000e+03], [6.69400000e+00]]) + #_# ela_meta: array([[-6.03378217e-03], [ 3.70497354e+01], [ 6.54354467e-03], [ 3.36946885e-02], [ 5.14930212e+00], [-7.72510669e-03], [ 4.81101589e-01], [ 1.01316122e+00], [ 4.75836669e-01], [ 0.00000000e+00], [ 4.40000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-5.12000000e+00], [-5.12000000e+00], [ 5.12000000e+00], [ 5.12000000e+00], [ 1.83249306e+00], [ 7.66325249e+01], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.41666182], [ 0.54763843], [ 0.57000276], [ 0.66573524], [ 0.4040245 ], [ 0.55213845], [ 0.56502387], [ 0.65057055], [-3.12243954], [-2.42135986], [-2.30165009], [-1.789222 ], [-3.13488171], [-2.35578975], [-2.28801132], [-1.83802854], [ 0. ], [ 0.106 ]]) + #_# limo: array([[ 6.30252412e-01], [ 2.78501356e-02], [ 7.89971253e+00], [ 3.26190930e+00], [-2.65522094e-02], [ 5.21604974e-03], [ 7.44675598e+00], [ 2.13763366e+01], [ 1.13338901e+00], [ 1.07145472e+00], [ 6.08810967e+00], [ 7.16432880e-01], [ 0.00000000e+00], [ 2.54000000e-01]]) + #_# nbc: array([[ 0.23334974], [ 0.73721487], [ 0.21445289], [ 0.27649545], [-0.54463082], [ 0. ], [ 0.337 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.50305359], [0.50305244], [0.92033692], [0.33667482], [0. ], [0.015 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.202 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.166 ], [3. ], [0.08333333], [0.91666667], [0.77777778], [0.10005948], [0.33333333], [0.11068569], [0.78925483], [0.39487534], [0.02777778], [0.07407407], [0.02777778], [0.16666667], [0.08018754], [0.22222222], [0.08333333], [0.33333333], [0.08333333], [0.83333333], [0.4330127 ], [1. ], [0.78925483], [0.02777778], [0. ], [0.263 ]]) + #_# ic: array([[ 0.8782254 ], [ 1.86686687], [16.83550803], [ 1.46646647], [ 0.63654618], [ 0. ], [ 2.818 ]]) + + #_# Represented: 1 + + ''' + vals = [(x**2 - 10*math.cos(2*math.pi*x)+10) for i,x in enumerate(args)] + return sum(vals) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Scahffer.py b/MDAF/TestFunctions/Scahffer.py new file mode 100644 index 0000000..1f2b433 --- /dev/null +++ b/MDAF/TestFunctions/Scahffer.py @@ -0,0 +1,37 @@ +import math + +def main(args): + ''' + >>> (main([0,1.253115]) - 0.292579) <0.001 + True + + + #_# dimmensions: 2 + #_# upper: 100 + #_# lower: -100 + #_# minimum: [0,1.253115] + + #_# cm_angle: array([[1.32397939e+01], [4.62172042e+00], [1.54725129e+01], [3.83824723e+00], [6.15596703e+01], [4.60528851e+01], [5.78960073e-02], [1.77211154e-01], [0.00000000e+00], [3.04000000e-01]]) + #_# cm_conv: array([[0.28846154], [0.32692308], [0.59615385], [0.40384615], [0. ], [0.112 ]]) + #_# cm_grad: array([[0.27182606], [0.14892901], [0. ], [0.251 ]]) + #_# ela_conv: array([[5.28000000e-01], [0.00000000e+00], [1.95655209e-04], [1.67319378e-03], [1.00000000e+03], [7.85000000e-01]]) + #_# ela_curv: array([[1.27038677e-05], [8.51688124e-04], [3.42370319e-02], [1.63080525e-03], [3.61351600e-03], [3.52679752e+00], [2.80534943e-01], [0.00000000e+00], [1.00177039e+00], [1.28214318e+00], [5.06893480e+00], [1.86800774e+00], [4.18543237e+00], [1.32175817e+02], [1.17354166e+01], [0.00000000e+00], [1.07905054e+00], [6.27158669e+03], [4.68193200e+05], [2.45568737e+04], [9.72023841e+04], [4.65774900e+07], [3.48316105e+06], [0.00000000e+00], [8.40000000e+03], [7.36500000e+00]]) + #_# ela_distr: array([[ 13.34246392], [209.96080831], [ 16. ], [ 0. ], [ 1.548 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [9.62819239e-01], [2.82319144e-01], [1.00000000e-02], [1.11235955e-02], [2.00000000e-02], [1.00000000e+01], [2.00000000e+01], [5.46000000e+01], [2.50000000e+01], [3.50000000e+01], [6.70000000e+02], [1.08461882e+02], [5.55000000e+03], [5.93800000e+00]]) + #_# ela_meta: array([[-6.05512229e-03], [ 5.00454194e-01], [ 2.99367671e-07], [ 4.66501187e-07], [ 1.55828846e+00], [-8.11646751e-03], [ 4.19202732e-03], [ 1.00353289e+00], [ 3.59951577e-04], [ 0.00000000e+00], [ 9.00000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+02], [-1.00000000e+02], [ 1.00000000e+02], [ 1.00000000e+02], [ 4.75039440e-01], [ 6.03137051e-01], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.2452238 ], [ 0.40935049], [ 0.55722261], [ 0.81817265], [ 0.2582684 ], [ 0.4058654 ], [ 0.55978039], [ 0.82633453], [-78.85602062], [-61.70871621], [-46.25962361], [-18.99659954], [-76.05189971], [-60.91835016], [-45.1369979 ], [-17.80642595], [ 0. ], [ 0.321 ]]) + #_# limo: array([[ 4.22966417e-05], [ 1.94667565e-01], [ 8.72841464e-05], [ 3.20771204e-04], [-6.18633196e-01], [ 1.16235036e-01], [ 4.78204702e+00], [ 5.07799984e+00], [ 1.22169240e+00], [ 1.08498800e+00], [ 2.32181712e-04], [ 7.02834166e-01], [ 0.00000000e+00], [ 3.35000000e-01]]) + #_# nbc: array([[ 0.327433 ], [ 0.79544574], [ 0.24288001], [ 0.23620539], [-0.07934774], [ 0. ], [ 0.265 ]]) + #_# pca: array([[1. ], [1. ], [0.66666667], [1. ], [0.50033871], [0.50033733], [0.50033871], [0.33526352], [0. ], [0.022 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.258 ], [5. ], [0.13888889], [0.86111111], [0.52777778], [0.1080201 ], [0.2 ], [0.2235868 ], [0.30323385], [0.07884818], [0.02777778], [0.09444444], [0.11111111], [0.16666667], [0.05414886], [0.47222222], [0.08333333], [0.2 ], [0.19444444], [0.33333333], [0.09702361], [1. ], [0.30323385], [0.02777778], [0. ], [0.394 ], [6. ], [0.16666667], [0.83333333], [0.61111111], [0.04685751], [0.16666667], [0.11210015], [0.39933868], [0.13215974], [0.02777778], [0.06481481], [0.05555556], [0.13888889], [0.0418207 ], [0.38888889], [0.05555556], [0.16666667], [0.09722222], [0.41666667], [0.14054567], [1. ], [0.39933868], [0.02777778], [0. ], [0.382 ]]) + #_# ic: array([[ 0.40734086], [-2.35735736], [ 0. ], [ -inf], [ 0.64457831], [ 0. ], [ 1.475 ]]) + + #_# Represented: 1 + + ''' + return 0.5 + (math.cos( math.sin(args[0]**2 - args[1]**2) )**2 - 0.5)/(1 + 0.001*(args[0]**2 + args[1]**2)**2) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Schwefel.py b/MDAF/TestFunctions/Schwefel.py new file mode 100644 index 0000000..3bbd427 --- /dev/null +++ b/MDAF/TestFunctions/Schwefel.py @@ -0,0 +1,38 @@ +import math + +def main(args): + ''' + >>> (main([0,0]) - 0) < 0.001 + True + + + #_# dimmensions: 2 + #_# upper: 100 + #_# lower: -100 + #_# minimum: [0,0] + + #_# cm_angle: array([[1.69171763e+01], [2.98716043e+00], [1.76778645e+01], [2.33433457e+00], [1.63370899e+02], [1.34109670e+01], [2.18294064e-01], [1.76744653e-01], [0.00000000e+00], [1.34000000e-01]]) + #_# cm_conv: array([[0.23076923], [0.01923077], [0.94230769], [0.05769231], [0. ], [0.055 ]]) + #_# cm_grad: array([[0.65771042], [0.12678401], [0. ], [0.203 ]]) + #_# ela_conv: array([[ 1.0000000e+00], [ 0.0000000e+00], [-3.1968775e+07], [ 3.1968775e+07], [ 1.0000000e+03], [ 6.8800000e-01]]) + #_# ela_curv: array([[2.82791576e+03], [6.06434355e+05], [2.23204032e+06], [1.66497072e+06], [3.37474337e+06], [9.79730815e+06], [2.02848107e+06], [0.00000000e+00], [1.00178688e+00], [1.38315596e+00], [1.62598534e+01], [2.02355702e+00], [4.09299045e+00], [1.36612996e+03], [1.04862740e+02], [0.00000000e+00], [2.90728153e+00], [2.99999476e+00], [3.00016244e+00], [3.00000086e+00], [3.00000764e+00], [3.11636297e+00], [1.07729256e-02], [0.00000000e+00], [8.40000000e+03], [6.23100000e+00]]) + #_# ela_distr: array([[1.57436631], [2.50763529], [8. ], [0. ], [0.255 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [5.31784058e-01], [4.22389493e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [1.25000000e+02], [1.55000000e+02], [1.60950000e+02], [1.60000000e+02], [1.70000000e+02], [1.80000000e+02], [1.00678255e+01], [1.61850000e+04], [1.40380000e+01]]) + #_# ela_meta: array([[-5.57906201e-03], [ 6.20766700e+07], [ 1.21121778e+04], [ 2.31521282e+04], [ 1.91147525e+00], [-7.56758450e-03], [ 9.06891906e-01], [ 1.00186774e+00], [ 9.74017685e-01], [ 0.00000000e+00], [ 3.60000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+02], [-1.00000000e+02], [ 1.00000000e+02], [ 1.00000000e+02], [ 4.74242152e+02], [ 3.71079159e+08], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.15335373], [ 0.22299732], [ 0.31683156], [ 0.49793152], [ 0.15435473], [ 0.22695942], [ 0.3127984 ], [ 0.49801222], [-88.45937847], [-81.18287002], [-71.37887226], [-52.45716819], [-86.76807745], [-79.3184183 ], [-70.51084408], [-51.50683903], [ 0. ], [ 0.121 ]]) + #_# limo: array([[1.30921766e+04], [5.95703995e-03], [2.45780673e+06], [1.98580231e+06], [1.71292598e-02], [3.71186444e-03], [2.55798445e+00], [1.72714055e+00], [1.00009085e+00], [1.00705197e+00], [2.25351316e+06], [7.17120015e-01], [0.00000000e+00], [1.86000000e-01]]) + #_# nbc: array([[ 0.9987645 ], [ 0.93054054], [ 0.62697985], [ 0.12045544], [-0.24797353], [ 0. ], [ 0.136 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.50395011], [0.50395011], [1. ], [0.34001115], [0. ], [0.016 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.091 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.219 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.216 ]]) + #_# ic: array([[6.46920358e-01], [6.91191191e+00], [6.17718760e+05], [5.99099099e+00], [4.11646586e-01], [0.00000000e+00], [1.42000000e+00]]) + + #_# Represented: 1 + + ''' + vals = [x**2 for x in args] + return sum(vals)**2 + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Sphere.py b/MDAF/TestFunctions/Sphere.py new file mode 100644 index 0000000..7b720d1 --- /dev/null +++ b/MDAF/TestFunctions/Sphere.py @@ -0,0 +1,36 @@ +def main(args): + ''' + >>> (main([0,0]) - 0)<0.001 + True + + + #_# dimmensions: 2 + #_# upper: 100 + #_# lower: -100 + #_# minimum: [0,0] + + #_# cm_angle: array([[1.72215494e+01], [2.59186558e+00], [1.73080840e+01], [2.32553416e+00], [1.55317224e+02], [1.54411724e+01], [2.63099825e-01], [1.01400943e-01], [0.00000000e+00], [3.36000000e-01]]) + #_# cm_conv: array([[0.23076923], [0.01923077], [0.92307692], [0.07692308], [0. ], [0.158 ]]) + #_# cm_grad: array([[0.66203256], [0.08653427], [0. ], [0.291 ]]) + #_# ela_conv: array([[ 1.00000000e+00], [ 0.00000000e+00], [-2.25864698e+03], [ 2.25864698e+03], [ 1.00000000e+03], [ 9.57000000e-01]]) + #_# ela_curv: array([[1.66265566e+01], [1.14451325e+02], [1.55060539e+02], [1.63087623e+02], [1.96213591e+02], [2.73023876e+02], [5.68415849e+01], [0.00000000e+00], [1.01060763e+00], [1.42768440e+00], [1.44939345e+01], [2.01740454e+00], [4.44927588e+00], [1.33798016e+03], [9.73375169e+01], [0.00000000e+00], [1.00000005e+00], [1.00000147e+00], [3.07924737e+01], [1.00000273e+00], [1.00000731e+00], [5.95879834e+03], [4.21279716e+02], [0.00000000e+00], [8.40000000e+03], [6.46800000e+00]]) + #_# ela_distr: array([[ 0.4595509 ], [-0.39456146], [ 2. ], [ 0. ], [ 0.144 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [2.89705664e-03], [2.28020182e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [2.00000000e+01], [2.00000000e+01], [2.20500000e+01], [2.00000000e+01], [2.50000000e+01], [2.50000000e+01], [2.47155535e+00], [2.29500000e+03], [1.97300000e+00]]) + #_# ela_meta: array([[-5.88921156e-03], [ 6.66594695e+03], [ 3.45283009e-01], [ 9.35344958e-01], [ 2.70892264e+00], [-5.51001031e-03], [ 1.00000000e+00], [ 1.00000000e+00], [ 1.00000000e+00], [ 0.00000000e+00], [ 6.30000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+02], [-1.00000000e+02], [ 1.00000000e+02], [ 1.00000000e+02], [ 1.12775826e+00], [ 1.86355093e+04], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.15269879], [ 0.23271735], [ 0.32156902], [ 0.50335822], [ 0.14758667], [ 0.23489903], [ 0.32051915], [ 0.50259174], [-88.55743104], [-80.19412662], [-70.90761106], [-51.90753826], [-87.61726606], [-78.64266382], [-69.84200313], [-51.12725292], [ 0. ], [ 0.744 ]]) + #_# limo: array([[ 3.28306369e-01], [ 3.80487807e-03], [ 1.51562625e+02], [ 5.50106121e+01], [-1.46339879e-03], [ 8.32396327e-04], [ 2.53047996e+00], [ 1.59095599e+00], [ 1.00147226e+00], [ 1.00051589e+00], [ 1.15441744e+02], [ 7.17131951e-01], [ 0.00000000e+00], [ 3.95000000e-01]]) + #_# nbc: array([[ 0.99836061], [ 0.93284167], [ 0.67967868], [ 0.11387608], [-0.24321922], [ 0. ], [ 0.319 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.5096517 ], [0.5096517 ], [0.99961314], [0.34195362], [0. ], [0.01 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.135 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.285 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.298 ]]) + #_# ic: array([[ 0.74639553], [ 2.36736737], [64.09244019], [ 1.94694695], [ 0.37951807], [ 0. ], [ 2.627 ]]) + + #_# Represented: 1 + + ''' + vals = [x**2 for x in args] + return sum(vals) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Step.py b/MDAF/TestFunctions/Step.py new file mode 100644 index 0000000..f264ef5 --- /dev/null +++ b/MDAF/TestFunctions/Step.py @@ -0,0 +1,38 @@ +import math + +def main(args): + ''' + >>> main([0,0]) + 0 + + + #_# dimmensions: 2 + #_# upper: 100 + #_# lower: -100 + #_# minimum: [0,0] + + #_# cm_angle: array([[1.76951433e+01], [2.53449463e+00], [1.73770488e+01], [2.51496578e+00], [1.61069593e+02], [1.41112959e+01], [2.50578704e-01], [3.08199018e-02], [0.00000000e+00], [3.11000000e-01]]) + #_# cm_conv: array([[0.23076923], [0.03846154], [0.67307692], [0.30769231], [0. ], [0.057 ]]) + #_# cm_grad: array([[0.6861495 ], [0.08471491], [0. ], [0.215 ]]) + #_# ela_conv: array([[ 8.71000000e-01], [ 1.00000000e-03], [-2.02239361e+01], [ 2.03378736e+01], [ 1.00000000e+03], [ 5.49000000e-01]]) + #_# ela_curv: array([[0.00000000e+00], [0.00000000e+00], [2.30592511e-04], [0.00000000e+00], [0.00000000e+00], [2.75548505e-02], [2.34386226e-03], [0.00000000e+00], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [1.00000000e+00], [7.50344071e+31], [7.50344071e+31], [8.30484005e+31], [8.30484005e+31], [9.10623938e+31], [9.10623938e+31], [1.13334981e+31], [9.90000000e-01], [6.00400000e+03], [2.86500000e+00]]) + #_# ela_distr: array([[ 0.02006772], [-0.62140715], [ 1. ], [ 0. ], [ 0.111 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.39349701e-01], [4.88512241e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [5.00000000e+00], [5.00000000e+00], [5.00000000e+00], [5.00000000e+00], [5.00000000e+00], [5.00000000e+00], [0.00000000e+00], [5.90000000e+02], [3.94000000e-01]]) + #_# ela_meta: array([[-6.06539506e-03], [ 9.90020277e+01], [ 8.01352476e-04], [ 3.01415715e-03], [ 3.76133754e+00], [-7.26293464e-03], [ 9.36883288e-01], [ 1.01130593e+00], [ 9.36200242e-01], [ 0.00000000e+00], [ 4.50000000e-02]]) + #_# basic: array([[ 2.00e+00], [ 5.00e+02], [-1.00e+02], [-1.00e+02], [ 1.00e+02], [ 1.00e+02], [ 3.00e+00], [ 1.95e+02], [ 6.00e+00], [ 6.00e+00], [ 3.60e+01], [ 3.60e+01], [ 1.00e+00], [ 0.00e+00], [ 3.00e-03]]) + #_# disp: array([[ 1.62767939e-01], [ 2.35149318e-01], [ 3.47340681e-01], [ 5.12177764e-01], [ 1.64507464e-01], [ 2.34816459e-01], [ 3.49915299e-01], [ 5.12127048e-01], [-8.74945746e+01], [-7.99303899e+01], [-6.82058800e+01], [-5.09796519e+01], [-8.57515939e+01], [-7.85353614e+01], [-6.67220794e+01], [-5.00733178e+01], [ 0.00000000e+00], [ 5.60000000e-02]]) + #_# limo: array([[ 2.12855984e-03], [ 5.41850462e-04], [ 1.41285806e+00], [ 1.19321767e-02], [-4.64254718e-03], [ 5.34346782e-05], [ 1.01304331e+00], [ 1.20693637e-02], [ 1.00329972e+00], [ 1.00334870e+00], [ 1.01324563e+00], [ 7.17136058e-01], [ 0.00000000e+00], [ 3.00000000e-01]]) + #_# nbc: array([[ 0.96803593], [ 0.92588983], [ 0.67665516], [ 0.11764107], [-0.24469197], [ 0. ], [ 0.347 ]]) + #_# pca: array([[1. ], [1. ], [1. ], [1. ], [0.50586371], [0.50586326], [0.40607191], [0.3373892 ], [0. ], [0.022 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.293 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.261 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.239 ]]) + #_# ic: array([[0.76154199], [0.18518519], [0.73259654], [0.00500501], [0.35140562], [0. ], [1.652 ]]) + + #_# Represented: 1 + + ''' + floors = [math.floor(abs(a)) for a in args] + return sum(floors) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Step2.py b/MDAF/TestFunctions/Step2.py new file mode 100644 index 0000000..0f3ad4a --- /dev/null +++ b/MDAF/TestFunctions/Step2.py @@ -0,0 +1,38 @@ +import math + +def main(args): + ''' + >>> (main([0,0])-0 )< 0.001 + True + + + #_# dimmensions: 2 + #_# upper: 100 + #_# lower: -100 + #_# minimum: [0,0] + + #_# cm_angle: array([[1.75512600e+01], [2.34210852e+00], [1.71483517e+01], [2.50786584e+00], [1.61753509e+02], [1.59072574e+01], [2.57240076e-01], [9.76587900e-02], [0.00000000e+00], [2.36000000e-01]]) + #_# cm_conv: array([[0.23076923], [0.03846154], [0.92307692], [0.07692308], [0. ], [0.107 ]]) + #_# cm_grad: array([[0.67816254], [0.09775417], [0. ], [0.203 ]]) + #_# ela_conv: array([[ 9.79000000e-01], [ 0.00000000e+00], [-2.05145940e+03], [ 2.05327048e+03], [ 1.00000000e+03], [ 6.46000000e-01]]) + #_# ela_curv: array([[0.00000000e+00], [0.00000000e+00], [4.89000224e+02], [0.00000000e+00], [0.00000000e+00], [9.72109612e+04], [6.87376988e+03], [0.00000000e+00], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [1.00000000e+00], [1.24561010e+31], [1.24561010e+31], [8.68122601e+34], [8.68122601e+34], [1.73612064e+35], [1.73612064e+35], [1.22753460e+35], [9.90000000e-01], [6.01000000e+03], [4.97100000e+00]]) + #_# ela_distr: array([[ 0.43860394], [-0.49084682], [ 1. ], [ 0. ], [ 1.202 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.07988034e-02], [3.84798542e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [5.00000000e+00], [5.00000000e+00], [5.00000000e+00], [5.00000000e+00], [5.00000000e+00], [5.00000000e+00], [0.00000000e+00], [5.90000000e+02], [5.95000000e-01]]) + #_# ela_meta: array([[-5.59163331e-03], [ 6.66553350e+03], [ 7.98401523e-01], [ 1.37733901e+00], [ 1.72512071e+00], [-6.31271941e-03], [ 9.99871442e-01], [ 1.00145301e+00], [ 9.99870660e-01], [ 0.00000000e+00], [ 7.70000000e-02]]) + #_# basic: array([[ 2.0000e+00], [ 5.0000e+02], [-1.0000e+02], [-1.0000e+02], [ 1.0000e+02], [ 1.0000e+02], [ 4.0000e+01], [ 1.9208e+04], [ 6.0000e+00], [ 6.0000e+00], [ 3.6000e+01], [ 3.6000e+01], [ 1.0000e+00], [ 0.0000e+00], [ 1.0000e-03]]) + #_# disp: array([[ 0.15385515], [ 0.23422366], [ 0.32112032], [ 0.4966564 ], [ 0.15756413], [ 0.23888297], [ 0.32384636], [ 0.49763056], [-88.41565476], [-80.0177606 ], [-70.93772575], [-52.59555028], [-86.47503733], [-78.12775499], [-69.40636486], [-51.56762415], [ 0. ], [ 0.278 ]]) + #_# limo: array([[ 7.86427754e-01], [ 1.98849138e-03], [ 1.51526595e+02], [ 5.45705991e+01], [-5.22719614e-03], [ 2.80081815e-03], [ 2.58477109e+00], [ 1.63257588e+00], [ 1.00692690e+00], [ 1.00336819e+00], [ 1.15311134e+02], [ 7.17134734e-01], [ 0.00000000e+00], [ 3.94000000e-01]]) + #_# nbc: array([[ 0.9837657 ], [ 0.93415162], [ 0.64779452], [ 0.11588566], [-0.24372765], [ 0. ], [ 0.388 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.51102453], [0.51102427], [0.99962042], [0.34516086], [0. ], [0.032 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.056 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.221 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.366 ]]) + #_# ic: array([[ 0.75546743], [ 2.38738739], [70.28244264], [ 1.90690691], [ 0.40361446], [ 0. ], [ 2.644 ]]) + + #_# Represented: 1 + + ''' + floors = [(math.floor(a + 0.5))**2 for a in args] + return sum(floors) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Styblinski-Tang.py b/MDAF/TestFunctions/Styblinski-Tang.py new file mode 100644 index 0000000..2620ce6 --- /dev/null +++ b/MDAF/TestFunctions/Styblinski-Tang.py @@ -0,0 +1,38 @@ +import math + +def main(args): + ''' + >>> (main([-2.903534,-2.903534])+78.332) < 0.001 + True + + + #_# dimmensions: 2 + #_# upper: 5 + #_# lower: -5 + #_# minimum: [-2.903534,-2.903534] + + #_# cm_angle: array([[7.90389678e-01], [1.68330821e-01], [8.89556888e-01], [1.38622941e-01], [1.55135814e+02], [2.42794096e+01], [3.33747533e-01], [2.28197286e-01], [0.00000000e+00], [2.47000000e-01]]) + #_# cm_conv: array([[0.46153846], [0.25 ], [0.5 ], [0.5 ], [0. ], [0.088 ]]) + #_# cm_grad: array([[0.58029017], [0.14855314], [0. ], [0.173 ]]) + #_# ela_conv: array([[ 6.57000000e-01], [ 0.00000000e+00], [-1.68507013e+01], [ 2.38856020e+01], [ 1.00000000e+03], [ 7.28000000e-01]]) + #_# ela_curv: array([[2.07560379e+00], [1.78894161e+01], [5.62113455e+01], [3.11211720e+01], [9.09203181e+01], [2.03455483e+02], [4.84706600e+01], [0.00000000e+00], [1.00076708e+00], [1.69792058e+00], [1.52404741e+01], [3.32806211e+00], [8.59310335e+00], [8.47164931e+02], [6.82595816e+01], [0.00000000e+00], [1.00114814e+00], [1.67464000e+00], [1.11177515e+01], [3.44128402e+00], [7.18548119e+00], [4.76183903e+02], [3.80832200e+01], [0.00000000e+00], [8.40000000e+03], [7.98500000e+00]]) + #_# ela_distr: array([[1.24375025], [1.31303509], [3. ], [0. ], [0.209 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.17148432e+00], [4.05555556e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [3.50000000e+01], [5.50000000e+01], [7.19000000e+01], [7.00000000e+01], [8.50000000e+01], [1.25000000e+02], [2.14238138e+01], [7.28000000e+03], [6.92400000e+00]]) + #_# ela_meta: array([[ 0.04671302], [-8.32820627], [ 2.29914065], [ 2.72395498], [ 1.18477092], [ 0.04628197], [ 0.44749464], [ 1.03943038], [ 0.44240435], [ 0. ], [ 0.093 ]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-5.00000000e+00], [-5.00000000e+00], [ 5.00000000e+00], [ 5.00000000e+00], [-7.75616867e+01], [ 1.88867206e+02], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 2.00000000e-03]]) + #_# disp: array([[ 0.14252381], [ 0.6609097 ], [ 0.74994415], [ 0.86257127], [ 0.1493772 ], [ 0.85899259], [ 0.90232601], [ 0.95385898], [-4.47959769], [-1.77146392], [-1.3063332 ], [-0.71795045], [-4.36311577], [-0.72327201], [-0.50100107], [-0.236672 ], [ 0. ], [ 0.146 ]]) + #_# limo: array([[ 3.58717337e+00], [ 6.85218718e-02], [ 5.52763174e+01], [ 3.95677957e+01], [-1.92143741e-02], [ 1.73549733e-02], [ 5.96112495e+00], [ 7.22097393e+00], [ 1.00013937e+00], [ 1.02399010e+00], [ 4.84517565e+01], [ 7.15401365e-01], [ 0.00000000e+00], [ 1.31000000e-01]]) + #_# nbc: array([[ 0.18250317], [ 0.87643532], [ 0.13654916], [ 0.13450537], [-0.38388345], [ 0. ], [ 0.271 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.5010443 ], [0.50104384], [0.99203977], [0.41011666], [0. ], [0.026 ]]) + #_# gcm: array([[4. ], [0.11111111], [0.88888889], [0.47222222], [0.20065046], [0.25 ], [0.24278043], [0.31378867], [0.04700162], [0.11111111], [0.13194444], [0.11111111], [0.19444444], [0.04166667], [0.52777778], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0. ], [1. ], [0.31378867], [0.02777778], [0. ], [0.19 ], [4. ], [0.11111111], [0.88888889], [0.75 ], [0.21908552], [0.25 ], [0.24131732], [0.29827985], [0.03423605], [0.02777778], [0.0625 ], [0.02777778], [0.16666667], [0.06944444], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0. ], [1. ], [0.29827985], [0.02777778], [0. ], [0.557 ], [4. ], [0.11111111], [0.88888889], [0.75 ], [0.22466354], [0.25 ], [0.24621096], [0.28291453], [0.02445002], [0.02777778], [0.0625 ], [0.02777778], [0.16666667], [0.06944444], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0.25 ], [0. ], [1. ], [0.28291453], [0.02777778], [0. ], [0.204 ]]) + #_# ic: array([[ 0.74209109], [ 2.18718719], [10.13925408], [ 1.30630631], [ 0.41164659], [ 0. ], [ 1.766 ]]) + + #_# Represented: 1 + + ''' + floors = [(a**4 - 16*a**2 + 5*a) for a in args] + return 0.5 * sum(floors) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/SumSquare.py b/MDAF/TestFunctions/SumSquare.py new file mode 100644 index 0000000..2391c67 --- /dev/null +++ b/MDAF/TestFunctions/SumSquare.py @@ -0,0 +1,36 @@ +def main(args): + ''' + >>> (main([0,0]) - 0)<0.001 + True + + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: -10 + #_# minimum: [0,0] + + #_# cm_angle: array([[ 1.74423906], [ 0.27293964], [ 1.76075806], [ 0.29531509], [143.02933717], [ 24.06675059], [ 0.29793996], [ 0.16731295], [ 0. ], [ 0.285 ]]) + #_# cm_conv: array([[0.30769231], [0.19230769], [0.73076923], [0.26923077], [0. ], [0.086 ]]) + #_# cm_grad: array([[0.6992867 ], [0.09123779], [0. ], [0.23 ]]) + #_# ela_conv: array([[ 1.00000000e+00], [ 0.00000000e+00], [-1.09269603e+01], [ 1.09269603e+01], [ 1.00000000e+03], [ 8.33000000e-01]]) + #_# ela_curv: array([[1.13629627e-01], [5.50553497e+00], [1.07430400e+01], [1.07578815e+01], [1.60831070e+01], [1.99616202e+01], [5.83772714e+00], [0.00000000e+00], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [1.00000000e+00], [3.10673872e+29], [7.79028149e+31], [7.25379887e+43], [4.08761262e+32], [5.95115785e+33], [1.41618495e+46], [1.00156955e+45], [0.00000000e+00], [7.20000000e+03], [9.35600000e+00]]) + #_# ela_distr: array([[ 0.63731058], [-0.86516682], [ 2. ], [ 0. ], [ 0.242 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [8.99156632e-25], [2.86476224e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [2.00000000e+01], [2.00000000e+01], [2.23000000e+01], [2.00000000e+01], [2.50000000e+01], [2.50000000e+01], [2.50454133e+00], [2.32000000e+03], [2.61900000e+00]]) + #_# ela_meta: array([[-5.95672965e-03], [ 3.33348862e+01], [ 1.84396704e-03], [ 5.83364265e-02], [ 3.16363715e+01], [-7.99188239e-03], [ 1.00000000e+00], [ 7.50815513e+17], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.04000000e-01]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+01], [-1.00000000e+01], [ 1.00000000e+01], [ 1.00000000e+01], [ 1.93346220e-04], [ 9.99336729e+01], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 0.00000000e+00]]) + #_# disp: array([[ 0.66775335], [ 0.64309839], [ 0.66537207], [ 0.69438354], [ 0.63502799], [ 0.57661317], [ 0.5877032 ], [ 0.61742602], [-3.47196596], [-3.72960941], [-3.49685024], [-3.19368145], [-3.7429486 ], [-4.34201828], [-4.22828516], [-3.92346456], [ 0. ], [ 0.309 ]]) + #_# limo: array([[2.87816403e-02], [7.59592794e-04], [9.97657005e+00], [5.51600215e+00], [1.28722457e-01], [1.60375448e-01], [1.74841570e+02], [2.84743848e+02], [7.79501361e+01], [4.26928609e+01], [5.83540750e+00], [5.18827787e-01], [0.00000000e+00], [3.39000000e-01]]) + #_# nbc: array([[ 0.23737592], [ 0.88748311], [ 0.15958744], [ 0.14163924], [-0.21953669], [ 0. ], [ 0.413 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.50446366], [0.50446296], [0.93024089], [0.33809051], [0. ], [0.027 ]]) + #_# gcm: array([[2. ], [0.05555556], [0.94444444], [0.61111111], [0.28656214], [0.5 ], [0.5 ], [0.71343786], [0.30184672], [0.02777778], [0.19444444], [0.19444444], [0.36111111], [0.23570226], [0.38888889], [0.33333333], [0.5 ], [0.5 ], [0.66666667], [0.23570226], [1. ], [0.71343786], [0.02777778], [0. ], [0.287 ], [2. ], [0.05555556], [0.94444444], [0.58333333], [0.42569148], [0.5 ], [0.5 ], [0.57430852], [0.10508812], [0.13888889], [0.20833333], [0.20833333], [0.27777778], [0.09820928], [0.41666667], [0.5 ], [0.5 ], [0.5 ], [0.5 ], [0. ], [1. ], [0.57430852], [0.02777778], [0. ], [0.174 ], [2. ], [0.05555556], [0.94444444], [0.69444444], [0.49752284], [0.5 ], [0.5 ], [0.50247716], [0.00350324], [0.08333333], [0.15277778], [0.15277778], [0.22222222], [0.09820928], [0.30555556], [0.5 ], [0.5 ], [0.5 ], [0.5 ], [0. ], [1. ], [0.50247716], [0.02777778], [0. ], [0.23 ]]) + #_# ic: array([[0.65337406], [1.26626627], [3.35371015], [0.68568569], [0.35542169], [0. ], [1.627 ]]) + + #_# Represented: 1 + + ''' + vals = [i*x**2 for i,x in enumerate(args)] + return sum(vals) + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Wayburn.py b/MDAF/TestFunctions/Wayburn.py new file mode 100644 index 0000000..66bc798 --- /dev/null +++ b/MDAF/TestFunctions/Wayburn.py @@ -0,0 +1,37 @@ +import math + +def main(args): + ''' + >>> main([1,2])<0.001 + True + + + #_# dimmensions: 2 + #_# upper: 100 + #_# lower: -100 + #_# minimum: [-2.903534,-2.903534] + + #_# cm_angle: array([[ 16.51016476], [ 2.57287474], [ 17.61177277], [ 2.41471473], [142.5140382 ], [ 28.5868278 ], [ 0.26952628], [ 0.39099627], [ 0. ], [ 0.369 ]]) + #_# cm_conv: array([[0.25 ], [0.09615385], [0.76923077], [0.23076923], [0. ], [0.064 ]]) + #_# cm_grad: array([[0.66097771], [0.08800919], [0. ], [0.164 ]]) + #_# ela_conv: array([[ 1.0000000e+00], [ 0.0000000e+00], [-5.7208316e+22], [ 5.7208316e+22], [ 1.0000000e+03], [ 6.5400000e-01]]) + #_# ela_curv: array([[9.80882101e+07], [3.16831680e+16], [9.56909760e+21], [4.39318384e+19], [4.65778139e+21], [1.08965948e+23], [2.20727784e+22], [0.00000000e+00], [1.09553821e+00], [2.16967897e+02], [6.96768470e+06], [5.52099617e+03], [3.60451882e+04], [1.29249630e+09], [9.18573153e+07], [1.00000000e-02], [1.20728457e+00], [1.26787937e+03], [6.72779142e+26], [1.64545038e+04], [8.27264290e+04], [1.33092866e+29], [9.41113552e+27], [0.00000000e+00], [8.38800000e+03], [9.67900000e+00]]) + #_# ela_distr: array([[ 2.95537956], [ 8.41879344], [16. ], [ 0. ], [ 0.26 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.60765038e-03], [3.23996011e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [2.55000000e+02], [3.38750000e+02], [4.20500000e+02], [4.15000000e+02], [4.75000000e+02], [1.28500000e+03], [1.25582481e+02], [4.21400000e+04], [1.53870000e+01]]) + #_# ela_meta: array([[-5.84568182e-03], [ 7.68635555e+22], [ 5.31065144e+18], [ 4.88899306e+19], [ 9.20601382e+00], [-6.16929073e-03], [ 5.52437887e-01], [ 2.37186991e+01], [ 5.55065780e-01], [ 0.00000000e+00], [ 1.30000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+02], [-1.00000000e+02], [ 1.00000000e+02], [ 1.00000000e+02], [ 3.10691301e+07], [ 9.80481050e+23], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 1.79472172e-01], [ 3.04971872e-01], [ 4.35404768e-01], [ 6.95890946e-01], [ 1.59018558e-01], [ 2.71378354e-01], [ 3.84165922e-01], [ 6.16352427e-01], [-8.57228823e+01], [-7.26115707e+01], [-5.89848741e+01], [-3.17711402e+01], [-8.62321072e+01], [-7.47110183e+01], [-6.31460666e+01], [-3.93382505e+01], [ 0.00000000e+00], [ 1.20000000e-02]]) + #_# limo: array([[ 2.36717207e+20], [ 4.07457578e-02], [ 7.98525673e+21], [ 1.14416298e+22], [ 1.19946513e-01], [-3.26380292e-02], [ 2.69245754e+01], [ 6.64423242e+01], [ 1.19653395e+01], [ 6.08626247e+00], [ 7.56713964e+21], [ 5.82114762e-01], [ 0.00000000e+00], [ 5.90000000e-02]]) + #_# nbc: array([[ 0.88092555], [ 0.92477452], [ 0.64327624], [ 0.11440441], [-0.24261939], [ 0. ], [ 0.044 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.51039617], [0.51039564], [1. ], [0.34226913], [0. ], [0.003 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.037 ], [3. ], [0.08333333], [0.91666667], [0.83333333], [0.2179862 ], [0.33333333], [0.37721563], [0.40479817], [0.10084106], [0.05555556], [0.05555556], [0.05555556], [0.05555556], [0. ], [0.16666667], [0.16666667], [0.33333333], [0.33333333], [0.5 ], [0.16666667], [1. ], [0.40479817], [0.02777778], [0. ], [0.043 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.046 ]]) + #_# ic: array([[4.67671036e-01], [ nan], [9.97697764e+13], [1.50000000e+01], [3.69477912e-01], [0.00000000e+00], [3.74000000e-01]]) + + #_# Represented: 1 + + ''' + return (args[0]**6 + args[1]**4 - 17)**2 + (2*args[0] + args[1] - 4)**2 + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Zettle.py b/MDAF/TestFunctions/Zettle.py new file mode 100644 index 0000000..3fbb928 --- /dev/null +++ b/MDAF/TestFunctions/Zettle.py @@ -0,0 +1,35 @@ +def main(args): + ''' + >>> (main([-0.0299,0]) + 0.003791) < 0.001 + True + + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: -5 + #_# minimum: [-0.0299,0] + + #_# cm_angle: array([[1.25068565e+00], [2.50004511e-01], [1.32505725e+00], [2.11320066e-01], [1.60855629e+02], [2.20138358e+01], [1.35843657e-01], [1.42306220e-01], [0.00000000e+00], [3.00000000e-01]]) + #_# cm_conv: array([[0.23076923], [0. ], [1. ], [0. ], [0. ], [0.115 ]]) + #_# cm_grad: array([[0.65274079], [0.10687332], [0. ], [0.223 ]]) + #_# ela_conv: array([[ 9.99000000e-01], [ 0.00000000e+00], [-1.33330976e+03], [ 1.33330997e+03], [ 1.00000000e+03], [ 7.70000000e-01]]) + #_# ela_curv: array([[6.12929864e-01], [1.89664463e+02], [1.31555338e+03], [6.64616883e+02], [2.05690211e+03], [8.29960175e+03], [1.54961844e+03], [0.00000000e+00], [1.00882147e+00], [1.41107249e+00], [7.65727799e+00], [2.01898972e+00], [4.21130855e+00], [4.00122348e+02], [2.99940447e+01], [0.00000000e+00], [1.69823371e+00], [3.03044959e+00], [3.25779483e+00], [3.06588913e+00], [3.14908201e+00], [1.79592101e+01], [1.16236775e+00], [0.00000000e+00], [8.40000000e+03], [9.67100000e+00]]) + #_# ela_distr: array([[ 2.16081679], [ 5.42299682], [12. ], [ 0. ], [ 0.262 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.00000001e+00], [1.26958324e-02], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [8.50000000e+01], [1.10000000e+02], [1.35450000e+02], [1.25000000e+02], [1.60000000e+02], [2.60000000e+02], [3.29147583e+01], [1.36350000e+04], [7.54600000e+00]]) + #_# ela_meta: array([[4.95230818e-01], [8.04689320e+02], [3.76928064e+02], [6.02655801e+02], [1.59886158e+00], [5.21364280e-01], [8.95283758e-01], [1.12729778e+00], [9.94172865e-01], [0.00000000e+00], [5.50000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-5.00000000e+00], [-5.00000000e+00], [ 1.00000000e+01], [ 1.00000000e+01], [ 2.14876812e-02], [ 2.65049100e+04], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.16433743], [ 0.2186286 ], [ 0.30794507], [ 0.49049748], [ 0.16163595], [ 0.22158376], [ 0.30988321], [ 0.48986681], [-6.54902316], [-6.12354744], [-5.42358114], [-3.99293195], [-6.44690262], [-5.98591231], [-5.30690191], [-3.92285311], [ 0. ], [ 0.032 ]]) + #_# limo: array([[ 9.48966720e+02], [ 3.40831665e-01], [ 1.45826621e+03], [ 1.49953075e+03], [ 2.64957098e-01], [-2.29838130e-02], [ 3.06757937e+01], [ 1.56297532e+02], [ 1.12800297e+00], [ 1.00000981e+00], [ 1.32230306e+03], [ 6.74198105e-01], [ 0.00000000e+00], [ 1.38000000e-01]]) + #_# nbc: array([[ 0.89052363], [ 0.93015931], [ 0.63657673], [ 0.11423545], [-0.14978954], [ 0. ], [ 0.104 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [0.66666667], [0.52211228], [0.52211224], [0.99999859], [0.58021295], [0. ], [0.018 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.082 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.17 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.304 ]]) + #_# ic: array([[ 0.61239784], [ 3.70870871], [176.70435261], [ 2.56756757], [ 0.3935743 ], [ 0. ], [ 1.149 ]]) + + #_# Represented: 1 + + ''' + return (args[0]**2 + args[1]**2 - 2*args[0])**2 + 0.25*args[0] + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/Zirilli.py b/MDAF/TestFunctions/Zirilli.py new file mode 100644 index 0000000..d2c53c2 --- /dev/null +++ b/MDAF/TestFunctions/Zirilli.py @@ -0,0 +1,35 @@ +def main(args): + ''' + >>> (main([-1.0465,0]) + 0.3523) < 0.001 + True + + + #_# dimmensions: 2 + #_# upper: 10 + #_# lower: -10 + #_# minimum: [-1.0465,0] + + #_# cm_angle: array([[ 1.6569554 ], [ 0.28633476], [ 1.79903684], [ 0.27796405], [143.11418389], [ 27.7392393 ], [ 0.29862645], [ 0.31215793], [ 0. ], [ 0.324 ]]) + #_# cm_conv: array([[0.26923077], [0.15384615], [0.76923077], [0.23076923], [0. ], [0.09 ]]) + #_# cm_grad: array([[0.6251378 ], [0.10211858], [0. ], [0.234 ]]) + #_# ela_conv: array([[ 1.00000000e+00], [ 0.00000000e+00], [-2.37188847e+02], [ 2.37188847e+02], [ 1.00000000e+03], [ 8.24000000e-01]]) + #_# ela_curv: array([[1.10023911e+00], [2.09338188e+01], [2.37216554e+02], [1.11842895e+02], [3.84929686e+02], [9.88012789e+02], [2.70890589e+02], [0.00000000e+00], [1.07097938e+00], [9.52066161e+00], [1.60783131e+02], [3.27854680e+01], [1.09862258e+02], [9.36195807e+03], [6.94959295e+02], [0.00000000e+00], [1.03437118e+00], [2.33605667e+01], [9.78502070e+01], [7.05053405e+01], [1.59710620e+02], [3.54555797e+02], [8.76602187e+01], [0.00000000e+00], [8.40000000e+03], [1.10320000e+01]]) + #_# ela_distr: array([[ 1.39264311], [ 0.80498105], [18. ], [ 0. ], [ 0.24 ]]) + #_# ela_local: array([[9.00000000e+01], [9.00000000e-01], [1.35966641e+00], [4.66666667e-01], [1.00000000e-02], [1.11235955e-02], [1.00000000e-02], [3.00000000e+01], [5.50000000e+01], [6.58500000e+01], [6.50000000e+01], [7.00000000e+01], [2.50000000e+02], [2.41946546e+01], [6.67500000e+03], [4.46100000e+00]]) + #_# ela_meta: array([[-6.07838360e-03], [ 5.00067781e+02], [ 1.41562222e-01], [ 2.60491438e-01], [ 1.84011973e+00], [-7.87049197e-03], [ 9.13938370e-01], [ 6.05392072e+01], [ 9.13095452e-01], [ 0.00000000e+00], [ 3.10000000e-02]]) + #_# basic: array([[ 2.00000000e+00], [ 5.00000000e+02], [-1.00000000e+01], [-1.00000000e+01], [ 1.00000000e+01], [ 1.00000000e+01], [-3.14923665e-01], [ 2.44317791e+03], [ 6.00000000e+00], [ 6.00000000e+00], [ 3.60000000e+01], [ 3.60000000e+01], [ 1.00000000e+00], [ 0.00000000e+00], [ 1.00000000e-03]]) + #_# disp: array([[ 0.16841667], [ 0.2469861 ], [ 0.34521466], [ 0.56628875], [ 0.15938958], [ 0.24425167], [ 0.33339414], [ 0.52488969], [-8.69263687], [-7.87134152], [-6.84454697], [-4.53363397], [-8.63420227], [-7.76255414], [-6.8469408 ], [-4.88002339], [ 0. ], [ 0.179 ]]) + #_# limo: array([[ 1.74000065e+00], [ 3.71873191e-03], [ 2.41228333e+02], [ 2.53623699e+02], [-2.95437979e-01], [-3.62169712e-02], [ 5.15380786e+01], [ 1.00063709e+02], [ 2.72571663e+01], [ 2.47488605e+00], [ 1.82534065e+02], [ 6.60131573e-01], [ 0.00000000e+00], [ 1.52000000e-01]]) + #_# nbc: array([[ 0.90011616], [ 0.92348851], [ 0.61818658], [ 0.12177037], [-0.23774418], [ 0. ], [ 0.252 ]]) + #_# pca: array([[1. ], [1. ], [0.33333333], [1. ], [0.51070234], [0.51070232], [0.99984321], [0.34047727], [0. ], [0.013 ]]) + #_# gcm: array([[1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.236 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.106 ], [1. ], [0.02777778], [0.97222222], [0. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [1. ], [1. ], [1. ], [ nan], [1. ], [1. ], [0.02777778], [0. ], [0.111 ]]) + #_# ic: array([[0.56158709], [2.88788789], [3.20262069], [1.68668669], [0.36947791], [0. ], [1.072 ]]) + + #_# Represented: 1 + + ''' + return 0.25*args[0]**4 - 0.5*args[0]**2 + 0.1*args[0] + 0.5*args[1]**2 + +if __name__ == "__main__": + import doctest + doctest.testmod() diff --git a/MDAF/TestFunctions/__pycache__/Brown.cpython-39.pyc b/MDAF/TestFunctions/__pycache__/Brown.cpython-39.pyc index 40dfc6abbb52306dea430e9ee2fb18e3b2a1f1e7..84c165355810220e7ccca47b85b244b5333ef762 100644 GIT binary patch delta 199 zcmX@Dw@aTlk(ZZ?0SL<3tP^if_FxoK{@c?bQ#StG5(iI dq!yRlVh54A`6-iC#Fe;<*?_7!R5=(q7y(;=E^Gh* delta 89 zcmdm`e_D?>k(ZZ?0SI`vtxPDG$SW(v1LUMIq%gKHL@}f=1v6+ePYkK&JSxh-z@-2L ho0%AW#6)CR7$q3(n2JD({WKZD^yFS~CDzX%vj8c-5K;gD diff --git a/MDAF/TestFunctions/__pycache__/Bukin2.cpython-39.pyc b/MDAF/TestFunctions/__pycache__/Bukin2.cpython-39.pyc index 8661be07d23bbdb4047a4aa1babada35b78f23c8..e8126e2add562d0f279938aefe9e95bd3a9f030f 100644 GIT binary patch delta 206 zcmZqGe5=Wu$ji&c00c@L)`?#x^2%zd068fPDU2-)Q4Fb!DNNZ+MG7g*DJ(fmQB0{! z3z!!&FfydD1T$!|PP7Tt4Haf!P*C9Fw6n8Q(8x{9%+rY0H8jvMh}BfkRWQ)BG0-zG zFy!J4DJo6n;@UVfS(wpw@?T*^7GD=fx5*kJ8kX`!oIne2am2@ibjQaRF$1}Nnk;bP pyu{qp`1o7wDf!7Isl_F?*g<4&e#+!H5hd*{aE#$ji&c00i?VtVrmd$SW(v1LUMIq%gKHL@}f=1v6+ePYem=Fc4;7P*C9F x+;}Znn9+H%m53r&aDHh~a;kHFO6ufz5e+_>B2J)AKTSq3J^6r$66!2q`P7S;d& diff --git a/MDAF/TestFunctions/__pycache__/Bukin4.cpython-39.pyc b/MDAF/TestFunctions/__pycache__/Bukin4.cpython-39.pyc index ffdde4fe973d46215502aec5b706645537a7465c..fa25899dfa31f9cd4a13846516cda59100c10f93 100644 GIT binary patch delta 204 zcmaE%b4iysk(ZZ?0SF8^tP`(K?!%lC8@StVm6>^4kZpo4n_b)TQEfc delta 98 zcmcbl`$C5|k(ZZ?0SHQ0u1Lt9$SW(v1LUMIq%gKHL@}f=1v6+ePYiKoQ50oh*mxvL sl+k&zyqF?aaDHh~a;kHFO6p`6F%3THB9Iw=nv7t2@=`G+*3TeA0e6`e9RL6T diff --git a/MDAF/TestFunctions/__pycache__/Bukin6.cpython-39.pyc b/MDAF/TestFunctions/__pycache__/Bukin6.cpython-39.pyc index 76ff0f9237decd351adca183fd570302040efc0f..92d1991d657fb22eb200350d7b572ff223b10034 100644 GIT binary patch delta 193 zcmbQP+o;Ez$ji&c00j0N)``C-^2#!rOw^W^OJzx6$!01tNMT4}&0&pVO=Vrcwvd4l z$O~rBWSi)dqh%_}z`(_6XJ@CNk(-#ArxC4dXrN;ltEr%?V4!JZpl4uU$i*2_RGP}Q zanBS{7r7!Hpe46B;^RT8ADrCYEFrF$2YmSU?0!MP6cVYJB`H_LThOlGNgo bTkIe*H$P=^o|rNZ2T-K|Glv2PBL^b@`JFDd delta 70 zcmZqFo36{7$ji&c00j4f4<<~U$ScbzGf`WbErlhRL6dc2N)8LZCEj_ndRjx%bYw=QUR+?mgFIR91#1_}yw8Hg1ne(qE9+{8ND#hsU{ctLOYuwo0$c z#`So%TCdI~^aPQpL>0S6uYoaW*JkVVx-zd`uNQL-*+#ud@IrQTHmN5CuGuZwR=ri= z750v7o8B()u-%dE)H?+p0sc;Xr@(QKU3963R?^rNqIaE?XcdiLk!XBb*1KsnOsaCNM0p5enH;-M3Kx88YqIHufx)U3T~l7TPSS{Rk2P{>1iny<~QWF2~V-79bGNh z^GsKtIx;b#Yq`1Xag$k>^nf`y@bF+tX4P=%dK}K^8n&H=gU%XLrjwHOVAf(R&sZ%8 ztVyhqd-7PjZDca}7W9)i0EuWMw&~BBd9U)?4xDF=8=wg=PfMq*oaLs|DgLoy4!7bg z%B2*x1LswPO*vk0_C*{Ypq#M4)Olr0BPsx;5m}y?*@~>J)po^`5%LW zq=Q$5+M=F@!cM`=u)TaFbf8HbAcbQ7T8@>SvkliAL{62!TmmR6K;K}p%_~wFgD^iB`=d)&`nH%*A)}AYD_9tmE~m?Ez4JxyaEgfpQxM-lWPu zik|Ani8Yy_qOLO2v3=34@{eU{(GXegA%w;D<4TD zNj-lyaf89{oau(Tm;9#OB&`zUj7c}iMUa8?+rqzEmxTPW zP`7sY5UhPynD9%0u{s23TRi~fz@GO=Mi0*AFhqPy;QQabM?k6pFmBYRgCaf-^Iz8M zMCTn12Sa!N2fx&A{(M8*(v!I0QwVwx^djg((2w9D1Oo^#gL$EJn&va`T{1g+XQk-_5??@V zu&l(shM=7r$!ABu2KO~{gZJ-+&aiyObR3pJDgXtSxt=on ze6C=)(~hWII&W`nAV>Ld>wq7ELp;}-YI+P*wjI_}Xx_Zbf82VA+`jX-*0&yDgE!lb z?m-){R}sAS*)>EygzgMqxS{>*UW_YXm6>oUvLdfSuj@vOq$n@Ti|Pgza4U;yF|aJ3 zldnnFh#R{qT_uw;4bb2f&8=FIX5zT+GVvSZ#UMz?lVpj8P@otrvqQyDshVn3n}UrN zH8)YJS(O$m+{8>Rt)SuSWHDR}m+Dre6;jkz6*x+wRKF_WcL3zj$OPLSukflFxZ{l< zzIza!8hD&x2@2j6yzKdbMdC_uNJ1t5kmp+#EQZE0!?Ri$ld0 z$%<5hL#&cpve;7G{cf0F4+;fZUzP&KwmrVGzQ^5tFsaK!G)44qf#qk+3?_zD!vkF$ z%fZs7da#k)wpWG<+!FnX1rTi5fZas$Z3I67psU79rlUvEN7GQ3C*hlh{S+or5kHwL zSqp+E3!Z)uxE^_ly)1f=p9^ZiBRYE*Q1&wf`1WAr%ZUF1f%s?;Q4qOw-;k%_-JKmU zFTrOD} z_eJw)f|_mF3R1amH_P}e5QzPss5YQt6{C(o_>uArc7V64J0CWaI1 znC$QLL*&ZreHcW>OC9v&yyMqZ40b(cWea)c+SY~s={eW3{hkL4EgM9DZH*Uzk6f^l z_(s6q)^}@66bv&a!;53W>BEQ#&yON@4uB_mST~=y9lz(b`1@ULpPrF*H z(M8}(pfJCW#Zm1#@9Az?szwz1BTt43-i#EsmuwV42EjZ6QFv}6hRI#{t#BT;3rJmj zR6-N&u;1bA4deyT&W;|ycE@4ALB6o@eSn^M*3-toH|K2guneSwi3?%{;=}(($sQ3a mnu6SD8EQ&69E)hX!XsK^_-J^4cp%)Mg~PHYN0oY_$^QqZlL+qs delta 3475 zcmaJ@U2GKB6`nh@Kf~JV-SyAf>;FH%%VJ}|i2>VSATe#B4h5RFqo8H7_wIV|?Cf%9 zjBVo9l|V{TB~sIyLRHZyR8?DxDpl(Aq3UZ@seSF+Ri!?lsO2S6rKk_QwCCJeOrW&0 z+B4^#zkBE0bG~~&|K^*E1v{BcXz;u-`{ygE7d7nx4!-!rVK5JWpT1YPyh${wQNvAH zDR{@+bTwmT8nRZaRq5KQ?N*19#ocVR)9O^b>2_6fR!;G|-0o_R)vNe~+gI(k`W4>< z@&Ri=@i@mI-A|LW05?Vl=@3}u**-eFtbd>ID;157{FGP)wwI2w0^Lpbz(?%8 zYtS*8e>Y<7r~7E(mc|M%X*Y>AZn7pe4$Or3i0tW#$f(V^y)L7U@7bO-7VSkDw|$Y( ze@Mo}FZ8`Js$JCbQPFJ-MDjXMilQ-SrXibK8gCPC8nap3E!AqhnBN!>jhLi`@DB07 zxZU3gW8Sty+JTd1vFLbCP%Ms$I}vuI3$+&q>v{vQnei~PdKi7i>L*JF~T(l%n!;d zUg?PVG&V_kL^l4~Fou(nz^O8ss`FZj`F;^cMbGEMpyOTQ{rExBEB+WCXtqoY;n!J- zkBWcBU&yItji6aLgYQ&VTsvU<#R>B;nG(J^OlG%lo4+TUL2J4py84P9nOmucwW-O#npY8%FfT^p?%$&Gl~xJQT>Z2D|+ zC!bro)F&n-aUfaKxcr^`%EYYe_(7>wtsiINc=M%wJ5Ky4Sc1cmryTe!49h5*6CVus ziN0jB__WzRif(ybM!4-!j(Zil>&jh5eb{mKWLg!)3!`i%r^k;0D-FKlK>^`>l6d?C zs&^LpMUMx`vjtRa=^P!c2xq<%*D^Pv6#vU^ z{c+T}&Hrn6L)jrYh-4DUAt07ns(IHhK;7hXTnB+P{krP}Y%P%H>$cB4yUO@+R78Bn zs5Bfe-~}8fIjh6RGEWt@98EaBM_zA{&a3_JDI)MLj<(e%Up!`6Z0?WhA?i>_M^@$rzG6 zl6^=Jg=D-~q_tA9$W^B~D6gPA!miscFCiPPb1aLqs7opVuf2ZN=a*5?0>nyiNSJ54 z&J89bv0%N92|kybAQ!|Nx&8~7w|qCps*tgAjh7hZSQq?&a>nAQ*651MWR$ZCTeIRN zs1>{9^KYR+EF5uF3#uhDqN)4knCiJT@oM*x?q^%_9QfUXzyB5SQTJDMes0_7`4dTB z1CiPl&XMa8f9-vB2KR2uQ0>8YQrBpBwdQAoBQE_N{pUor?+76H&-<<|eFp_t8hjJU zcagjT#EP7EARUXq%J}*49N-p?qR>q|kddo3$K&sy#AIs@03?MZa#p%7qb0ZIGkz0w z1{6X*&A%Zw`#bya7?K^0HmE|6UbL%qmtBPXLxXMiPlg>hE*|#hb0@+0nNN@gt+Bs} z!oVE4yX_48`Z<{y8#*EXnofdF4Z|4~9?8yo`bG0cm)snt(HhEK0rZgwEK+YPLz` z2cw7ohDY>_oH_O`>Yle%STL&pWDM$lh4~@A87_lcPTdVGad+hK*Q|)YR9nrbLqMzB z!IID40#9p~TU#xYJjVVS3Ds;8C%@kMpn(Bh?*e^t;pQdkUQT5wWeqFcD`mT;=G|kZR2gIFy1FtAB#gkCl+Ap|x)YlL3W(;==t+P0uKpX}uf1+-emhB3Z3*xiFWT^vSbl@n9WC{tw z4o5KNs@(4)_pzp3*3{JF_2I9XbcvJuv$<$XlR26=YIY@#C#DjUW+I`Rq)Ttn{{wxZCp!QD diff --git a/MDAF/__pycache__/__init__.cpython-39.pyc b/MDAF/__pycache__/__init__.cpython-39.pyc index 4900808f00ff53046a6124e43289ccc9d46a3f1e..e92d3a461c1081e1be212bd2c4225926f5f36e90 100644 GIT binary patch delta 211 zcmbQqbe)Mek(ZZ?0SJ_yTP5zF$Scd}Gf~^5o*{)bhas0Wij|Qeg&~Cv$YzUT1G3qJ z88kUwg4Am=-r_AvEhtJYPR%PxE6qy=3NWYSrvfR?f}DJ?P%)6hnwy`Jnge8Tmt_{0 zCgx;Tr5d>axxATq#U+V3Ic_9!zMQ$ScceGEv)vl{J__lWk&+q%Ut~UU5lcPL5k*PI7*} zCgUyUl>Ag6#aWP(Uy@dumt5?p$$E>^*TvCI4@49(0nI961`#YEf)z-tWGG?>vDqiH OFuHQF0hv6EAP4|`Z5<>4 diff --git a/README.md b/README.md index aace054..cceadb7 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,17 @@ ## install the package with -pip install git+fullurl +- pip install git+fullurl + - - if needed to reinstall the package for testing: py -m pip install --upgrade --force-reinstall git+fullurl - use specific versions: python 37 - dependencies: rpy2, scikitlearn, - Windows: install R first + - When using installFlacco please choose to create a new library + +- Please ignore the importlib install error since it is a built in package of python + - Removed the importlib dependency to resolve the issue + -- Please ignore the importlin install error since it is a built in package of python diff --git a/tests/__pycache__/test_flows.cpython-39-pytest-6.2.4.pyc b/tests/__pycache__/test_flows.cpython-39-pytest-6.2.4.pyc index c8c49ab996e6d2fdc6027653e40fccfc729116d4..874f23583d296976959881dc406fcdaa4dd67fef 100644 GIT binary patch delta 842 zcmZ8fO=}ZT6rGpM$D2vUG-EaOV`^=y=@6y0x-b&mi0wit6zir4A?Ce6v`xaDNx_v1 z-G~b*Z)FA1Wx<^raVNMC{0FlTaVM_CKj6J%nsFR>hdbw<`|-}qx5|r(+j3n;!)Nc; zmDbH&*JrPGYd0RPYC;#r6HOS>ykB^n-z*|y3JV!)#JI?CVIyOYm_x`oqJT_c#FXTO zC_c!+o-|*V-)Kw|?6wxTKWN}uz+xBV0Awh8QD@j|Bas(<+151m+^)P^VqY1ns8aqG zE2z8qFU(L2`eNI{THpjWbphHwu%Jwghp_2TuN?{9&O?FYvf};eLF-&0;mm?WQ z-CiW2*V>}e&{rSy&V^$nJ2BQ~t3byDO%5sGjC-J~b>mZ&Wc%#zHrbNcp+Ws&G#Eyg zRKq-9_fZSe1g8jQ3DTM*q77jN;Ub%o#;+iRh>UI&ye)E`po^6vlLbd7{LOtOwWYVgt z*~{lnX0z!P<}uO0b6}SP^LUBN>ZAR3I#Hd@Rwmn$A$Qa>r&^!OX4AflnApH`U=6*; zyxH7tb$iWb;HjU^&b^p#p!3&Tp-eto;wR8XKyskZ5bIR&&&9?gV&2&9i{X~MM(%|4 Uhs`pcE3%^D1)l9qc{XQ%0Pq@{LI3~& delta 896 zcmZ8fJ#W)c6!pu8{p`dIaRO-zX(5FM7Yb@55S3670)i?*7b=jl7%O(9fMbVirxH_# zvLG?EdJ_wRu@XXpsVgJmADD#!1|)s}6XITzCInmW_`P%QJ@@1JW#wx{w{=~U@LAt^ z`*3$pud)w&=WcB~l9TaxFW1U33HMnqzbW089NAHxNsi*mkMx~%YYG|esK}^8rhts* zxtlss*$o9OZ z?X`md4QVHE@xzwh|NO<+jQF0q!*tO|e`bpKoxa#sQ2?kH$dMG}5lsb3#FPfpUZV}Jt1E4YV#~@ zO#()+gs@>|fE43wA8w>9`^K+BdaSMxRSi^NVG7T27iEnd>$HHV( zQYj7Nfv~mu>X}LFSaSsp_i-JLh0Zazte)NVEz2y6kJ{FD(nia;d-Hnp!Y0nYiI*I8 z13!#89dFp7o7`tIWS}yEbb#(A&XCkU-Hvj{{Aw?72A;b{BMa##t1+I+GkST}Fb&n1 IHdN030FlM2Qvd(} diff --git a/tests/__pycache__/test_funcs.cpython-39-pytest-6.2.4.pyc b/tests/__pycache__/test_funcs.cpython-39-pytest-6.2.4.pyc index 6dd62ead9503f31d3897737637e9147ce8a02638..3bdb01f0354b9d61160dcf917f16188481f02972 100644 GIT binary patch delta 74 zcmeyt_JfTlk(ZZ?0SH*%TP1Gf(PR>c;z}#cOU}(tDa}b;$xtLQ*_A1gQEKvXra7Wg PKy^hDsD$L?2xbKU)ff?S delta 74 zcmeyt_JfTlk(ZZ?0SF#XUz4zrN0Uk57FSwnUUF`JN@-5&N`@lI$*xR^jM9^rGtCi| Q2C6HPL?xsqM=&b@04fL)@Bjb+ diff --git a/tests/test_flows.py b/tests/test_flows.py index 88f0c2d..6512e7b 100644 --- a/tests/test_flows.py +++ b/tests/test_flows.py @@ -2,9 +2,7 @@ import unittest import os from MDAF.MDAF import representfunc -from MDAF.MDAF import installFalcoo from MDAF.MDAF import doe -from MDAF.TestFunctions import * #target = __import__("MDAF.py") diff --git a/tests/deprecated_funcs.py b/tests/test_funcs.py similarity index 100% rename from tests/deprecated_funcs.py rename to tests/test_funcs.py