Answers to: GAMS, subcripts (sets) are not independedhttp://www.or-exchange.com/questions/9627/gams-subcripts-sets-are-not-independed<p>Hi, </p>
<p>I am trying to model a jobshop scheduling probleman indexed equation which runs over set i /1*4/.
there are three kinds of jobs, named A, B and C, and four machines, called m1,m2, m3, m4, m5;
the processing recipe for A is: m1-->m2--->m3-->m4,
the processing recipe for B is: m1-->m2--->m4,
the processing recipe for A is: m1-->m3-->m4,
there are KA jobs of type A, KB jobs of type B, and KC jobs of type C.
Then, the end time of each job on each machine is equal to the end time of the job on the previous machine plus its the processing time, that is</p>
<pre><code>E(i, m)=E(i,m-1)+P(i,m) // E(i,m) is the end time of job i on machine m, and m-1
//represent the machine on which job i is processed just before
//machine m, P(i,m) is the processing time of job i on machine m
</code></pre>
<p>How can I formulate this equation in GAMS? Do i have to define a set and an equation for each job like the following example ?</p>
<p>for example, if i have five jobs,</p>
<pre><code>Sets
jobs /job1*job5/ //job1 and job2 are of type A, job3 is of type B,
//job4 and job5 are of type C
Sets
machines /m1*m4/ /* all available machines */
Sets
recipejob1 /Set.machines/
recipejob2 /Set.machines/
recipejob3 /m1, m2, m4/
recipejob4 /m1, m3, m4/
recipejob5 /m1, m3, m4/;
Parameters
p(jobs, machines) "the processing time of each job on each machine";
Variables
E(jobs, machines) "the end time of each job on each machine";
equations tempt("job1", recipejob1);
temp("job1", recipejob1)..
E("job1", recipejob1+1) =E= E("job1", recipejob1) + P("job1", recipejob1);
temp("job2", recipejob2)..
E("job2", recipejob2+1) =E= E("job2", recipejob2) + P("job2", recipejob2);
... ....
... ....//define a equation for each job
</code></pre>
<p>I think there maybe more concise and effective method, Do you have any idea about this problem?</p>
<p>Thank you in advance </p>enMon, 01 Jun 2020 08:59:57 -0000