optiwindnet.augmentationΒΆ

Module ContentsΒΆ

optiwindnet.augmentation.get_shape_to_fill(L: networkx.Graph) tuple[optiwindnet.geometric.CoordPairs, optiwindnet.geometric.CoordPairs][source]ΒΆ

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).

optiwindnet.augmentation.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[source]ΒΆ

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.

Parameters:
  • T – number of points to place.

  • min_dist – minimum distance between place points.

  • BorderC – coordinates (B Γ— 2) of border polygon.

  • RepellerC – coordinates (R Γ— 2) of the centers of forbidden discs.

  • repel_radius – the radius of the forbidden discs.

  • obstacleC – sequence of coordinate arrays (X Γ— 2).

  • iter_max_factor – factor to multiply by T to limit the number of iterations.

  • rounds – number of times to start from empty while T is not reached.

  • 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

optiwindnet.augmentation.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[source]ΒΆ

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.

Parameters:
  • L – reference location (only borders, obstacles and substations are used)

  • T – desired number of turbines to place

  • d – minimum spacing between turbines

  • root_clearance – minimum spacing from turbine to substation (if not given, d is used)

  • max_iter – maximum number of turbine placement attempts per empty field.

  • 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)