question

Mohamed Slama avatar image
1 Like"
Mohamed Slama asked Matthew Gillespie commented

how to get the output variable of a queue ?

In my model I need the value of the output of the queue during my simulation.

Can someone helps me to get this value with a code ? Something like 'getvarnum'...

Thank you

queueoutputstats
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Matthew Gillespie commented

int output = getoutput(node Queue); // node Queue is the reference to your queue-object

int output = getoutput(model().find("Queue100")); // if you use the find method.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

It is even simplier, if you use the sampler tool (Icon of an eye dropper). Then you move this tool over the Queue and click the left mouse button. You choose from the opening window the entry "Getters..." and then the appropriate line of code.

@Mohamed Slama

1 Like 1 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

As @Jörg Vogel shows in his comment, the Object class has a stats property that lets you access a bunch of statistical values that the object keeps track of. To get the output it looks like this:

Object obj = model().find("Queue1");
int output = obj.stats.output.value;
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.