-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Reading the documentation, it does state with mathematical notation (
To verify the order matters (not that I did it by mistake at first and this is how I realised):
class Problem:
def get_bounds(self, ) -> tuple[np.ndarray, np.ndarray]:
# Some unoptimized code
box_bounds_lower = [0, 0, ..., 0, 0.0, ..., 0.0]
box_bounds_upper = [1, 1, ..., 1, 1.0, ..., 1.0]
return box_bounds_lower, box_bounds_upper
# Integer dec. variables before real raises value error
prob = pg.problem(Problem())
# Output:
ValueError:
function: check_problem_bounds
where: /root/install/pagmo2-2.19.0/src/problem.cpp, 104
what: An upper bound of the integer part of the decision vector is: 35.182177 and is not an integer.By changing the bounds order, the error goes away:
...
def get_bounds(self, ) -> tuple[np.ndarray, np.ndarray]:
return box_bounds_lower[::-1], box_bounds_upper[::-1]
prob = pg.problem(Problem())
# Output:
Problem name: SolarMED MINLP problem
C++ class name: pybind11::object
Global dimension: 78
Integer dimension: 24
Fitness dimension: 11
Number of objectives: 1
Equality constraints dimension: 0
Inequality constraints dimension: 10
Tolerances on constraints: [0, 0, 0, 0, 0, ... ]
Lower bounds: [0, 0, 0, 0, 0, ... ]
Upper bounds: [35.3206, 35.286, 35.1822, 0, 0, ... ]
Has batch fitness evaluation: falseAlso, I wonder if since the data types of the box-bounds already need to match the data type of the decision vector, if it would not be possible to support an arbitrary ordering of the decision vector.
Best regards,
Juanmi
Metadata
Metadata
Assignees
Labels
No labels