Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions black_box/blackbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import scipy.optimize as op
import datetime
import math


def search_min(f, domain, budget, batch, resfile,
Expand Down Expand Up @@ -78,9 +79,9 @@ def cubetobox(x):

# volume of d-dimensional ball (r = 1)
if d % 2 == 0:
v1 = np.pi**(d/2)/np.math.factorial(d/2)
v1 = np.pi**(d/2)/math.factorial(int(d/2))
else:
v1 = 2*(4*np.pi)**((d-1)/2)*np.math.factorial((d-1)/2)/np.math.factorial(d)
v1 = 2*(4*np.pi)**((d-1)/2)*math.factorial(int((d-1)/2))/np.math.factorial(d)

# subsequent iterations (current subsequent iteration = i*batch+j)

Expand Down