Boundary constraints


class topfarm.constraint_components.boundary.XYBoundaryConstraint(boundary, boundary_type='convex_hull', units=None, relaxation=False, **kwargs)[source]
__init__(boundary, boundary_type='convex_hull', units=None, relaxation=False, **kwargs)[source]

Initialize XYBoundaryConstraint

  • boundary (array_like (n,2) or list of tuples (array_like (n,2), boolean)) – boundary coordinates. If boundary is array_like (n,2) it indicates a single boundary and can be used with boundary types: ‘convex_hull’, ‘polygon’, ‘rectangle’,’square’. If boundary is list of tuples (array_like (n,2), boolean), it is multiple boundaries where the boolean is 1 for inclusion zones and 0 for exclusion zones and can be used with the boundary type: ‘multi_polygon’.

  • boundary_type ('convex_hull', 'polygon', 'rectangle','square') –

    • ‘convex_hull’ (default): Convex hul around boundary points

    • ’polygon’: Polygon boundary (may be non convex). Less suitable for gradient-based optimization

    • ’rectangle’: Smallest axis-aligned rectangle covering the boundary points

    • ’square’: Smallest axis-aligned square covering the boundary points

    • ’multi_polygon’: Mulitple polygon boundaries incl. exclusion zones (may be non convex).

    • ’turbine_specific’: Set of multiple polygon boundaries that depend on the wind turbine type.


class topfarm.constraint_components.boundary.CircleBoundaryConstraint(center, radius)[source]
__init__(center, radius)[source]

Initialize CircleBoundaryConstraint

  • center ((float, float)) – center position (x,y)

  • radius (int or float) – circle radius

Other constraints


class topfarm.constraint_components.spacing.SpacingConstraint(min_spacing, units=None, aggregation_function=None, full_aggregation=False, name='spacing_comp')[source]
__init__(min_spacing, units=None, aggregation_function=None, full_aggregation=False, name='spacing_comp')[source]

Initialize SpacingConstraint

  • min_spacing (int or float) – Minimum spacing between turbines [m]

  • aggregation_function (topfarm.utils.AggregationFunction or None) – if None: compute returns all wt-wt spacings (n_wt *(n_wt-1))/2 if AggregationFunction: compute returns an aggregated (minimum) spacing