def test_find_maximum_and_minimum(self): sol1 = Solution(x=[1, 2, 3], value=1) sol2 = Solution(x=[1, 3, 4], value=2) sol3 = Solution(x=[1, 5, 6], value=3) sol_set = [sol1, sol2, sol3] assert sol1.is_equal(Solution.find_minimum(sol_set)[0]) assert sol3.is_equal(Solution.find_maximum(sol_set)[0])
def test_is_equal(self): sol1 = Solution(x=[1, 2, 3]) sol2 = Solution(x=[1, 3, 4]) assert sol1.is_equal(sol2) is False assert sol1.is_equal(sol1) is True
def test_deep_copy(self): sol1 = Solution(x=[1, 2, 3]) sol2 = sol1.deep_copy() assert sol1.is_equal(sol2)