Cancel
Showing results for 
Search instead for 
Did you mean: 

initialization of buffer at sim start not working as expected

Creator
Creator

At the start of the simulation, I want to fill a buffer with 3 MUs. Furthermore, I want to pretend that each MU has already be sitting inside the buffer for a specific time and therefore does not need to wait for the entire dwell time before it can leave.

For test purposes I wrote the following code Inside the Init-Method of the buffer:

 local MU : object;
 for local i := 1 to 3 loop
  MU := .MUs.Entity.create(@);
  MU.outIn(i*15, false);
 next;

In my example, the dwell time of the buffer is set to 1:10 minutes and the processing time of the following singleProc to 5 seconds. Therefore, shouldn't the first MU leave the buffer after 15 seconds, the second MU after 30 seconds and the last MU after 45 seconds? At least, that's what I intend to achieve!

However, I get the following result (print to console):

 

entry control singleProc, time: 15.0000; ID MU: 1
exit control buffer, time: 15.0000; ID MU: 1
exit control singleProc, time: 20.0000; ID MU: 1
entry control singleProc, time: 45.0000; ID MU: 3
exit control buffer, time: 45.0000; ID MU: 3
exit control singleProc, time: 50.0000; ID MU: 3
entry control buffer, time: 1:00.0000; ID MU: 4
entry control singleProc, time: 1:10.0000; ID MU: 2
exit control buffer, time: 1:10.0000; ID MU: 2
exit control singleProc, time: 1:15.0000; ID MU: 2

 

MU 1 and MU 3 exit as expected, but MU 2 doesn't exit at 0:30 although the following singleProc is empty. Instad it leaves after the default dwell time of the buffer. Can someone explain, what is happening?

 

Thank you!

 

 

1 REPLY 1

Re: initialization of buffer at sim start not working as expected

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello,

 

when your first part exits the buffer, the buffer looks at the next part in line and assigns it a time to exit the buffer according to the dwell time predefined in the buffer. This is the standard behavior of the buffer and it does not take into account user defined exit times for a part. As this behavior indeed might be inconvenient in some situations it might get altered in future versions to also take into account user defined exit times.

 

Kind regards,

Igor
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution