It took me many days to develop the remaining part of my code, the remainig two decision variable:
(1) beam_reuse[beams]
(2) beam_pol[beams]
I want to write these constrains:
(1) for beam_reuse:
i have 2 reuses so will distribute the beams in the 4 rows on these two reuses the beams in the first two rows (first 12 beams) will take reuse[1] =1, and the beams in the last two rows ( last 9 beams) will take reuse[2]=2.
why 2? because we have two polarization in each reuse, for example if we have 3 polarization then the beams in the first three rows will take reuse[1], and the beams in the other 3 rows will take reuse[2].
(2) beam_pol:
i have two polarization for each reuse, so the beams in the first row ( first 6 beams) will take pol[0]=0 and the beams in the second row (second 6 beams) will take pol[1]=1, and the beams in the third next [6 beams] will again take pol[0]=1 but here we have changed the reuse in the above to be 2 not 1 and the beams in the last row (last 3 beams) will take pol[1]=1 again.
int Nchannels=16;
range channels=1.. Nchannels;
int Npol=2; // may be 3 or 4 or .....
range pol= 0..Npol-1;
int polarization [i in pol]=i;
int Nreuse=2; // may be 1 or 3 or 4 or .....
range reusee= 1..Nreuse;
int reuse [i in reusee]=i;
int Nrows= Npol*Nreuse;
range rows=1..Nrows;
int TotChannels = Nchannels *Npol*Nreuse;
dvar int first_beam_in_each_row[rows] in (1..Nbeams);
dvar int No_beams_in_each_row[rows] in (0..Nbeams);
dvar int beam_firstchannel[beams] in (channels);
dvar int beam_nomusedchannel[beams] in (channels);
dvar int beam_reuse[beams] in (reuse);
dvar int beam_pol[beams] in (pol);
//and my code has the following output:
//Nrows=4;
//Nbeams=21;
//first_beam_in_each_row=[1,7,13,19];
//No_beams_in_each_row=[6,6,6,3];
//beam_firstchannel=[1,3,5,7,9,11,1,3,5,7,9,11,1,3,5,7,9,11,1,6,11];
//beam_nomusedchannel=[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,5,5,5];
------------------------------
Mohamed Mandour
------------------------------
#DecisionOptimization