IEA Wind Task 55¶
This notebook applies OptiWindNet to design collector system networks for the two offshore wind plants described in the IEA Wind TCP Task 55 report (740 MW, 10 MW turbines). Using both regular and irregular turbine layouts in WindIO format, we use HGSRouter for warmstarting and MILPRouter (OR-Tools solver) for final optimization.
For more info about IEA Wind TCP Task 55: The IEA Wind 740-10-MW Reference Offshore Wind Plants read: https://www.osti.gov/biblio/2333634/
Load required data¶
Import required modules¶
[1]:
import numpy as np
from optiwindnet.api import WindFarmNetwork, HGSRouter, MILPRouter, ModelOptions
[2]:
# Display figures as SVG in Jupyter notebooks
%config InlineBackend.figure_formats = ['svg']
Cable data¶
[3]:
cables = [(2, 1500.0), (5, 1800.0), (7, 2000.0)]
Load turbine layouts¶
Load turbine layouts from WindIO yaml files (Regular and Irregular turbine layouts)
WinfFarmNetwork.from_windIO()is specifically introduced in OptiWindNet for WindIO file formats.
[4]:
wfn_reg = WindFarmNetwork.from_windIO(filepath='data/IEA37_Borssele_Regular_System.yaml', cables=cables)
[5]:
wfn_irr = WindFarmNetwork.from_windIO(filepath='data/IEA37_Borssele_Irregular_System.yaml', cables=cables)
Plot locations’ geometry.¶
[6]:
wfn_reg
[6]:
[7]:
wfn_irr
[7]:
Choose the warmstart and main router¶
[8]:
warmstart_router = HGSRouter(time_limit=1, verbose=True)
solver_options=dict(
num_workers = 8,
)
model_options = ModelOptions(
topology='branched',
feeder_limit='unlimited',
feeder_route='segmented',
)
milp_router = MILPRouter(solver_name='ortools', time_limit=5, mip_gap=0.005, solver_options=solver_options, model_options=model_options, verbose=True)
For a detailed explanation about model_options and solver_options of MILP routers see Model Options and OR-Tools example Notebooks.
Regular turbine layout¶
Warmstart¶
[9]:
res_reg_warm = wfn_reg.optimize(router=warmstart_router)
Check the total length of the warm-start solution:
[10]:
wfn_reg.length()
[10]:
139656.4789599965
Optimize with MILP router¶
[11]:
res_reg = wfn_reg.optimize(router=milp_router, verbose=True)
Using warm start: the model is initialized with the provided solution S.
Starting CP-SAT solver v9.14.6206
Parameters: max_time_in_seconds: 5 log_search_progress: true relative_gap_limit: 0.005 num_workers: 8
Initial optimization model '': (model_fingerprint: 0xa6c6cb685fe1d85a)
#Variables: 1'536 (#bools: 768 in floating point objective) (1'388 primary variables)
- 768 Booleans in [0,1]
- 694 in [0,6]
- 74 in [0,7]
#kAtMostOne: 613 (#literals: 1'918)
#kLinear1: 1'536 (#enforced: 1'536)
#kLinear3: 2
#kLinearN: 223 (#terms: 3'834)
Starting presolve at 0.00s
The solution hint is complete and is feasible.
[Scaling] Floating point objective has 768 terms with magnitude in [440.736, 14559.3] average = 2868.79
[Scaling] Objective coefficient relative error: 6.70633e-10
[Scaling] Objective worst-case absolute error: 7.704e-05
[Scaling] Objective scaling factor: 1.04858e+06
5.68e-04s 0.00e+00d [DetectDominanceRelations]
1.08e-02s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=2 #num_dual_strengthening=1
9.36e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::ExtractEncodingFromLinear] #potential_supersets=687
3.69e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateColumns]
4.91e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
[Symmetry] Graph for symmetry has 5'789 nodes and 11'056 arcs.
[Symmetry] Symmetry computation done. time: 0.0011216 dtime: 0.00140614
3.99e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
1.20e-02s 3.70e-03d [operations_research::sat::CpModelPresolver::Probe] #probed=1'536
7.54e-04s 3.94e-04d [MaxClique] Merged 613(1'918 literals) into 303(1'298 literals) at_most_ones.
4.18e-04s 0.00e+00d [DetectDominanceRelations]
3.82e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
6.64e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ProcessAtMostOneAndLinear]
3.67e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
4.42e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
6.15e-04s 1.30e-05d [operations_research::sat::CpModelPresolver::DetectDominatedLinearConstraints] #relevant_constraints=151 #num_inclusions=75
6.35e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDifferentVariables]
5.02e-03s 3.02e-04d [operations_research::sat::CpModelPresolver::ProcessSetPPC] #relevant_constraints=379 #num_inclusions=377
5.70e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::FindAlmostIdenticalLinearConstraints]
6.12e-04s 2.40e-04d [operations_research::sat::CpModelPresolver::FindBigAtMostOneAndLinearOverlap]
5.24e-04s 2.83e-04d [operations_research::sat::CpModelPresolver::FindBigVerticalLinearOverlap]
1.22e-04s 1.15e-05d [operations_research::sat::CpModelPresolver::FindBigHorizontalLinearOverlap] #linears=148
1.70e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::MergeClauses]
4.27e-04s 0.00e+00d [DetectDominanceRelations]
4.44e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
4.63e-04s 0.00e+00d [DetectDominanceRelations]
4.34e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
1.93e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateColumns]
3.62e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
[Symmetry] Graph for symmetry has 5'168 nodes and 9'048 arcs.
[Symmetry] Symmetry computation done. time: 0.0008038 dtime: 0.00121764
[SAT presolve] num removable Booleans: 0 / 768
[SAT presolve] num trivial clauses: 0
[SAT presolve] [0s] clauses:37 literals:74 vars:74 one_side_vars:74 simple_definition:0 singleton_clauses:0
[SAT presolve] [6.38e-05s] clauses:37 literals:74 vars:74 one_side_vars:74 simple_definition:0 singleton_clauses:0
[SAT presolve] [0.0001108s] clauses:37 literals:74 vars:74 one_side_vars:74 simple_definition:0 singleton_clauses:0
3.67e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
1.12e-02s 3.42e-03d [operations_research::sat::CpModelPresolver::Probe] #probed=1'536
1.32e-03s 3.83e-04d [MaxClique]
4.08e-04s 0.00e+00d [DetectDominanceRelations]
4.25e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
4.04e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ProcessAtMostOneAndLinear]
3.85e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
3.77e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
3.98e-04s 9.77e-06d [operations_research::sat::CpModelPresolver::DetectDominatedLinearConstraints] #relevant_constraints=150 #num_inclusions=74
4.11e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDifferentVariables]
3.17e-04s 6.39e-06d [operations_research::sat::CpModelPresolver::ProcessSetPPC] #relevant_constraints=378
6.94e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::FindAlmostIdenticalLinearConstraints]
6.71e-04s 2.37e-04d [operations_research::sat::CpModelPresolver::FindBigAtMostOneAndLinearOverlap]
6.60e-04s 2.83e-04d [operations_research::sat::CpModelPresolver::FindBigVerticalLinearOverlap]
2.56e-04s 1.15e-05d [operations_research::sat::CpModelPresolver::FindBigHorizontalLinearOverlap] #linears=148
9.08e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::MergeClauses]
4.17e-04s 0.00e+00d [DetectDominanceRelations]
3.82e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
6.33e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ExpandObjective] #entries=7'628 #tight_variables=768 #tight_constraints=74
Presolve summary:
- 0 affine relations were detected.
- rule 'TODO linear inclusion: superset is equality' was applied 149 times.
- rule 'at_most_one: transformed into max clique.' was applied 1 time.
- rule 'deductions: 1536 stored' was applied 1 time.
- rule 'exactly_one: simplified objective' was applied 74 times.
- rule 'linear: positive equal one' was applied 74 times.
- rule 'objective: shifted cost with exactly ones' was applied 74 times.
- rule 'presolve: 0 unused variables removed.' was applied 1 time.
- rule 'presolve: iteration' was applied 2 times.
- rule 'setppc: exactly_one included in linear' was applied 74 times.
- rule 'setppc: reduced linear coefficients' was applied 73 times.
- rule 'setppc: removed trivial linear constraint' was applied 1 time.
- rule 'variables: detect fully reified value encoding' was applied 768 times.
- rule 'variables: detect half reified value encoding' was applied 1'536 times.
Presolved optimization model '': (model_fingerprint: 0x9cb918c826cc412f)
#Variables: 1'536 (#bools: 694 in objective) (1'388 primary variables)
- 768 Booleans in [0,1]
- 694 in [0,6]
- 74 in [0,7]
#kAtMostOne: 266 (#literals: 1'224)
#kBoolAnd: 37 (#enforced: 37) (#literals: 74)
#kExactlyOne: 74 (#literals: 768)
#kLinear1: 1'536 (#enforced: 1'536)
#kLinear3: 2
#kLinearN: 148 (#terms: 2'298)
[Symmetry] Graph for symmetry has 5'168 nodes and 9'048 arcs.
[Symmetry] Symmetry computation done. time: 0.0007205 dtime: 0.00121832
Preloading model.
#Bound 0.09s best:inf next:[123610.947,1028471.61] initial_domain
#1 0.09s best:139656.479 next:[123610.947,139656.479] complete_hint
#Model 0.10s var:1536/1536 constraints:2063/2063
Starting search at 0.10s with 8 workers.
6 full problem subsolvers: [core, default_lp, max_lp, no_lp, quick_restart, reduced_costs]
2 first solution subsolvers: [fj, fs_random_no_lp]
9 interleaved subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns, graph_dec_lns, graph_var_lns, ls, rins/rens, rnd_cst_lns, rnd_var_lns]
3 helper subsolvers: [neighborhood_helper, synchronization_agent, update_gap_integral]
#Bound 0.15s best:139656.479 next:[123610.951,139656.479] am1_presolve (num_literals=694 num_am1=20 increase=4458 work_done=2551)
#2 0.16s best:139650.831 next:[123610.951,139650.831] graph_cst_lns (d=5.00e-01 s=10 t=0.10 p=0.00 stall=0 h=base) [hint]
#Bound 0.17s best:139650.831 next:[131572.567,139650.831] default_lp
#Bound 0.18s best:139650.831 next:[131572.568,139650.831] reduced_costs
#Bound 0.23s best:139650.831 next:[135687.687,139650.831] max_lp
#Model 0.30s var:1526/1536 constraints:2053/2063
#Bound 0.37s best:139650.831 next:[135848.957,139650.831] max_lp
#3 0.50s best:139650.831 next:[135848.957,139650.831] rins_lp_lns (d=7.07e-01 s=18 t=0.10 p=1.00 stall=1 h=base)
#Bound 0.55s best:139650.831 next:[136118.437,139650.831] max_lp
#Model 0.69s var:1504/1536 constraints:2030/2063
#Bound 0.78s best:139650.831 next:[136183.946,139650.831] max_lp
#4 0.79s best:139645.183 next:[136183.946,139645.183] graph_var_lns (d=7.07e-01 s=17 t=0.10 p=1.00 stall=1 h=base)
#5 0.80s best:139645.183 next:[136183.946,139645.183] graph_var_lns (d=7.07e-01 s=17 t=0.10 p=1.00 stall=1 h=base) [combined with: rins_lp_lns (d=7.07e...]
#Bound 1.02s best:139645.183 next:[136221.036,139645.183] max_lp
#Model 1.09s var:1478/1536 constraints:2003/2063
#Bound 1.67s best:139645.183 next:[136284.537,139645.183] max_lp
#Bound 2.41s best:139645.183 next:[136351.677,139645.183] max_lp
#Bound 2.42s best:139645.183 next:[136355.681,139645.183] reduced_costs
#Bound 2.62s best:139645.183 next:[136401.974,139645.183] reduced_costs
#Bound 2.82s best:139645.183 next:[136464.159,139645.183] reduced_costs
#Model 2.90s var:1472/1536 constraints:1997/2063
#Bound 3.32s best:139645.183 next:[136498.186,139645.183] max_lp
#Bound 4.23s best:139645.183 next:[136576.285,139645.183] max_lp
Task timing n [ min, max] avg dev time n [ min, max] avg dev dtime
'core': 1 [ 4.91s, 4.91s] 4.91s 0.00ns 4.91s 1 [ 2.06s, 2.06s] 2.06s 0.00ns 2.06s
'default_lp': 1 [ 4.91s, 4.91s] 4.91s 0.00ns 4.91s 1 [332.84ms, 332.84ms] 332.84ms 0.00ns 332.84ms
'feasibility_pump': 2 [ 16.13ms, 1.13s] 570.82ms 554.69ms 1.14s 1 [464.60ms, 464.60ms] 464.60ms 0.00ns 464.60ms
'fj': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'fs_random_no_lp': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'graph_arc_lns': 4 [154.58ms, 459.67ms] 303.79ms 141.69ms 1.22s 4 [ 23.03ms, 100.07ms] 54.85ms 32.82ms 219.38ms
'graph_cst_lns': 6 [ 14.10ms, 362.02ms] 148.58ms 139.04ms 891.46ms 5 [612.00ns, 100.27ms] 43.38ms 46.72ms 216.90ms
'graph_dec_lns': 6 [ 9.26ms, 470.98ms] 197.58ms 193.69ms 1.19s 6 [ 10.00ns, 100.06ms] 36.86ms 45.01ms 221.16ms
'graph_var_lns': 5 [ 14.43ms, 569.29ms] 254.03ms 203.64ms 1.27s 5 [ 50.00ns, 100.03ms] 50.49ms 41.80ms 252.43ms
'ls': 5 [185.09ms, 228.85ms] 202.80ms 15.43ms 1.01s 5 [ 80.90ms, 100.01ms] 96.19ms 7.64ms 480.94ms
'max_lp': 1 [ 4.91s, 4.91s] 4.91s 0.00ns 4.91s 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'no_lp': 1 [ 4.90s, 4.90s] 4.90s 0.00ns 4.90s 1 [ 1.46s, 1.46s] 1.46s 0.00ns 1.46s
'quick_restart': 1 [ 4.91s, 4.91s] 4.91s 0.00ns 4.91s 1 [558.93ms, 558.93ms] 558.93ms 0.00ns 558.93ms
'reduced_costs': 1 [ 4.90s, 4.90s] 4.90s 0.00ns 4.90s 1 [ 1.27s, 1.27s] 1.27s 0.00ns 1.27s
'rins/rens': 6 [ 17.69ms, 593.41ms] 203.79ms 220.67ms 1.22s 5 [162.19us, 100.20ms] 40.78ms 48.45ms 203.89ms
'rnd_cst_lns': 5 [ 14.68ms, 424.10ms] 175.15ms 176.68ms 875.77ms 4 [692.00ns, 100.13ms] 46.55ms 46.57ms 186.21ms
'rnd_var_lns': 5 [ 20.16ms, 424.75ms] 197.11ms 166.07ms 985.53ms 5 [ 55.00ns, 100.13ms] 43.06ms 46.86ms 215.32ms
Search stats Bools Conflicts Branches Restarts BoolPropag IntegerPropag
'core': 788 55'090 148'503 4'912 1'070'912 2'912'113
'default_lp': 768 14 1'710 1'541 12'559 44'270
'fs_random_no_lp': 0 0 0 0 0 0
'max_lp': 768 0 1'536 1'536 11'765 39'153
'no_lp': 768 17'780 42'678 9'409 1'585'808 6'398'964
'quick_restart': 768 20 1'712 1'538 13'187 47'109
'reduced_costs': 774 265 9'880 4'626 48'319 297'880
SAT stats ClassicMinim LitRemoved LitLearned LitForgotten Subsumed MClauses MDecisions MLitTrue MSubsumed MLitRemoved MReused
'core': 51'636 1'097'712 4'818'085 3'293'151 591 434 3'262 0 14 100 16
'default_lp': 13 2'074 2'322 0 0 0 0 0 0 0 0
'fs_random_no_lp': 0 0 0 0 0 0 0 0 0 0 0
'max_lp': 0 0 0 0 0 0 0 0 0 0 0
'no_lp': 17'301 1'064'945 1'216'762 305'727 138 770 7'347 0 6 139 3
'quick_restart': 19 1'205 1'952 0 0 0 0 0 0 0 0
'reduced_costs': 242 11'060 56'679 0 1 296 2'654 0 0 0 0
Lp stats Component Iterations AddedCuts OPTIMAL DUAL_F. DUAL_U.
'default_lp': 1 8'761 3'123 227 0 1
'max_lp': 1 2'543 1'734 19 0 0
'quick_restart': 1 7'665 2'868 249 1 5
'reduced_costs': 1 20'326 1'961 438 126 75
Lp dimension Final dimension of first component
'default_lp': 1774 rows, 1462 columns, 18415 entries
'max_lp': 3134 rows, 1536 columns, 25288 entries
'quick_restart': 1797 rows, 1462 columns, 21883 entries
'reduced_costs': 1278 rows, 1536 columns, 12388 entries
Lp debug CutPropag CutEqPropag Adjust Overflow Bad BadScaling
'default_lp': 0 0 217 0 13'115 0
'max_lp': 0 0 19 0 23'273 0
'quick_restart': 0 0 239 0 13'710 0
'reduced_costs': 0 0 595 0 6'601 0
Lp pool Constraints Updates Simplif Merged Shortened Split Strenghtened Cuts/Call
'default_lp': 5'695 126 1'863 0 1'316 51 61 3'123/6'005
'max_lp': 4'565 252 1'697 0 1'157 173 14 1'734/3'482
'quick_restart': 5'440 123 1'655 0 1'188 23 125 2'868/5'948
'reduced_costs': 4'792 65 1'061 0 518 34 24 1'961/4'036
Lp Cut reduced_costs default_lp max_lp quick_restart
CG_FF: 25 46 10 22
CG_K: 17 21 5 14
CG_KL: 1 1 - 1
CG_R: 42 40 19 40
CG_RB: 67 104 53 89
CG_RBP: 10 36 22 43
IB: 709 627 - 617
MIR_1_FF: 41 134 57 119
MIR_1_K: 4 49 1 31
MIR_1_KL: - 23 - 20
MIR_1_R: - 3 1 1
MIR_1_RB: 27 95 32 70
MIR_1_RBP: 6 55 6 67
MIR_2_FF: 76 145 89 116
MIR_2_K: 11 56 3 65
MIR_2_KL: 7 15 3 16
MIR_2_R: 4 23 6 4
MIR_2_RB: 77 148 103 126
MIR_2_RBP: 21 74 22 105
MIR_3_FF: 81 82 115 77
MIR_3_K: 17 66 20 68
MIR_3_KL: 6 7 5 8
MIR_3_R: 10 8 12 5
MIR_3_RB: 64 98 112 99
MIR_3_RBP: 19 58 25 52
MIR_4_FF: 48 68 102 50
MIR_4_K: 20 70 36 45
MIR_4_KL: 3 5 11 2
MIR_4_R: 6 6 13 3
MIR_4_RB: 51 70 70 52
MIR_4_RBP: 18 63 48 56
MIR_5_FF: 24 33 69 33
MIR_5_K: 21 42 41 43
MIR_5_KL: 8 7 10 6
MIR_5_R: 3 3 6 5
MIR_5_RB: 28 29 49 40
MIR_5_RBP: 20 48 54 59
MIR_6_FF: 32 24 43 20
MIR_6_K: 22 49 35 39
MIR_6_KL: 7 14 14 6
MIR_6_R: 2 3 5 2
MIR_6_RB: 17 19 33 24
MIR_6_RBP: 13 43 41 38
ZERO_HALF_FF: 31 58 13 44
ZERO_HALF_K: 4 19 1 16
ZERO_HALF_KL: 3 1 - 3
ZERO_HALF_R: 205 328 279 341
ZERO_HALF_RB: 27 80 26 36
ZERO_HALF_RBP: 6 27 14 30
LNS stats Improv/Calls Closed Difficulty TimeLimit
'graph_arc_lns': 0/4 50% 5.97e-01 0.10
'graph_cst_lns': 1/5 60% 7.29e-01 0.10
'graph_dec_lns': 0/6 67% 8.34e-01 0.10
'graph_var_lns': 1/5 60% 7.00e-01 0.10
'rins/rens': 4/6 67% 8.25e-01 0.10
'rnd_cst_lns': 0/4 75% 8.21e-01 0.10
'rnd_var_lns': 0/5 60% 7.48e-01 0.10
LS stats Batches Restarts/Perturbs LinMoves GenMoves CompoundMoves Bactracks WeightUpdates ScoreComputed
'ls_restart_compound': 1 1 0 16'305 1'608 7'348 67 392'083
'ls_restart_compound_perturb': 1 1 0 12'871 1'335 5'768 90 325'294
'ls_restart_decay': 1 1 14'497 0 0 0 277 314'922
'ls_restart_decay_compound': 1 1 0 13'103 2'246 5'427 40 335'823
'ls_restart_perturb': 1 1 12'015 0 0 0 2'617 358'925
Solutions (5) Num Rank
'complete_hint': 1 [1,1]
'graph_cst_lns': 1 [2,2]
'graph_var_lns': 2 [4,5]
'rins_lp_lns': 1 [3,3]
Objective bounds Num
'am1_presolve': 1
'default_lp': 1
'initial_domain': 1
'max_lp': 9
'reduced_costs': 4
Solution repositories Added Queried Synchro
'feasible solutions': 5 83 5
'fj solution hints': 0 0 0
'lp solutions': 26 6 21
'pump': 0 0
Improving bounds shared Num Sym
'default_lp': 32 0
'max_lp': 34 0
'reduced_costs': 6 0
Clauses shared Num
'core': 9
'no_lp': 274
[Scaling] scaled_objective_bound: 136576 corrected_bound: 136576 delta: -2.56434e-06
CpSolverResponse summary:
status: FEASIBLE
objective: 139645.18265364
best_bound: 136576.2851673974
integers: 0
booleans: 0
conflicts: 0
branches: 0
propagations: 0
integer_propagations: 0
restarts: 0
lp_iterations: 0
walltime: 5.05009
usertime: 5.05009
deterministic_time: 8.15161
gap_integral: 65.546
solution_fingerprint: 0x6aa24a4cea96b19f
[12]:
wfn_reg.length()
[12]:
139645.18265364
[13]:
wfn_reg.cost()
[13]:
248112330.12342116
[14]:
wfn_reg
[14]:
Irregular turbine layout¶
[15]:
res_irr_warmup = wfn_irr.optimize(router=warmstart_router)
Check the total length of the warm-start solution:
[16]:
wfn_irr.length()
[16]:
136472.2480500915
Optimize with MILP router¶
[17]:
res_irr = wfn_irr.optimize(router=milp_router)
Using warm start: the model is initialized with the provided solution S.
Starting CP-SAT solver v9.14.6206
Parameters: max_time_in_seconds: 5 log_search_progress: true relative_gap_limit: 0.005 num_workers: 8
Initial optimization model '': (model_fingerprint: 0xdce7638cf32cc953)
#Variables: 1'192 (#bools: 596 in floating point objective) (1'044 primary variables)
- 596 Booleans in [0,1]
- 522 in [0,6]
- 74 in [0,7]
#kAtMostOne: 419 (#literals: 1'216)
#kLinear1: 1'192 (#enforced: 1'192)
#kLinear2: 4
#kLinear3: 5
#kLinearN: 216 (#terms: 2'957)
Starting presolve at 0.00s
The solution hint is complete and is feasible.
[Scaling] Floating point objective has 596 terms with magnitude in [539.378, 15073.7] average = 3460.13
[Scaling] Objective coefficient relative error: 4.51281e-10
[Scaling] Objective worst-case absolute error: 7.28067e-05
[Scaling] Objective scaling factor: 1.04858e+06
3.48e-04s 0.00e+00d [DetectDominanceRelations]
8.90e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=2 #num_dual_strengthening=1
5.12e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::ExtractEncodingFromLinear] #potential_supersets=493
3.20e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateColumns]
4.34e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
[Symmetry] Graph for symmetry has 4'413 nodes and 8'226 arcs.
[Symmetry] Symmetry computation done. time: 0.000752 dtime: 0.00080437
9.61e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
8.61e-03s 2.33e-03d [operations_research::sat::CpModelPresolver::Probe] #probed=1'192
7.72e-04s 2.25e-04d [MaxClique] Merged 419(1'216 literals) into 234(846 literals) at_most_ones.
3.30e-04s 0.00e+00d [DetectDominanceRelations]
3.16e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
4.10e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ProcessAtMostOneAndLinear]
3.17e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
3.03e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
4.90e-04s 1.01e-05d [operations_research::sat::CpModelPresolver::DetectDominatedLinearConstraints] #relevant_constraints=151 #num_inclusions=75
5.16e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDifferentVariables]
4.11e-03s 1.92e-04d [operations_research::sat::CpModelPresolver::ProcessSetPPC] #relevant_constraints=310 #num_inclusions=308
4.95e-05s 2.00e-07d [operations_research::sat::CpModelPresolver::FindAlmostIdenticalLinearConstraints] #num_tested_pairs=4
3.94e-04s 1.84e-04d [operations_research::sat::CpModelPresolver::FindBigAtMostOneAndLinearOverlap]
3.36e-04s 2.07e-04d [operations_research::sat::CpModelPresolver::FindBigVerticalLinearOverlap]
5.24e-05s 8.71e-06d [operations_research::sat::CpModelPresolver::FindBigHorizontalLinearOverlap] #linears=136
3.67e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::MergeClauses]
3.15e-04s 0.00e+00d [DetectDominanceRelations]
2.81e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
3.67e-04s 0.00e+00d [DetectDominanceRelations]
4.87e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
2.22e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateColumns]
3.35e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
[Symmetry] Graph for symmetry has 4'042 nodes and 6'890 arcs.
[Symmetry] Symmetry computation done. time: 0.0005567 dtime: 0.00073496
[SAT presolve] num removable Booleans: 0 / 596
[SAT presolve] num trivial clauses: 0
[SAT presolve] [0s] clauses:76 literals:152 vars:152 one_side_vars:152 simple_definition:0 singleton_clauses:0
[SAT presolve] [3.89e-05s] clauses:76 literals:152 vars:152 one_side_vars:152 simple_definition:0 singleton_clauses:0
[SAT presolve] [9.03e-05s] clauses:76 literals:152 vars:152 one_side_vars:152 simple_definition:0 singleton_clauses:0
2.47e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
6.84e-03s 2.15e-03d [operations_research::sat::CpModelPresolver::Probe] #probed=1'192
3.49e-04s 2.19e-04d [MaxClique]
8.13e-04s 0.00e+00d [DetectDominanceRelations]
4.39e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
4.68e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ProcessAtMostOneAndLinear]
4.03e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
3.75e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
4.62e-04s 7.55e-06d [operations_research::sat::CpModelPresolver::DetectDominatedLinearConstraints] #relevant_constraints=150 #num_inclusions=74
5.72e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDifferentVariables]
2.96e-04s 4.60e-06d [operations_research::sat::CpModelPresolver::ProcessSetPPC] #relevant_constraints=309
7.81e-05s 1.90e-07d [operations_research::sat::CpModelPresolver::FindAlmostIdenticalLinearConstraints] #num_tested_pairs=2
5.55e-04s 1.82e-04d [operations_research::sat::CpModelPresolver::FindBigAtMostOneAndLinearOverlap]
3.61e-04s 2.07e-04d [operations_research::sat::CpModelPresolver::FindBigVerticalLinearOverlap]
6.64e-05s 8.71e-06d [operations_research::sat::CpModelPresolver::FindBigHorizontalLinearOverlap] #linears=136
2.65e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::MergeClauses]
3.21e-04s 0.00e+00d [DetectDominanceRelations]
3.03e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
4.46e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ExpandObjective] #entries=4'968 #tight_variables=596 #tight_constraints=74
Presolve summary:
- 0 affine relations were detected.
- rule 'TODO linear inclusion: superset is equality' was applied 149 times.
- rule 'at_most_one: transformed into max clique.' was applied 1 time.
- rule 'deductions: 1192 stored' was applied 1 time.
- rule 'exactly_one: simplified objective' was applied 74 times.
- rule 'linear: positive equal one' was applied 74 times.
- rule 'objective: shifted cost with exactly ones' was applied 74 times.
- rule 'presolve: 0 unused variables removed.' was applied 1 time.
- rule 'presolve: iteration' was applied 2 times.
- rule 'setppc: exactly_one included in linear' was applied 74 times.
- rule 'setppc: reduced linear coefficients' was applied 73 times.
- rule 'setppc: removed trivial linear constraint' was applied 1 time.
- rule 'variables: detect fully reified value encoding' was applied 596 times.
- rule 'variables: detect half reified value encoding' was applied 1'192 times.
Presolved optimization model '': (model_fingerprint: 0xe724ee61a4757ecc)
#Variables: 1'192 (#bools: 522 in objective) (1'044 primary variables)
- 596 Booleans in [0,1]
- 522 in [0,6]
- 74 in [0,7]
#kAtMostOne: 158 (#literals: 694)
#kBoolAnd: 76 (#enforced: 76) (#literals: 152)
#kExactlyOne: 74 (#literals: 596)
#kLinear1: 1'192 (#enforced: 1'192)
#kLinear2: 4
#kLinear3: 1
#kLinearN: 145 (#terms: 1'777)
[Symmetry] Graph for symmetry has 4'042 nodes and 6'890 arcs.
[Symmetry] Symmetry computation done. time: 0.0005342 dtime: 0.00073413
Preloading model.
#Bound 0.07s best:inf next:[93516.0522,1236251.99] initial_domain
#1 0.07s best:136451.277 next:[93516.0522,136451.277] complete_hint
#Model 0.08s var:1192/1192 constraints:1650/1650
Starting search at 0.08s with 8 workers.
6 full problem subsolvers: [core, default_lp, max_lp, no_lp, quick_restart, reduced_costs]
2 first solution subsolvers: [fj, fs_random_no_lp]
9 interleaved subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns, graph_dec_lns, graph_var_lns, ls, rins/rens, rnd_cst_lns, rnd_var_lns]
3 helper subsolvers: [neighborhood_helper, synchronization_agent, update_gap_integral]
#Bound 0.11s best:136451.277 next:[95755.9972,136451.277] am1_presolve (num_literals=522 num_am1=19 increase=2348752631 work_done=1852)
#2 0.11s best:136417.955 next:[95755.9972,136417.955] no_lp [hint] (fixed_bools=0/596)
#Bound 0.12s best:136417.955 next:[104424.449,136417.955] quick_restart
#Bound 0.14s best:136417.955 next:[106103.007,136417.955] reduced_costs
#Bound 0.14s best:136417.955 next:[127628.142,136417.955] max_lp
#3 0.17s best:135518.936 next:[127628.142,135518.936] graph_arc_lns (d=5.00e-01 s=9 t=0.10 p=0.00 stall=0 h=base)
#4 0.17s best:135485.613 next:[127628.142,135485.613] graph_arc_lns (d=5.00e-01 s=9 t=0.10 p=0.00 stall=0 h=base) [combined with: no_lp [hint]...]
#5 0.24s best:135031.477 next:[127628.142,135031.477] rnd_cst_lns (d=7.07e-01 s=15 t=0.10 p=1.00 stall=1 h=base)
#Bound 0.27s best:135031.477 next:[128569.256,135031.477] max_lp
#Bound 0.44s best:135031.477 next:[129244.173,135031.477] max_lp
#Bound 0.65s best:135031.477 next:[129611.049,135031.477] max_lp
#6 0.80s best:134786.792 next:[129611.049,134786.792] rins_lp_lns (d=7.07e-01 s=23 t=0.10 p=1.00 stall=1 h=base)
#Bound 0.95s best:134786.792 next:[129817.488,134786.792] max_lp
#Model 1.02s var:1186/1192 constraints:1643/1650
#Bound 1.69s best:134786.792 next:[130126.924,134786.792] max_lp
#Model 1.93s var:1178/1192 constraints:1634/1650
#Bound 2.51s best:134786.792 next:[130294.755,134786.792] max_lp
#Model 2.59s var:1158/1192 constraints:1613/1650
#Model 3.05s var:1156/1192 constraints:1611/1650
#Bound 3.26s best:134786.792 next:[130386.84,134786.792] max_lp
#Model 3.52s var:1154/1192 constraints:1609/1650
#Bound 4.02s best:134786.792 next:[130524.724,134786.792] max_lp
#Bound 5.00s best:134786.792 next:[130587.993,134786.792] max_lp
Task timing n [ min, max] avg dev time n [ min, max] avg dev dtime
'core': 1 [ 4.92s, 4.92s] 4.92s 0.00ns 4.92s 1 [ 2.75s, 2.75s] 2.75s 0.00ns 2.75s
'default_lp': 1 [ 4.92s, 4.92s] 4.92s 0.00ns 4.92s 1 [393.30ms, 393.30ms] 393.30ms 0.00ns 393.30ms
'feasibility_pump': 10 [ 42.30us, 899.19ms] 91.29ms 269.33ms 912.92ms 1 [362.47ms, 362.47ms] 362.47ms 0.00ns 362.47ms
'fj': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'fs_random_no_lp': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'graph_arc_lns': 4 [ 79.26ms, 421.92ms] 248.60ms 161.43ms 994.39ms 4 [ 2.87ms, 100.02ms] 54.08ms 46.08ms 216.32ms
'graph_cst_lns': 5 [ 42.66ms, 491.89ms] 235.36ms 199.48ms 1.18s 5 [ 97.91us, 100.02ms] 43.42ms 46.32ms 217.09ms
'graph_dec_lns': 6 [ 7.35ms, 475.01ms] 170.54ms 199.49ms 1.02s 5 [ 10.00ns, 100.08ms] 38.77ms 46.84ms 193.85ms
'graph_var_lns': 6 [ 9.15ms, 436.03ms] 183.74ms 173.33ms 1.10s 6 [ 10.00ns, 100.06ms] 41.78ms 43.98ms 250.68ms
'ls': 5 [209.70ms, 236.42ms] 221.73ms 10.77ms 1.11s 5 [100.01ms, 100.01ms] 100.01ms 2.14us 500.04ms
'max_lp': 1 [ 4.95s, 4.95s] 4.95s 0.00ns 4.95s 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'no_lp': 1 [ 4.97s, 4.97s] 4.97s 0.00ns 4.97s 1 [ 2.40s, 2.40s] 2.40s 0.00ns 2.40s
'quick_restart': 1 [ 4.92s, 4.92s] 4.92s 0.00ns 4.92s 1 [695.76ms, 695.76ms] 695.76ms 0.00ns 695.76ms
'reduced_costs': 1 [ 4.92s, 4.92s] 4.92s 0.00ns 4.92s 1 [991.88ms, 991.88ms] 991.88ms 0.00ns 991.88ms
'rins/rens': 7 [983.30us, 504.62ms] 176.07ms 183.12ms 1.23s 5 [156.16us, 100.05ms] 44.31ms 38.25ms 221.56ms
'rnd_cst_lns': 5 [ 16.61ms, 446.21ms] 213.85ms 180.47ms 1.07s 5 [201.00ns, 100.04ms] 44.98ms 45.70ms 224.88ms
'rnd_var_lns': 7 [ 15.19ms, 419.24ms] 163.17ms 162.48ms 1.14s 7 [ 71.00ns, 100.06ms] 34.88ms 43.76ms 244.17ms
Search stats Bools Conflicts Branches Restarts BoolPropag IntegerPropag
'core': 615 62'106 153'970 7'180 954'872 2'734'964
'default_lp': 607 16 1'450 1'193 8'534 31'587
'fs_random_no_lp': 0 0 0 0 0 0
'max_lp': 596 0 1'192 1'192 7'268 24'807
'no_lp': 596 44'900 70'781 7'390 2'235'610 7'390'471
'quick_restart': 596 22 1'429 1'194 8'877 33'056
'reduced_costs': 596 88 3'992 2'333 18'065 85'300
SAT stats ClassicMinim LitRemoved LitLearned LitForgotten Subsumed MClauses MDecisions MLitTrue MSubsumed MLitRemoved MReused
'core': 57'478 565'496 4'040'406 3'363'080 739 3'065 29'317 0 635 9'445 688
'default_lp': 13 788 1'659 0 0 0 0 0 0 0 0
'fs_random_no_lp': 0 0 0 0 0 0 0 0 0 0 0
'max_lp': 0 0 0 0 0 0 0 0 0 0 0
'no_lp': 44'126 365'727 3'252'330 2'214'012 246 1'258 10'948 0 139 1'751 461
'quick_restart': 21 771 2'330 0 0 0 0 0 0 0 0
'reduced_costs': 85 2'842 5'608 0 0 146 1'008 0 0 0 0
Lp stats Component Iterations AddedCuts OPTIMAL DUAL_F. DUAL_U.
'default_lp': 1 5'750 3'081 284 0 0
'max_lp': 1 1'630 1'820 19 1 0
'quick_restart': 1 8'167 2'947 310 1 0
'reduced_costs': 1 12'276 2'524 347 77 6
Lp dimension Final dimension of first component
'default_lp': 1551 rows, 1119 columns, 17070 entries
'max_lp': 2639 rows, 1192 columns, 21942 entries
'quick_restart': 1542 rows, 1119 columns, 18674 entries
'reduced_costs': 1539 rows, 1192 columns, 16595 entries
Lp debug CutPropag CutEqPropag Adjust Overflow Bad BadScaling
'default_lp': 0 0 279 0 15'182 0
'max_lp': 2 0 20 0 25'924 0
'quick_restart': 0 27 306 0 13'574 0
'reduced_costs': 0 0 413 0 12'493 0
Lp pool Constraints Updates Simplif Merged Shortened Split Strenghtened Cuts/Call
'default_lp': 5'032 106 690 0 620 20 109 3'081/6'020
'max_lp': 4'066 267 1'535 0 1'292 108 24 1'820/3'528
'quick_restart': 4'898 151 1'980 0 1'824 36 84 2'947/5'472
'reduced_costs': 4'770 141 938 0 814 38 111 2'524/4'422
Lp Cut default_lp quick_restart reduced_costs max_lp
CG_FF: 25 26 20 6
CG_K: 14 6 13 5
CG_KL: - 1 1 -
CG_R: 32 37 24 23
CG_RB: 74 93 75 46
CG_RBP: 39 32 24 19
IB: 549 572 574 -
MIR_1_FF: 155 159 66 70
MIR_1_K: 51 48 13 3
MIR_1_KL: 21 25 7 1
MIR_1_R: 7 - 2 5
MIR_1_RB: 103 84 41 48
MIR_1_RBP: 73 82 23 7
MIR_1_RLT: - - 3 -
MIR_2_FF: 174 174 119 92
MIR_2_K: 61 64 13 7
MIR_2_KL: 21 21 6 3
MIR_2_R: 8 10 13 14
MIR_2_RB: 134 124 143 98
MIR_2_RBP: 86 88 31 22
MIR_3_FF: 120 97 134 109
MIR_3_K: 62 73 26 18
MIR_3_KL: 9 3 7 3
MIR_3_R: 5 8 12 18
MIR_3_RB: 106 82 144 140
MIR_3_RBP: 65 77 59 41
MIR_4_FF: 81 60 104 100
MIR_4_K: 54 51 22 42
MIR_4_KL: 7 3 5 3
MIR_4_R: 5 5 12 12
MIR_4_RB: 68 50 111 92
MIR_4_RBP: 73 49 17 55
MIR_5_FF: 54 50 59 49
MIR_5_K: 59 51 17 28
MIR_5_KL: 18 13 12 12
MIR_5_R: 2 6 6 12
MIR_5_RB: 27 35 58 57
MIR_5_RBP: 68 53 19 47
MIR_6_FF: 48 29 37 34
MIR_6_K: 50 44 14 45
MIR_6_KL: 22 21 21 22
MIR_6_R: 2 1 1 8
MIR_6_RB: 19 12 35 32
MIR_6_RBP: 54 43 24 67
ZERO_HALF_FF: 29 39 29 15
ZERO_HALF_K: 9 8 4 1
ZERO_HALF_KL: 1 3 - 2
ZERO_HALF_R: 249 281 276 243
ZERO_HALF_RB: 62 38 38 31
ZERO_HALF_RBP: 26 16 10 13
LNS stats Improv/Calls Closed Difficulty TimeLimit
'graph_arc_lns': 1/4 50% 5.54e-01 0.10
'graph_cst_lns': 0/5 60% 7.29e-01 0.10
'graph_dec_lns': 0/5 80% 8.73e-01 0.10
'graph_var_lns': 0/6 67% 7.92e-01 0.10
'rins/rens': 5/6 67% 8.12e-01 0.10
'rnd_cst_lns': 1/5 60% 7.48e-01 0.10
'rnd_var_lns': 0/7 71% 8.65e-01 0.10
LS stats Batches Restarts/Perturbs LinMoves GenMoves CompoundMoves Bactracks WeightUpdates ScoreComputed
'ls_restart_decay': 2 2 36'626 0 0 0 808 782'211
'ls_restart_decay_compound_perturb': 2 2 0 33'700 5'458 14'116 103 848'321
'ls_restart_decay_perturb': 1 1 18'453 0 0 0 413 382'808
Solutions (6) Num Rank
'complete_hint': 1 [1,1]
'graph_arc_lns': 2 [3,4]
'no_lp': 1 [2,2]
'rins_lp_lns': 1 [6,6]
'rnd_cst_lns': 1 [5,5]
Objective bounds Num
'am1_presolve': 1
'initial_domain': 1
'max_lp': 10
'quick_restart': 1
'reduced_costs': 1
Solution repositories Added Queried Synchro
'feasible solutions': 6 88 6
'fj solution hints': 0 0 0
'lp solutions': 5 7 5
'pump': 0 0
Improving bounds shared Num Sym
'default_lp': 6 0
'max_lp': 22 0
'quick_restart': 10 0
'reduced_costs': 2 0
Clauses shared Num
'core': 16
'reduced_costs': 1
[Scaling] scaled_objective_bound: 130588 corrected_bound: 130588 delta: -3.69953e-07
CpSolverResponse summary:
status: FEASIBLE
objective: 134786.7922581253
best_bound: 130587.9932321433
integers: 0
booleans: 0
conflicts: 0
branches: 0
propagations: 0
integer_propagations: 0
restarts: 0
lp_iterations: 0
walltime: 5.06474
usertime: 5.06474
deterministic_time: 9.67307
gap_integral: 80.9823
solution_fingerprint: 0x8de4169e43eb94c3
[18]:
wfn_irr.length()
[18]:
134807.7634895362
[19]:
wfn_irr.cost()
[19]:
247033944.13135293
[20]:
wfn_irr
[20]:
Layouts’ edge list¶
These lists of 3-tuples has all the edges and their cable type (as an index to the turbines_per_cable list), i.e. (coordinate_A, coordinate_B, cable_type).
Negative node indices represent substations, the node indices ranging from 0 to 73 represent the WT in the order they were given.
If the network has contours or detours, indices will go beyond the number of coordinates (WT, SS, borders) provided, and the mapping of these additional indices to indices to the provided coordinates is presented.
[21]:
wfn_reg.G.edges(data='cable')
[21]:
EdgeDataView([(0, 1, 0), (1, 4, 0), (4, 5, 1), (2, 3, 0), (3, 8, 0), (8, 14, 1), (5, 9, 1), (9, 15, 1), (6, 7, 0), (7, 12, 0), (12, 13, 1), (14, 22, 1), (15, 24, 2), (10, 11, 0), (11, 16, 0), (16, 17, 1), (13, 20, 1), (20, 21, 1), (22, 23, 1), (24, -1, 2), (17, 26, 1), (26, 25, 1), (18, 19, 0), (19, 28, 0), (28, 27, 1), (21, 32, 2), (32, -1, 2), (23, 33, 2), (33, -1, 2), (25, 34, 2), (34, -1, 2), (27, 36, 1), (36, 35, 1), (29, 38, 0), (29, 40, 0), (38, 37, 1), (30, 31, 0), (31, 44, 1), (31, 42, 0), (44, 45, 1), (44, 43, 0), (35, 46, 2), (46, -1, 2), (37, 48, 1), (48, 47, 1), (39, 50, 1), (39, 52, 1), (50, 49, 2), (41, 52, 1), (41, 54, 0), (45, -1, 2), (51, 62, 1), (51, 60, 1), (60, 59, 1), (53, 62, 0), (53, 64, 0), (61, 70, 0), (61, 69, 1), (69, 68, 1), (63, 70, 0), (54, 55, 0), (47, -1, 2), (49, -1, 2), (65, 66, 1), (65, 80, 1), (56, -1, 2), (56, 80, 1), (67, 68, 1), (67, 57, 2), (57, -1, 2), (59, 58, 2), (58, -1, 2), (66, 71, 0), (66, 73, 0), (71, 72, 0)])
Alternatively we can use get_network() method, to get the final cabling network as a structured array of edge data, and then extract desired edge data from it.
Regular turbine layout¶
[22]:
network_reg = wfn_reg.get_network()
print(network_reg.dtype.names)
('src', 'tgt', 'length', 'load', 'cable')
[23]:
network_cable_reg = np.column_stack((network_reg['src'], network_reg['tgt'], network_reg['cable']))
print(network_cable_reg)
[[ 0 1 0]
[ 1 4 0]
[ 4 5 1]
[ 2 3 0]
[ 3 8 0]
[ 8 14 1]
[ 5 9 1]
[ 9 15 1]
[ 6 7 0]
[ 7 12 0]
[12 13 1]
[14 22 1]
[15 24 2]
[10 11 0]
[11 16 0]
[16 17 1]
[13 20 1]
[20 21 1]
[22 23 1]
[24 -1 2]
[17 26 1]
[26 25 1]
[18 19 0]
[19 28 0]
[28 27 1]
[21 32 2]
[32 -1 2]
[23 33 2]
[33 -1 2]
[25 34 2]
[34 -1 2]
[27 36 1]
[36 35 1]
[29 38 0]
[40 29 0]
[38 37 1]
[30 31 0]
[31 44 1]
[42 31 0]
[44 45 1]
[43 44 0]
[35 46 2]
[46 -1 2]
[37 48 1]
[48 47 1]
[39 50 1]
[52 39 1]
[50 49 2]
[41 52 1]
[54 41 0]
[45 -1 2]
[62 51 1]
[51 60 1]
[60 59 1]
[53 62 0]
[64 53 0]
[70 61 0]
[61 69 1]
[69 68 1]
[63 70 0]
[55 54 0]
[47 -1 2]
[49 -1 2]
[66 65 1]
[65 80 1]
[56 -1 2]
[80 56 1]
[68 67 1]
[67 57 2]
[57 -1 2]
[59 58 2]
[58 -1 2]
[71 66 0]
[73 66 0]
[72 71 0]]
Irregular turbine layout¶
[24]:
network_irr = wfn_irr.get_network()
network_cable_irr = np.column_stack((network_irr['src'], network_irr['tgt'], network_irr['cable']))
print(network_cable_irr)
[[ 0 50 0]
[50 46 0]
[ 1 34 0]
[34 20 0]
[ 2 8 1]
[ 7 2 1]
[ 8 42 1]
[ 3 12 1]
[15 3 1]
[12 45 1]
[ 4 20 0]
[20 37 1]
[ 9 5 0]
[ 5 32 1]
[32 14 1]
[ 6 35 0]
[35 36 0]
[42 25 2]
[10 24 0]
[24 17 0]
[11 18 0]
[18 59 0]
[45 33 2]
[13 26 0]
[26 31 0]
[14 68 1]
[68 73 2]
[16 29 1]
[17 16 1]
[29 53 1]
[59 60 2]
[52 59 1]
[37 51 1]
[44 22 1]
[22 67 1]
[67 70 2]
[23 43 0]
[43 7 0]
[31 56 1]
[27 52 0]
[38 27 0]
[53 28 2]
[30 54 1]
[56 30 1]
[54 49 2]
[36 62 1]
[62 69 1]
[51 41 2]
[40 55 1]
[57 40 0]
[55 -1 1]
[47 65 0]
[65 58 1]
[48 65 0]
[58 61 1]
[61 64 1]
[60 -1 2]
[64 71 2]
[69 63 1]
[71 81 2]
[70 -1 2]
[73 80 2]
[21 15 0]
[19 9 0]
[66 21 0]
[46 44 1]
[25 -1 2]
[28 -1 2]
[33 -1 2]
[63 39 2]
[39 -1 2]
[72 57 0]
[41 -1 2]
[49 -1 2]
[80 -1 2]
[81 -1 2]]
Mapping of contour/detour¶
Mapping of contour/detour node to the index of its VertexC coordinate :
[25]:
wfn_reg.map_detour_vertex()
[25]:
{80: 76}
[26]:
wfn_irr.map_detour_vertex()
[26]:
{80: 28, 81: 76}