Design space
The design space can be created with the DesignSpace class.
Usage
Creating parameters
There are three types of parameters that can be created: continous, discrete and categorical:
We can create continous parameters with a
lower_boundandupper_boundwith theContinuousParameterclass
x1 = f3dasm.ContinuousParameter(name='x1', lower_bound=0.0, upper_bound=100.0)
x2 = f3dasm.ContinuousParameter(name='x2', lower_bound=0.0, upper_bound=4.0)
y = f3dasm.ContinuousParameter('y') # the default bounds are -np.inf, np.inf
We can create discrete parameters with a
lower_boundandupper_boundwith theDiscreteParameterclass
x3 = f3dasm.DiscreteParameter('x3', lower_bound=2, upper_bound=4)
x4 = f3dasm.DiscreteParameter('x4', lower_bound=74, upper_bound=99)
We can create categorical parameters with a list of strings (
categories) with theCategoricalParameterclass
x5 = f3dasm.CategoricalParameter('x5', categories=['test1','test2','test3','test4'])
x6 = f3dasm.CategoricalParameter('x6', categories=['material1','material2','material3'])
Creating the design space
The design space is then constructed by calling the DesignSpace class and providing:
* a list of input parameters (input_space)
* a list of output parameters (output_space):
design = f3dasm.DesignSpace(input_space=[x1, x2, x3, x4, x5, x6], output_space=[y])
Helper function for single-objective, n-dimensional continuous design spaces
We can make a n-dimensional continous, single-objective design space with the helper function make_nd_continuous_design(). We have to specify the boundaries for each of the dimensions with a numpy array:
bounds = np.array([[-1.0, 1.0], [-1.0, 1.0]])
design = f3dasm.make_nd_continuous_design(bounds=bounds, dimensions=2)