question

Dylan R2 avatar image
0 Likes"
Dylan R2 asked Regan Blackett answered

Add label for due date(s) to created flow items and track on time completion

I am new to flexsim, and I have a basic model with two sources, a queue, a processor, and two sinks. I would like to add a label for a future "due date" when a flow item is created, and then if the item is processed before the "due date" it is placed in the on time sink, else it is placed in the late sink. I would like this "due date" label to be assigned based on a statistical distribution, i.e. assign a future date an average of x hours in advance with a std deviation of y hours from when it was created.

FlexSim 18.2.2
flowitemslabel assignmentschedulelabel logicflowitem lables
5 |100000

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

1 Answer

Regan Blackett avatar image
0 Likes"
Regan Blackett answered

See the attached demo model.sink-by-datetime.fsm

I did this with two labels assigned during the OnCreation trigger of a source, one that gets the time each flowitem is made, and then another that adds that time to a normally distributed value to create the 'Due' time:

It had to be two labels because I got casting errors if I tried to do it all at once. Then for routing it to the right sink it's a simple conditional port where you compare the current time with the due time:

if you want to print out some verification that it all works, you could add this to the send to port code of the processor(s):

print("Current Time: ", Model.dateTime.toString(), ".  Expected Time: ", DateTime(item.DueTime).toString());

5 |100000

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