Nasr Cheaib
Nasr Cheaib

Reputation: 83

Selecting first available service block

I have a selectoutputIn block and multiple selectOutputOut blocks that are connected to service blocks. The selectoutputIn block uses a function to determine which output for the agent. Is there an easy way to insert a list and determine the first available service block is to be selected. If I were to add more service blocks, how can I make it easy to do so?

enter image description here

Upvotes: 0

Views: 91

Answers (1)

Felipe
Felipe

Reputation: 9421

If you have 1000 of these services, it's better to create 1000 agents that will have the following structure inside:

structure

You need an exit block when you have a population to get back to main, the selectOuputIn won't work.

To select an available service block you can then do this in your selectOutputIn explicit choice (using agents)

findFirst(myAgents, a->a.service.delaySize()==0).selectOutputOut

Upvotes: 1

Related Questions