Hi, I'm complete newbie at Plant Simulation. Dealing with a problem with exit strategy of Source. I do have several sources heading to Buffer with selected capacity. I need to set the exit strategy that will say when the buffer is full (completely occupied) move the MU to Drain. I do have very simple method but it is not working.
Solved! Go to Solution.
You can handle it thanks too "Edit Observers" in your Buffer. (Choose numMU as a watched parameter).
Attach a method to your Buffer Observers. You method would be look like this :
ps : Don't create a connector between the Buffer and the Drain.
I hope it helps
is do if Buffer.numMU = Buffer.capacity then -- it means that your buffer is full local myMU : object := Buffer.cont ; myMU.move(Drain); end; end;
thank you so much for such a fast response. But to be honest, I've tried it, but still not working. I'm adding the simple example. I do have 4 sources that are sending MUs to Buffer which moves them to ParallelProc (then Drain). I want to move MUs directly from sources to Drain1 when the buffer is completely full (not to let them wait until the buffer is empty). Right now the capacity is only 1 to test , if the it is working (intervals and other times will be completely different at the end). Maybe I'am doing something wrong.
I would not use an observer for this. But if you do so, I would observe the attribute 'full' instead of 'numMU'. You need to declare 2 formal parameters in the observer Method. The first parameter will be set to the name of the observed attribute and must therefore be of data type string. The second parameter will be set to the old value of the attribute and must be boolean for the attribute 'full'.
As I said, I would not use an observer. Instead I suggest you use the same exit control in all your Sources. The source code of this exit control should look like this:
is do if Buffer.full then @.move(Drain); else @.move; end; end;
I actually have no idea what you are trying to to, but if you just you want to skip the buffer when it cannot take an MU for any reason (because the Buffer is full, or failed, or the entrance is locked, ...), you could use the exit strategy "Start at successor 1" in "non-blocking" mode in all the Sources and insert a second Connector for each Source that leads to the Drain.
Well, the easiest solution is thus NOT to use an exit-control, but to draw 4 additional connectors to Drain1 and set the appropriate exit strategy (Start at successor 1).
As a rule: if one of the built-in exit strategies fits the job, use it!
Thank you all for greate help! All the solutions were usefull the the best was the easiest one! I will save the others for further work. Quite sure I will use them.