基于遗传算法的机组组合问题的建模与求解 第7页
int bei = 0;
int k = 0;
for ( k = 0; k < 2; k++)
{
bei += state[k][i] * (pmax[k] - power[k][i]);
}
if (bei < b_power[i])
{
continue;
}
if (i == hour - 1)
{
// cout << get_total_price() << " ";
// for (k = 0; k < hour; k++)
// {
// cout << power[0][k] << "-" << power[1][k] << " ";
// }
// cout << endl;
fout << get_total_price() << " ";
for (k = 0; k < hour; k++)
{
fout << power[0][k] << "-" << power[1][k] << " ";
}
fout << endl;
}
else
{
// 继续递归求解
fun(i + 1);
}
}
}
附录2
2.1 初始化个参数
% IEEE118BusData 遗传算法计算
%分段增量总发电量 54*5
rp = [10 15 20 25 30
10 15 20 25 30
10 15 20 25 30
180 210 240 270 300
140 180 220 260 300
14 18 22 26 30
40 55 70 85 100
10 15 20 25 30
10 15 20 25 30
140 180 220 260 300
150 200 250 300 350
12.4 16.8 21.2 25.6 30
12.4 16.8 21.2 25.6 30
40 55 70 85 100
12.4 16.8 21.2 25.6 30
40 55 70 85 100
12.4 16.8 21.2 25.6 30
12.4 16.8 21.2 25.6 30
40 55 70 85 100
90 130 170 210 250
90 130 170 210 250
40 55 70 85 100
40 55 70 85 100
80 110 140 170 200
80 110 140 170 200
40 55 70 85 100
164 228 292 356 420
164 228 292 356 420
124 168 212 256 300
40 50 60 70 80
14 18 22 26 30
10 15 20 25 30
8 11 14 17 20
40 55 70 85 100
40 55 70 85 100
180 210 240 270 300
40 55 70 85 100
14 18 22 26 30
140 180 220 260 300
80 110 140 170 200
10.4 12.8 15.2 17.6 20
26 32 38 44 50
140 180 220 260 300
140 180 220 260 300
140 180 220 260 300
10.4 12.8 15.2 17.6 20
40 55 70 85 100
40 55 70 85 100
10.4 12.8 15.2 17.6 20
30 35 40 45 50
40 55 70 85 100
40 55 70 85 100
40 55 70 85 100
30 35 40 45 50];
% 分段增量总成本 54*5
cp = [26.94 27.985 28.682 29.379 30.075
26.94 27.985 28.682 29.379 30.075
26.94 27.985 28.682 29.379 30.075
14.845 17.129 17.781 18.434 19.086
14.41 16.368 17.238 18.108 18.978
27.219 28.473 29.03 29.588 30.145
18.332 19.036 19.42 19.804 20.188
26.94 27.985 28.682 29.379 30.075
26.94 27.985 28.682 29.379 30.075
14.41 16.368 17.238 18.108 18.978
11.21 11.81 12.11 12.41 12.71
27.108 28.278 28.891 29.504 30.117
27.108 28.278 28.891 29.504 30.117
18.332 19.036 19.42 19.804 20.188
27.108 28.278 28.891 29.504 30.117
18.332 19.036 19.42 19.804 20.188
27.108 28.278 28.891 29.504 30.117
27.108 28.278 28.891 29.504 30.117
18.332 19.036 19.42 19.804 20.188
12.546 12.858 13.05 13.242 13.435
12.546 12.858 13.05 13.242 13.435
18.332 19.036 19.42 19.804 20.188
18.332 19.036 19.42 19.804 20.188
13.642 14.126 14.39 14.654 14.918
13.642 14.126 14.39 14.654 14.918
18.332 19.036 19.42 19.804 20.188
10.076 12.491 13.846 15.202 16.557
10.076 12.491 13.846 15.202 16.557
14.236 16.063 17.02 17.977 18.934
17.308 19.604 20.522 21.441 22.359
27.219 28.473 29.03 29.588 30.145
26.94 27.985 28.682 29.379 30.075
37.923 38.235 38.404 38.574 38.744
18.332 19.036 19.42 19.804 20.188
18.332 19.036 19.42 19.804 20.188
14.845 17.129 17.781 18.434 19.086
18.332 19.036 19.42 19.804 20.188
27.219 28.473 29.03 29.588 30.145
11.18 11.72 11.96 12.2 12.44
13.758 14.954 15.606 16.259 16.911
37.991 38.353 38.489 38.625 38.761
23.196 23.509 23.626 23.744 23.861
14.41 16.368 17.238 18.108 18.978
14.41 16.368 17.238 18.108 18.978
14.41 16.368 17.238 18.108 18.978
37.991 38.353 38.489 38.625 38.761
18.332 19.036 19.42 19.804 20.188
18.332 19.036 19.42 19.804 20.188
37.991 38.353 38.489 38.625 38.761
23.235 23.578 23.675 23.773 23.871
18.332 19.036 19.42 19.804 20.188
18.332 19.036 19.42 19.804 20.188
18.332 19.036 19.42 19.804 20.188
23.235 23.578 23.675 23.773 23.871];
% 发电机组的空载成本 54*1
load0 = [31.67
31.67
31.67
6.78
6.78
31.67
10.15
31.67
31.67
6.78
32.96
31.67
31.67
10.15
31.67
10.15
31.67
31.67
10.15
28
28
10.15
10.15
上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页