question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Ankur A3 commented

Schedule is not working in sync with model data and time?

Hi Team,

I have defined weekly schedule in arrival table but it is not working in sync with model data and time. For eg: When model is started from Wed, it should generate the Wed arrivals. But it is not happening in this way.

1660324753075.png

Can you give me clarity about its operation?

Thank you!

FlexSim 21.0.10
arrivalsmodel date time
1660324753075.png (169.6 KiB)
· 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Ankur A3 commented

This might still be the same bug mentioned here. The source always uses the table as if the model starts on a monday when the weekly mode is used.

As a workaround I can offer the following code that allows you to quickly shift the table entries by a set amount of days. Whenever you change the start date of the model, run the code so that the "Monday" column contains the data for the actual start day (and the rest of the values will be shifted accordingly).

  1. // Adjust the path to lead to the respective source activity (PF Name and Source Name)
  2. treenode arrivalTable = Model.find("/Tools/ProcessFlow/ProcessFlowName/SourceName>variables/arrivals");
  3. treenode dummyTable = createcopy(arrivalTable, arrivalTable.up);
  4. int shiftBy = 1;    // The amount of days to shift the arrivals backward
  5. for(int i = 1; i <= 168; i++)
  6. {
  7.     int shiftRow = (i + shiftBy*24 - 1)%168 + 1;
  8.     treenode QtyNodeReplace = createcopy(dummyTable.subnodes[shiftRow].subnodes[3], arrivalTable.subnodes[i].subnodes[3],1,0,0,1);
  9. }
  10. dummyTable.destroy();

timetableshift.gif


timetableshift.gif (97.0 KiB)
· 6
5 |100000

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