def test_true_possible_queen_region_movement(self): """ A region removal yields in fact a feasible solution using queen contiguity. """ am = AreaManager(self.layer.Wqueen, self.layer.Y) rm = RegionMaker(am, initialSolution = self.possible_queen_solution) """ Removing area 49 from region 0 leaves areas attached by a point""" feasible = rm.checkFeasibility(0, 49, rm.region2Area) assert feasible
def test_true_possible_rook_region_movement(self): """ A possible region change is in fact a feasible movement using rook contiguity. """ am = AreaManager(self.layer.Wrook, self.layer.Y) rm = RegionMaker(am, initialSolution = self.possible_rook_solution) """ Removing area 29 from region 1 is an allowed movement""" feasible = rm.checkFeasibility(1, 29, rm.region2Area) assert feasible
def test_false_possible_rook_region_movement(self): """ Removing an area that breaks the contiguity constraint. """ am = AreaManager(self.layer.Wrook, self.layer.Y) rm = RegionMaker(am, initialSolution = self.possible_rook_solution) """ Removing area 47 from region 1 leaves area 48 as an island""" feasible = rm.checkFeasibility(1, 47, rm.region2Area) assert not feasible
def test_false_possible_queen_region_movement(self): """ An infeasible region removal yields an uncontiguos region. Using WQueen. """ am = AreaManager(self.layer.Wqueen, self.layer.Y) rm = RegionMaker(am, initialSolution = self.possible_queen_solution) """ Removing area 47 from region 1 leaves area 58 as an island""" feasible = rm.checkFeasibility(1, 47, rm.region2Area) assert not feasible