optiwindnet.augmentation ======================== .. py:module:: optiwindnet.augmentation Module Contents --------------- .. py:function:: get_shape_to_fill(L: networkx.Graph) -> tuple[optiwindnet.geometric.CoordPairs, optiwindnet.geometric.CoordPairs] Calculate the area and scale the border so that it has area 1. The border and OSS are translated to the 1st quadrant, near the origin. IF SITE HAS MULTIPLE OSSs, ONLY 1 IS RETURNED (mean of the OSSs' coords). .. py:function:: poisson_disc_filler(T: int, min_dist: float, BorderC: optiwindnet.geometric.CoordPairs, RepellerC: optiwindnet.geometric.CoordPairs | None = None, repel_radius: float = 0.0, obstacleC__: list[optiwindnet.geometric.CoordPairs] = [], seed: int | None = None, max_iter: int = 10000, plot: bool = False, partial_fulfilment: bool = True, rounds: int = 1) -> optiwindnet.geometric.CoordPairs Randomly place points inside an area respecting a minimum separation. Fills the area delimited by `BorderC` with `T` randomly placed points that are at least `min_dist` apart and that don't fall inside any of the `RepellerC` discs or `obstacles` areas. :param T: number of points to place. :param min_dist: minimum distance between place points. :param BorderC: coordinates (B × 2) of border polygon. :param RepellerC: coordinates (R × 2) of the centers of forbidden discs. :param repel_radius: the radius of the forbidden discs. :param obstacleC__: sequence of coordinate arrays (X × 2). :param iter_max_factor: factor to multiply by `T` to limit the number of iterations. :param rounds: number of times to start from empty while `T` is not reached. :param partial_fulfilment: whether to return less than `T` points (True) or to raise exception (False) if unable to fulfill request. :returns: coordinates (T, 2) of placed points .. py:function:: turbinate(L: networkx.Graph, T: int, d: float, *, root_clearance: float | None = None, plot: bool = False, max_iter: int = 100000, rounds: int = 5) -> networkx.Graph Fills the location `L` with `T` turbines spaced at least `d` apart. Only the border and root locations from `L` are used. The placement of turbines is random and some combinations of `T` and `d` will result in fewer placements than requested. Increase `max_iter` and `rounds` to apply more effort before aborting. :param L: reference location (only borders, obstacles and substations are used) :param T: desired number of turbines to place :param d: minimum spacing between turbines :param root_clearance: minimum spacing from turbine to substation (if not given, `d` is used) :param max_iter: maximum number of turbine placement attempts per empty field. :param rounds: how many times to start from an empty field before aborting. :returns: A location with randomly placed turbines (the number may be lower than T)