Ejemplo n.º 1
0
 def test_racos_common_is_distinct(self):
     a = Solution(x=[1, 2, 3])
     b = Solution(x=[2, 3, 4])
     c = Solution(x=[3, 4, 5])
     seti = [a, b]
     assert RacosCommon.is_distinct(
         seti, a) is False and RacosCommon.is_distinct(seti, c) is True
Ejemplo n.º 2
0
    def __init__(self, dimension, parameter):
        """
        Initialization.

        :param dimension: instance of Dimension2 class
        :param parameter: instance of Parameter class
        """

        RacosCommon.__init__(self)
        self.clear()
        objective = Objective(None, dimension)
        self.set_objective(objective)
        self.set_parameters(parameter)

        self.init_num = 0
        self.complete_num = 0
        self.semaphore = 1  # control init
        self.ub = self._parameter.get_uncertain_bits()
        if self.ub is None:
            self.ub = self.choose_ub(self.get_objective())
        return
Ejemplo n.º 3
0
 def __init__(self):
     """
     Initialization.
     """
     RacosCommon.__init__(self)
     return
Ejemplo n.º 4
0
 def test_racos_common_extend(self):
     a = [1, 2, 3]
     b = [2, 3, 4]
     assert RacosCommon.extend(a, b) == [1, 2, 3, 2, 3, 4]
Ejemplo n.º 5
0
 def __init__(self):
     RacosCommon.__init__(self)