How can I make this set?

Archive of Gamsworld Google Group
Post Reply
User avatar
linkho
User
User
Posts: 15
Joined: 2 years ago

How can I make this set?

Post by linkho » 2 years ago

Hi,
let s be a index of scenario and j index of Network Nodes.(s={1*200} , j={1*100})
d(s,j)= total impacts of contamination scenario s, if the contaminant is first detected by scenario at j.
W(s)=the subset of Network Nodes which d(s,j)<>0.
W'(s)= the subset of W(s) such that d(s,j)<>d(s,j') , for all j,j' belong to W'(s).

How can I make the subset W'(s)?
I attached data related to parameter d(s,j) too.

Thanks in advance!
Attachments
data.xlsx
(73.63 KiB) Downloaded 146 times

User avatar
bussieck
Moderator
Moderator
Posts: 615
Joined: 4 years ago

Re: How can I make this set?

Post by bussieck » 2 years ago

Here is the code:

Code: Select all

set s /1*200/, j /1*100/;
parameter d(s,j);
d(s,j)$(uniform(0,1)<0.05) = uniformInt(1,10);
*W(s)=the subset of Network Nodes which d(s,j)<>0.
*W'(s)= the subset of W(s) such that d(s,j)<>d(s,j') , for all j,j' belong to W'(s).
set W(s,j), Wuniq(s,j);

W(s,j) = d(s,j);
Wuniq(s,j) = W(s,j);
* Knock out the duplicate ones
alias (j,jj);
loop((s,j,jj)$(W(s,j) and W(s,jj) and ord(jj)>ord(j) and d(s,j)=d(s,jj)), Wuniq(s,jj) = no);
-Michael

User avatar
linkho
User
User
Posts: 15
Joined: 2 years ago

Re: How can I make this set?

Post by linkho » 2 years ago

Thanks so much !

Post Reply