Jump to content

COUNT ENTITY TYPES WAIITNG IN SERVER QUEUE


rv547496
 Share

Recommended Posts

Hi,

I like to count total number of entities types waiting in front of the servers.Say for example, i am having entity1,entity2,entity3.Each entity is produced from separate sources(source1,source2,source3 respectively) .I got 5 servers(S1,S2,S3,S4,S5).


Entity 1 processed in S1-S3-S5

Entity 2 processed in S1-S2-S4

Entity 3 processed in S3-S4-S5

Each entity has different arrival rate. i like to create a expression to sum the total number of entity type 1 waiting in queue infront of the servers S1-S3-S5.if total number of entity type 1 waiting is greater than 100 numbers,the next coming entity type 1 from the source1 should leave the whole system( i mean sink without processing)similarly i like to count for entity2,entity3.


Can anyone help me out?


Thanks,

R

Link to comment
Share on other sites

I'm not sure if I understand exactly what you want to do, but generically it sounds like you just want to have more insight into system status.


The simplest thing that might work IF you described the entire system is to look at Entity1.Population.NumberInSystem for each entity type and make decisions on when to send new entities directly to the sink or elsewhere.

You could even put an expression like Entity1.Population.NumberInSystem<100 into the EntitiesPerArrival field to simply not create entities when the system is too backed up.


Another choice for more control is to add states to the model for each thing you want to track and then make decisions based on that state. For example you might create an integer state named Type1NumberWaiting and increment/decrement that state with an Assign each time it starts/stops waiting. Then when you create new entities you could evaluate Type1NumberWaiting to determine what action you should take.

Link to comment
Share on other sites

Hi dave,

Thanks for your reply.You suggest me two ways to do that. Entity1.Population.Number In System.i dont want to do for the whole system.


For your better understanding i can make my question simple.


Different entity(entity1,entity2...etc) waiting in server1.inputbuffer (in queue) to get service in server1. I like to count or (see),how many entity1 and enity2 are waiting in server1.inputbuffer to get service in server1,while the simulation is running.Here my inputbuffer capacity is infinite.


could you help me out?


Thanks,

R

Link to comment
Share on other sites

You are probably already aware that Server1.InputBuffer.Contents.NumberWaiting gives you the number of all entities waiting.


If that is not what you want, then you will probably need to take the state approach described above.


Two other ways would be to periodically search the queue (slow if done frequently) or to use Storages (somewhat obscure).

Link to comment
Share on other sites

×
×
  • Create New...