question

sanaz karamimoghaddam avatar image
1 Like"
sanaz karamimoghaddam asked Steven Hamoen answered

How to modify the arrival time of the items in the source during run?

schedule-source.pngschedule-source2.pngHi all!

I am using a schedule source which sends an important signal to the system by creating items on the schedule. during the simulation run, these arrivals should be delayed based on a delay that occurs inside the simulation. I used :

settablenum(getvarnode(node("Dummy3_30days", model()), "schedule"), row,1, gettablenum(getvarnode(node("Dummy3_30days", model()), "schedule"), row-1,1) +delay);
and I see the arrival values change when the model is running. But the items are not getting created neither based on the new delayed time, nor based on the original time, they are getting creating at a value which looks like to be the difference between the delayed time and the original time. I was wondering whether the source object is designed for such a change and is able to process it, or is there another way that I can approach this problem?
FlexSim 16.2.1
source schedulearrival timesource update
schedule-source.png (77.4 KiB)
schedule-source2.png (123.5 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel edited

Don't make it to complicated. Do you really depend on a scheduled arrival time. It is much easier if you switch to a classic interarrival time. Then you set a label in the source which you evaluate in the interarrival time function.

	getlabel(current,"your_Label")

In the OnCreation Trigger you set the next arrival time value for the label. Maybe the Flexsim engine has already evaluated the previous set value for the next arrival. Then the new set value will be the arrival time of the arrival after the next arrival.Try it your own when the new value is the new arrival time.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

sanaz karamimoghaddam avatar image sanaz karamimoghaddam commented ·

Dear @Jörg Vogel,

Thanks for your response.

The schedule on the source is input and there is no detectable trend that I can use in inter-arrival source. The problem that I am facing is that when updating the arrival values during simulation,the source starts to create items on wrong times, and not the times that shows on the arrival time of each item. The first picture I attached shows the original arrival times that are set on reset. we can see that item 157 arrival time is 14521.

In the second picture, the item number 157, is already created at time 4752, when the updated arrival time for this item on source is 18521.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel sanaz karamimoghaddam commented ·

Any change in the schedule table hasn't got any effect at all. If you change the interarrival time, then you must do it in the OnCreation Trigger to get the desired effect. Attached is small model.

0 Likes 0 ·
Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered

@sanaz karamimoghaddam

Other solution might to just create an item in the source but close the output. When you know when the next product should enter you open the output and onexit close it again. In that case you don't have to mess around with complex tables etc.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.