Search found 21 matches

by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: defining a subset in GAMS
Replies: 2
Views: 2226

Re: defining a subset in GAMS

Thanks a lot for your help.
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: defining a subset in GAMS
Replies: 2
Views: 2226

defining a subset in GAMS

Dear all, I want to determine a subset based on the indices of elements. for example, I have a set i /0,4,3,1,5,2,6/ and the order of elements in this set is important to me. I want to define a subset that contains the third element of i to the sixth element. In more details, I want the subset to be...
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: index of elements in an unordered subset
Replies: 2
Views: 2364

Re: index of elements in an unordered subset

Thanks a lot for your help.
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: index of elements in an unordered subset
Replies: 2
Views: 2364

index of elements in an unordered subset

Dear all, I want to determine the index of elements in an unordered subset in GAMS and I need some help. for example, I have a set i /1*6/ and I get subset(i) from MATLAB software based on an algorithm that I designed for my problem. a subset(i) contains some elements of i that are sorted in a speci...
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 4673

Re: defining a parameter in GAMS

thanks a lot. sorry, I think subV_T(j) Which I have used is misleading. It refers to a subset on j. we can drop this. consider the following example: let c is: 1 0 1 1 0 1 1 1 subV_T(j) contains j=1 and j=2. I want to check c(i,j) for all i and j that belongs to subV_T(j) and if I find that c(i,j) i...
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 4673

Re: defining a parameter in GAMS

thanks a lot. I have another problem related to this topic: by the following statement c_afterProcess(i,j) will ba change, c_afterProcess(i, j) $(c(i, j)$subV_T(j) eq 1) = no; but I want to put c_afterProcess(i, j) for all i if c(i, j)$subV(j) eq 1. more precisely I want to change the value of all t...
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 4673

Re: defining a parameter in GAMS

thanks a lot for your help. but I want an output such as the following example: for example for customer 1 we have d(1,1)=1, d(1,2)=0, d(1,3)=1 so C(1) would be {1,3}. because in my constraints I want to have sum p(j)>=1 for each customer i; in which p is a binary variable and the summation is on al...
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 4673

Re: defining a parameter in GAMS

thanks for your reply. I will provide more clear information in the following: let i is the set of customers and j is the set of some locations. I define parameter d(i,j) as a binary parameter which is 1 if the distance from the customer i to location j is less than a predefined parameter R, otherwi...
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 4673

defining a parameter in GAMS

Dear all,
how can I define the following parameter in GAMS?

C(i) is the set of j that d(i,j)=1

I have defined parameter d but I do not know how can I define C(i) in GAMS?

I appreciate it if someone can help me.
Thanks and regards,
Bahar
by Bahar_Mdi
3 years ago
Forum: Syntax
Topic: union of subsets
Replies: 1
Views: 1856

union of subsets

Dear all, how do I union some subsets in my model? consider the following sets and subsets: SETS i/0*7/ subV_T(i) /1*3/ subV_DE(i) /4/ subV_DO(i) /5/ I want to define a new subset which is the union of subV_T and subV_DO. How can I do this? I do it the same as what is expressed for the union of sets...