示例#1
0
 def test_range(self):
     self.assertTrue(
         np.array_equal(
             full_array(self.Upper, self.D) -
             full_array(self.Lower, self.D), self.task.range))
     self.assertTrue(
         np.array_equal(
             full_array(self.Upper, self.D) -
             full_array(self.Lower, self.D), self.task.range))
示例#2
0
    def __init__(self, dimension=1, lower=None, upper=None, *args, **kwargs):
        r"""Initialize Problem.

        Args:
            dimension (Optional[int]): Dimension of the problem.
            lower (Optional[Union[float, Iterable[float]]]): Lower bounds of the problem.
            upper (Optional[Union[float, Iterable[float]]]): Upper bounds of the problem.

        """
        self.dimension = dimension
        self.lower = full_array(lower, dimension)
        self.upper = full_array(upper, dimension)
示例#3
0
 def test_upper(self):
     self.assertTrue(
         np.array_equal(full_array(self.Upper, self.D), self.task.upper))
     self.assertTrue(
         np.array_equal(full_array(self.Upper, self.D), self.task.upper))
示例#4
0
 def test_lower(self):
     self.assertTrue(
         np.array_equal(full_array(self.Lower, self.D), self.task.lower))
     self.assertTrue(
         np.array_equal(full_array(self.Lower, self.D), self.task.lower))