Problem with transfering a constraint into GAMS language

Dear all,
I have a problem with tranfering a constraint of my optimization problem into GAMS language. It is part of a kind of a Job-Shop Scheduling Problem. Maybe you can help me?

I want to manipulate the index t of the paramter e(ijt) and subtract (ts(ij)+1) from t. ts(ij) and x(ijkt) are variables, e_strich is a parameter.



In GAMS this looks like this, but it seems as if it doesn’t work like this. Any ideas?



E_Mittel(t) =e= sum( (i,j,k) , e(i,j,t-ts(i,j)+1 )* x(i,j,k,t) ) - e_strich;



Second problem with this constraint is, that e(i,j,t-ts(ij)+1)*x(i,j,k,t) should be only summed up if the value of t is between the variables ts(ij) [t_start] and te(ij) [t_end].



In GAMS it looks like this, but GAMS doesn’t like variables in the -operator. Again: Any ideas? \ \ \ E_Mittel(t) =e= sum( (i,j,k) , (e(i,j,t-ts(i,j)+1 )* x(i,j,k,t)(ord(t)>=ts(i,j) and ord(t)<=te(i,j) ) ) - e_strich;



So I would like to know whether there is a simple solution for my problems or wheter I have to change my contraint completely.



Many thanks in advance and kind regards

Christian


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/DVkCZwNxwcAJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Christian

It looks like you don’t want to sum over the whole 3-dimensional space of I,j,k.

What I often do is define a parameter over i,j and k that is 1 if one should use this combination of I,j,k in the summation and otherwise zero.
This makes it easier to check, which elements will be used or not.

Say, in a 2-dimensional setting, you want to sum over the combinations that look like this
ixj matrix
1 2
1 1 0
2 1 1
3 1 1
4 0 1


The code would like this
set i /14/,
j /1
3/;
parameter summittel(i,j);

  • I first initialize all elements to 1
    Summittel(i,j) = 1;
  • Then I change all the values in the rows that should be zero
    Summittel(i,j)$(ord(i) lt ord(j)) = 0;
  • The same for the columns
    Summittel(i,j)$(ord(i) gt ord(j) +2) = 0;

display summittel

For your problem the $-statements would look a little bit nastier, but this should finally work and lets you check easily, if you are summing over the right elements.

Good luck!

Renger

\


Modelworks
Gewerbestrasse 15
3600 Thun - Switzerland
+41 79 818 53 73
Info@modelworks.ch
blog.modelworks.ch




From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of scboening@gmail.com
Sent: Mittwoch, 23. Januar 2013 11:21
To: gamsworld@googlegroups.com
Subject: Problem with transfering a constraint into GAMS language

Dear all,
I have a problem with tranfering a constraint of my optimization problem into GAMS language. It is part of a kind of a Job-Shop Scheduling Problem. Maybe you can help me?


I want to manipulate the index t of the paramter e(ijt) and subtract (ts(ij)+1) from t. ts(ij) and x(ijkt) are variables, e_strich is a parameter.

In GAMS this looks like this, but it seems as if it doesn’t work like this. Any ideas?

E_Mittel(t) =e= sum( (i,j,k) , e(i,j,t-ts(i,j)+1 )* x(i,j,k,t) ) - e_strich;

Second problem with this constraint is, that e(i,j,t-ts(ij)+1)*x(i,j,k,t) should be only summed up if the value of t is between the variables ts(ij) [t_start] and te(ij) [t_end].

In GAMS it looks like this, but GAMS doesn’t like variables in the $-operator. Again: Any ideas?

E_Mittel(t) =e= sum( (i,j,k) , (e(i,j,t-ts(i,j)+1 )* x(i,j,k,t)$(ord(t)>=ts(i,j) and ord(t)<=te(i,j) ) ) - e_strich;

So I would like to know whether there is a simple solution for my problems or wheter I have to change my contraint completely.

Many thanks in advance and kind regards
Christian

Hi Renger,
many thanks for your quick response.


I’m not quite sure whether this could help me.
Perhaps I haven’t described my problem very well.


I noticed you are sitting in Switzerland.
Is it possible to continue our conversation in german?

Greetings
Christian (From Germany :slight_smile:)



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/KbJlKocQ0UgJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Selbstverständlich, Holländisch ware auch ok J. Du kannst mich auch direkt anmailen.

Renger



Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von scboening@gmail.com
Gesendet: Donnerstag, 24. Januar 2013 10:51
An: gamsworld@googlegroups.com
Betreff: Re: Problem with transfering a constraint into GAMS language



Hi Renger,

many thanks for your quick response.



I’m not quite sure whether this could help me.

Perhaps I haven’t described my problem very well.



I noticed you are sitting in Switzerland.

Is it possible to continue our conversation in german?



Greetings

Christian (From Germany :slight_smile:)




\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/KbJlKocQ0UgJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.