def test_lhs(self):
import numpy as np
import matplotlib.pyplot as plt
from smt.sampling import LHS
xlimits = np.array([
[0., 4.],
[0., 3.],
])
sampling = LHS(xlimits=xlimits)
num = 50
x = sampling(num)
print(x.shape)
plt.plot(x[:, 0], x[:, 1], 'o')
plt.xlabel('x')
plt.ylabel('y')
plt.show()
评论列表
文章目录