question

Dylan R2 avatar image
0 Likes"
Dylan R2 asked Jason Lightfoot edited

Don't start a job that won't be finished before shift ends

I have a model with an operator working two shifts each day during the week, with fairly lengthy processing times. I would like to change my model so if the operator doesn't have enough time to complete the whole run before the end of the day, he will complete the setup and wait to begin processing during the next work period.

FlexSim 18.2.2
manufacturingschedulesoperator and resourceprocessingschedule processor
· 1
5 |100000

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

tannerp avatar image tannerp commented ·

@Dylan R2, If you add a label that identifies the length of the process time, you could use a decide activity to either delay or send the token on.

Would it be possible for you to upload your model or a sample of it so we can find something that would work in your situation?

2 Likes 2 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

Assuming you're using a date-based timetable/calendar to define your shift stops - in the upfunction (shown as Resume Function in the GUI functions) you can find the time of the next planned stop for a given timetable calendar using this:

double timeofnextplannedstop=GLOBAL_DELAYINDEFINITE;
Table calendar=getvarnode(current,"table");
if (calendar.numRows>tablerow)
	timeofnextplannedstop=calendar[tablerow+1][1]-getvarnum(current,"modelstarttime");

So record that time as the shift end somewhere, and refer to it after setup to see if you have enough time

double timetoshiftend =timeofnextplannedstop-time();
if (processtime<=timetoshiftend)

//  START or PULL etc...<br>
· 1
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

If your object is a member of multiple timetables this becomes harder - in the past I've written functions to consolidate them into one "netavailability" timetable so that the above code would still work on the "net calendar".

0 Likes 0 ·