Hello,
Please I need support to develop a parameter of 3 sets P(t,c,b).
Set
t /t1 t5/
c /c1 c10/
b / set with dynamic size, it depends on a randomly generated parameter e.g. H(t,c)=uniform(100,200) /
Parameter H(t,c)
Parameter P(t,c,b)
P(t,c,b)= round(uniform(0,1));
Thanks a lot for your support.
Set with dynamic size
Re: Set with dynamic size
Hi
If I understand you correctly, the size can have any number of elements between 100 and 200, e.g. /1*167/.
If that is what you mean, you could do this as follows:
You can "empty" the set by writing b(n) = NO;
Hope this helps.
Cheers
Renger
If I understand you correctly, the size can have any number of elements between 100 and 200, e.g. /1*167/.
If that is what you mean, you could do this as follows:
Code: Select all
* Define a maximum set
set n /1*200/;
parameter sizeb Size of dynamic set;
sizeb = uniformInt(100,200)
set b(n) Dynamic set;
b(n)$(n.val < sizeb+1) = yes;
display b;
You can "empty" the set by writing b(n) = NO;
Hope this helps.
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist