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

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

sanaz_karamimoghaddam
Not applicable
39 Views
4 Replies
Message 1 of 5

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

sanaz_karamimoghaddam
Not applicable

[ FlexSim 16.2.1 ]

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?
Accepted solutions (1)
40 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

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.

0 Likes
Message 3 of 5

sanaz_karamimoghaddam
Not applicable

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
Message 4 of 5

joerg_vogel_HsH
Mentor
Mentor

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
Message 5 of 5

SCHamoen
Advisor
Advisor

@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.

0 Likes