Dynamic set problem

Questions on using the GAMS APIs (Python, .NET, etc.)
Post Reply
busrabytr
User
User
Posts: 1
Joined: 3 months ago

Dynamic set problem

Post by busrabytr » 3 months ago

Hi all,

I am working on a heterogeneous fleet routing problem. I have a decision variable with 4 indices: Xijtv. İt is a binary variable.

If type of t gets vehicle of v and it goes from i customer to j customer the value is 1.

There are 3 different types of vehicle and I express it with the A (t) parameter. Ex: There are 7 vehicles of the 3rd type.

A(t)
1 1
2 1
3 7

What I want to do here is that, when A (t) takes the value of 1, v is the set / 1 * 1 / or when A (t) takes the value of 3, v is the set of the set / 1 * 7 /.
Can you help me?

Fred
Posts: 257
Joined: 4 years ago

Re: Dynamic set problem

Post by Fred » 3 months ago

Hi,

sounds as if you need a two dimensional set that maps vehicles v to types t based on parameter A(t). Maybe the following example is helpful.

Code: Select all

set i customer / i1*i10 /
    t type     / t1*t3  /
    v vehicle  / v1*v10 /
;
alias(i,j);
parameter
    A(t) / t1 1, t2 1, t3 7 /
;

set map(t,v) map vehicles to types;
map(t,v) = ord(v)<=A(t);
display map;
Best,
Fred

Post Reply