Skip to content

Commit

Permalink
Minor changes to michalewitz.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeurer committed Jul 13, 2015
1 parent e65ff6a commit 4c931a7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 88 deletions.
58 changes: 0 additions & 58 deletions benchmarks/michalewicz/.nfs0000000007b204940000008f

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/michalewicz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
__authors__ = ["Katharina Eggensperger", "Matthias Feurer"]
__contact__ = "automl.org"
4 changes: 2 additions & 2 deletions benchmarks/michalewicz/config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ config = config.pb
[HPOLIB]
console_output_delay = 2.0
function = python ../michalewicz.py
number_of_jobs = 50
result_on_terminate = 3
number_of_jobs = 200
result_on_terminate = 0.0
54 changes: 28 additions & 26 deletions benchmarks/michalewicz/michalewicz.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,47 @@

__authors__ = ["Mohsin Ali"]
__contact__ = ["automl.org"]
__credits__ = ["Sonja Surjanovic", "Derek Bingham",]
__credits__ = ["Sonja Surjanovic", "Derek Bingham"]
__function__= ["MICHALEWICZ FUNCTION"]

import time

import HPOlib.benchmarks.benchmark_util as benchmark_util

def michal(xx,m):
import math

d=len(xx);
sum=0;
for ii in range(d):
xi=xx[ii];
i=ii+1;
new=math.sin(xi) * math.pow((math.sin(i*math.pow(xi,2)/math.pi)),(2*m));
sum=sum+new;
def michal(xx, m):
import math

return -sum;
d = len(xx)
sum_ = 0
for ii in range(d):
xi = xx[ii]
i = ii+1
new = math.sin(xi) * \
math.pow((math.sin(i * math.pow(xi, 2) / math.pi)), (2*m))
sum_ += new

return -sum_


def main(params, **kwargs):
print 'Params: ', params;
print 'kwargs: ', kwargs;
print 'Params: ', params
print 'kwargs: ', kwargs

xx=[float(params["x1"]),float(params["x2"]),
float(params["x3"]),float(params["x4"]),
float(params["x5"]),float(params["x6"]),
float(params["x7"]),float(params["x8"]),
float(params["x9"]),float(params["x10"]),];
xx = [float(params["x1"]), float(params["x2"]),
float(params["x3"]), float(params["x4"]),
float(params["x5"]), float(params["x6"]),
float(params["x7"]), float(params["x8"]),
float(params["x9"]), float(params["x10"])]

y = michal(xx, 10)
return y

y = michal(xx,10);
return y;

if __name__ == "__main__":
starttime = time.time()
args, params = benchmark_util.parse_cli()
result = main(params, **args)
duration = time.time() - starttime
print "Result for ParamILS: %s, %f, 1, %f, %d, %s" % \
("SAT", abs(duration), result, -1, str(__file__))
starttime = time.time()
args, params = benchmark_util.parse_cli()
result = main(params, **args)
duration = time.time() - starttime
print "Result for ParamILS: %s, %f, 1, %f, %d, %s" % \
("SAT", abs(duration), result, -1, str(__file__))

0 comments on commit 4c931a7

Please sign in to comment.