creating set with alias

Problems with modeling
Post Reply
pseudocleft
User
User
Posts: 4
Joined: 1 year ago

creating set with alias

Post by pseudocleft »

image.png
image.png (8.97 KiB) Viewed 5816 times
how can i create this set. second j is alias of first j. Also, If i create a multidimensional set for main indices , do i have to create one more set for alias of main indices.
.
Fred
Posts: 372
Joined: 7 years ago

Re: creating set with alias

Post by Fred »

Hi,

Maybe the following example is helpful.

Code: Select all

set m machines / m1*m5 /
    j jobs     / j1*j10 /
    mj(m,j)    mapping of jobs to machines
    mjj(m,j,j) mapping of intersection of two jobs to machine
;
*create alias for jobs
alias (j,j1,j2);
*craete dummy data for job-machine-mapping
mj(m,j) = uniform(0,1) < 0.3;
*display mj in list format
option mj:0:0:1; display mj;

*compute mjj map (exclude j1=j2).
mjj(m,j1,j2)$(not sameas(j1,j2)) = mj(m,j1) and  mj(m,j2);
*display mjj in list format
option mjj:0:0:1; display mjj;   
Best,
Fred
Post Reply