Let me describe the situation above:
- 20 agents injected at each soruce block.
- Wait block has max capacity.
- Assembler uses 1 of each source and delay is 1s.
- Queue has max capacity
- QueueSize1 is a queue of size 1
- Delay is 15s
- ResourcePool has capacity of 1
Function startAssembly():
if(queue.size()==0 && wait.size()>=1 && resourcePool.idle()>=1){
wait.free(wait.get(0));
}
System.out.println("Queue: " + queue.size());
System.out.println("Wait: " + wait.size());
System.out.println("Idle: " + resourcePool.idle());
Function startAssembly(); is called:
- onEntry of wait
- onExit of assembler
- onExit of queue
What do I want to happen: Model an assembly line with two processes connected through a queue(FIFO). Process 1(assembler) is faster than process 2(delay). Therefore queueSize1 fills up and after process 1 finishes a second part it can't work any further. Usually the worker is then displayed as busy() since the agent can't leave the assembler. I want it to be displayed as idle() when this happens using the function, wait and queue.
What happens:
One agent passes the assembler and after that no other agent is able to pass through the wait block. By collecting resourcePool.idle() I noticed that even after the agent exited the assembly block there are no free resources. I also tried a consturct like assembler.delaySize()==0 in the if part, but there's also some strange behaviour. Replacing the idle-part with the delaySize-part kinda works, but it also passes 2 or 3 agents into the assembler block. So the "production line" contains more workpieces than it should.
Question: Is this a normal behaviour of the assembler block? Is it possible to avoid this and get the correct idle()-amount? Is there any other possible way to model my "production line"?

