How can I calculate the total number of entities in queueing network in simulink?

1 次查看(过去 30 天)
Hi, I have a model that include 2 sets of queue+server, total 4 blocks. I want to limit the number of entities in ALL the system meaning in all the queues and servers. I have tried to use an adder to sum the #n ports from the 4 blocks but it doesn't work because only one of the adder ports is active each time.
It's a very simple requirment but i can't get it done. Thanks, Moti
  4 个评论
mo
mo 2012-9-17
Rick, I'm using R2010a.
Ryan, All the 4 #n ports are connected to the adder, but if there is signal in one of the ports, the other 3 ports are 'zero' in the sum, meaning it is like electric circuit where the signals are not always there. That is why i tried to connect a data latch but it did not work.
Thanks.

请先登录,再进行评论。

回答(1 个)

Ryan G
Ryan G 2012-9-17
I put something together that may emulate your situation. It sounds like you have entities incoming that you cannot stop to the system but want to reject them if the TOTAL system is full.
On the entity path you want to control put output switch and select 'from signal port p. Compare the output of the sum to whatever the system limit is and connect that to port p. Note that the indexing here is 1-based. On on port youll connect as you already have letting entities enter, on the other you'll put a sink and 'toss' the entities (you can keep track of what you toss in the sink block)
Based on your description this sounds like it may work. However, there seems to be some confusion somewhere else as well. When you say adder, you mean the sum block correct? At every time step what you see in the scope would be accurate for that step, there should not be different blocks triggering at different steps unless you set it up that way.
One thing if this still is giving you trouble is you can upload a pic of a simple model that shows this to a site like imgur and post it here.
  8 个评论
Ryan G
Ryan G 2012-9-19
Half of the signals were just 0's and 1's (I forget which you can see that in this link from earlier)
The other signals worked for me in my setup, simply replacing Data in my script with signals.values showed correct results. Unfortunately I cannot upload the model.
mo
mo 2012-9-19
Yes, because i defined only one server. But the other 2 signals also give me 0's and 1's. Can you send it to my mail? moti_ne@yahoo.com I will appreciate it very much.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Discrete-Event Simulation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by