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!
How can I make this set?
How can I make this set?
- Attachments
-
- data.xlsx
- (73.63 KiB) Downloaded 365 times
Re: How can I make this set?
Here is the code:
-Michael
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);