region.p_regions.azp_util module

class region.p_regions.azp_util.AllowMoveAZP

Bases: region.p_regions.azp_util.AllowMoveStrategy

class region.p_regions.azp_util.AllowMoveAZPMaxPRegions(spatially_extensive_attr, threshold, decorated_strategy)

Bases: region.p_regions.azp_util.AllowMoveStrategy

Ensures that the spatially extensive attribute adds up to a given threshold in each region. Only moves preserving this condition in both the donor as well as the recipient region are allowed. The check for the recipient region is necessary in case there is an area with a negative spatially extensive attribute.

start_new_component(initial_labels, attr, objective_func, comp_idx)
class region.p_regions.azp_util.AllowMoveAZPSimulatedAnnealing(init_temperature, sa_moves_term=inf)

Bases: region.p_regions.azp_util.AllowMoveStrategy

notify_min_sa_moves()
notify_move_made()
register_move_made(observer_func)
Parameters:observer_func (callable) – A function to call when a move is allowed.
register_sa_moves_term(observer_func)
Parameters:observer_func (callable) – A function to call when the certain number of SA-moves has been reached. This number is called Q in [OR1995] (page 431).
reset()
update_temperature(temp)
class region.p_regions.azp_util.AllowMoveStrategy

Bases: abc.ABC

start_new_component(initial_labels, attr, objective_func, comp_idx)

This method should be called whenever a new connected component is clustered.

Parameters:
  • initial_labels (numpy.ndarray) – The region labels of the areas in the currently considered connected component. Shape: number of areas in the currently considered component.
  • attr (numpy.ndarray) – The areas’ attributes. Shape: number of areas in the currently considered component.
  • objective_func (region.objective_function.ObjectiveFunction) – The objective function to use.
  • comp_idx (numpy.ndarray) – The indices of those areas belonging to the component clustered next.