How to write the following constrains in cplex (the part in subject to) assuming that i have the results of the first two decision variables as shown below
int Nbeams=8;
int Nchannels=16;
int Nrows=2; // I have my code to make each
range beams=1..Nbeams;
range channels=1.. Nchannels;
range rows=1..Nrows;
dvar int first_beam_in_each_row [rows] in (1..Nbeams);
dvar int beam_nomchannel[beams] in (channels);
dvar int beam_firstchannel[beams] in (channels);
/*
assume we have the output of:
dvar int first_beam_in_each_row [rows]=[1,5]
dvar int beam_nomchannel[beams]=[2,2,2,2,2,2,2,2];
How to write the next part????
*/
Subject to
{
forall (i in beams)
while or if
i= value of first_beam_in_each_row [rows] // while i = 1 , 5
then
value of beam_firstchannel[beams]=1;
else //while i = 2,3,4,6,7,8
value of beam_firstchannel[beams]=value of previous beam_firstchannel[beams]+ value of previos beam_nomchannel[beams]; // beam_firstchannel[3]=beam_firstchannel[2]+beam_nomchannel[2]
}