Sorry for asking so many questions but I really need help. I tried to use iteratively updated parameters to do my algorithm, named Column and Constraint Generation, which has been enlightened by the Benders Decomposition. Then I am a little bit confused about how I can update my parameters from the previous one with some conditions. These parameters are all Binary. Here shows how I define the iteration set:

Code: Select all

```
Set itera /itera1*itera50/;
Set columnset(itera) dynamic set;
columnset(itera) = no;
Parameter L_avail; * this is my planned updating parameter
Loop(itera, * Here is how I insert the 1st iteration result, "L_avail0(l)" is a fixed parameter.
if(ord(itera) ge 2,
break;);
L_avail(l, itera) = L_avail0(l);
);
```

Code: Select all

```
... ...
Llim10(l, columnset).. f(l) =g= - L_avail(l, columnset) * LDATA(l, 'FLmax');
Llim20(l, columnset).. f(l) =l= L_avail(l, columnset) * LDATA(l, 'FLmax');
... ...
```

Then I tried to use the following codes to update my parameters.

Code: Select all

```
Loop(itera,
if(ord(itera) ge 2, * bc the 1st results have been stored and fixed.
Solve ... ...
Loop(l,
if(xl.l(l) = 1, * xl.l are solutions.
L_avail(l, itera) = 1); * update
);
);
```

Code: Select all

```
---- 445 PARAMETER L_avail
itera1
l1 1.000
l2 1.000
l4 1.000
l5 1.000
```

Code: Select all

```
---- 420 PARAMETER L_avail
itera1 itera2
l1 1.000
l2 1.000
l3 1.000
l4 1.000
l5 1.000
```

Code: Select all

```
---- 420 PARAMETER L_avail
itera1 itera2
l1 1.000 1.000
l2 1.000 1.000
l3 1.000
l4 1.000 1.000
l5 1.000 1.000
```

Code: Select all

```
L_avail(l, itera) = L_avail(l, itera-1)
Loop(l,
if(xl.l(l) = 1,
L_avail(l, itera) = 1);
);
```