Wind Farm Layout#
Source: examples/optimization/wind_farm_layout.py
Introduction#
Inspect the compact grid-based wind-farm layout optimization benchmark.
Technical Implementation#
This page is generated from the top-of-file module docstring and the example source code. The full script is included below for direct inspection.
1from __future__ import annotations
2
3import design_research_problems as derp
4
5
6def main() -> None:
7 """Print one decoded layout and the baseline solver result."""
8 problem = derp.get_problem("wind_farm_grid_qkp_power_max")
9 initial = problem.generate_initial_solution()
10 initial_state = problem.decode_candidate(initial)
11 result = problem.solve()
12 solved_state = problem.decode_candidate(result.x)
13
14 print("Compact wind-farm layout benchmark")
15 print("initial_selected_indices", initial_state.selected_indices)
16 print("initial_expected_power_mw", round(initial_state.expected_power_mw, 4))
17 print("solved_selected_indices", solved_state.selected_indices)
18 print("solved_coordinates_m", solved_state.selected_coordinates_m)
19 print("solved_expected_power_mw", round(solved_state.expected_power_mw, 4))
20 print("success", result.success)
21 print("message", result.message)
22
23
24if __name__ == "__main__":
25 main()
Expected Results#
Run Command
PYTHONPATH=src python3 examples/optimization/wind_farm_layout.py
Run the command shown below from repository root. Output should summarize the problem setup, a baseline solution, or diagnostic values relevant to this example.