Closed Orca-bit closed 3 years ago
@Orca-bit, thank you for pointing out to this inconsistency. It's actually a mistake in the documentation. In a previous version, the user had to specify the dimension of the Cartesian product set, but we then figured out that this is not necessary.
All you have to do is to construct a CartesianProduct
without the dimension, i.e.,
import opengen as og
segment_ids = [1, 4]
dim = 5
ball = og.constraints.Ball2()
rect = og.constraints.Rectangle(xmin=[-1,-2,-3], xmax=[0, 10, -1])
bounds = og.constraints.CartesianProduct(segment_ids, [ball, rect])
I will update the docs tomorrow.
When I use the Python code from here, my terminal showed me an error, that is,
bounds = og.constraints.CartesianProduct(dim, segment_ids, [ball,rect]) TypeError: __init__() takes 3 positional arguments but 4 were given
how can I fix it