-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathcurrinexp.py
37 lines (28 loc) · 954 Bytes
/
currinexp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python
import math
import os
import sys
import warnings
from collections import OrderedDict
# ensure backward compatibility
from hypermapper import optimizer # noqa
def currin_exp_function(X):
"""
Compute the CurrinExp function.
The value is computed as defined in https://www.sfu.ca/~ssurjano/curretal88exp.html
:param X: dictionary containing the input points.
:return: the value of the CurrinExp function.
"""
x1 = X["x1"]
x2 = X["x2"]
factor1 = 1 - math.exp(-1 / (2 * x2))
factor2 = 2300 * x1 * x1 * x1 + 1900 * x1 * x1 + 2092 * x1 + 60
factor3 = 100 * x1 * x1 * x1 + 500 * x1 * x1 + 4 * x1 + 20
y_value = factor1 * factor2 / factor3
return y_value
def main():
parameters_file = "example_scenarios/synthetic/currinexp/currinexp_scenario.json"
optimizer.optimize(parameters_file, currin_exp_function)
print("End of CurrinExp.")
if __name__ == "__main__":
main()