Jump to content
vavei5

Server wait to process

Recommended Posts

Hello,


Can someone explain me how to create a model where the server waits to have 7 entities to process all of them at the same time.


I am working on a project where I need to receive 7 entities to make a batch and then process this batch.


Also, I need to know how can I stop the source when the server is processing the batch and when there is 3 entities who are waiting in front of the server.



Source ----------Server (need 7 to make a batch) --------Sink


Source --------- (no more than 3 entities waiting) Server(Processing)-------- Sink


Thank you

Share this post


Link to post
Share on other sites

Hello vavei5,


When you say you want your source to stop, do you mean permanently or temporarily? You can do either.


Judy

Share this post


Link to post
Share on other sites

Set arrival mode of source on event then define your events to be either server is processing or there are three entities waiting in input buffer of the server. You should define a triggering event which is triggered by two seperate monitors each monitors the conditions you mentioned.

Share this post


Link to post
Share on other sites

OK I resolve half of my problem.


I decide to put a combiner where 1 parent wait to have 6 membre to batch and process.


Now, I have some problems when I want to stop temporary my source.


I tried to create a process at Source_CreatingEntities , but I think I don't write well my conditions for the decide steps.


The Process goes like this


Begins------Decide---(true)------Decide--(true)----Wait-----End

| |

| (false) | (false)

---- ------


The first Decide, I want to be true when there is 3 entities waiting at the member input link : MemberInput@Combiner1.NumberTravelers>=3


The second Decide, I want to be true when my combiner is processing : Combiner1.Capacity.Allocated>=1


The wait step is a event that is fire when the combiner finish processing the batch


Can you tell me how to write well the condition for the decide steps ?


Thanks

Share this post


Link to post
Share on other sites

How about using a state variable to count the amount of entities that have come out of your source and use another state variable in the source's Entities Per Arrival property? You can fire an event when the "count" state variable has reached a certain number that will assign the variable that you used for the Entities Per Arrival in an associated process to that same fired event. And when a new parent exits from the node of it's source you can check to see if the variable is set to 0. If it is, then assign it to 1 again.


Judy

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×