For the sake of readability, I have created a small piece of code in which the notation is similar to your report.
Code: Select all
Do(
Var([valUniform], vbValue, Uniform(0, 1)),
Var([valP1], vbValue, 0.3),
Var([valP2], vbValue, 1 - valP1),
Var([valN1], vbValue, Content(In(1,c))),
Var([valN2], vbValue, Content(In(2,c))),
Var([valAverageN1], vbValue, AvgContent(In(1,c))),
Var([valAverageN2], vbValue, AvgContent(In(2,c))),
OpenIC(
If(
valUniform < (valN1 * valP1) / (valN1 * valP1 + valN2 * valP2),
1,
2
),
c
)
)
Note that the values of valN1 and valN2 are now defined by the current content of the queues connected to input channel 1 and 2 respectively. I have also added the variables valAverageN1 and valAverageN2, which are defined by the average content of the queue connected to input channels 1 and 2 respectively. You can change the formula by replacing valN1 by valAverageN1 and valN2 by valAverageN2 in case you want to use average content instead of current content.
Hope this works out for you!
Kind regards,
Marvin