question

Craig DIckson avatar image
0 Likes"
Craig DIckson asked Craig DIckson commented

Assigning TimeTables using code -- seems like FS2020 broke it?

I have a model with a large number of processors (>>100) and quite a few transporters. We will be using the model to test/demonstrate staffing strategies, so I needed to assign one of four shift schedules to each and every processor and transporter using code, as doing it manually will be impractical. I dug though the forums and found a way to do it using nodejoin(), and it seemed to work in FlexSim 2019.

But now I upgraded to FlexSim 2020 and it broke. At the start of the first break I get the following messages, and only the first processor in each time table's members is stopped. After that, that TimeTable stops - it doesn't restart the processor after break, nor does it continue to the next break.

Here is the error message:

time: 2700.000000 exception: Exception Caught in ObjectFunction267__project_library_TimeTable_behaviour_eventfunctions_OnTimerEvent object: /Tools/TimeTables/TimeTable2 i: /Tools/TimeTables/TimeTable2>variables/table/2 class: /Tools/TimeTables/TimeTable2


time: 2700.000000 exception: Exception caught in TreeNode::receivemessage()
time: 2700.000000 exception: Exception caught in Executive::processeventinlist(). Throwing.
time: 2700.000000 exception: Exception caught in Executive::steptotime(). Throwing.
time: 2700.000000 exception: Exception caught in Executive::tick(). Throwing.
time: 2700.000000 exception: int runthemessageloop() #4
exception: Executive::instance.tick();
time: 2700.000000 exception: int runthemessageloop() #6

I looked at the referenced location in the tree and didn't see anything that looked obviously wrong...

I was able to replicate it in a small model (attached). The idea is for the user to choose the time table for each processor by filling out the global table "tableScheduleAssignments" before each run*. At startup, the process flow code deletes all the connections from the two timetables (since you are presumably choosing a different configuration), and then makes new connections based on the global table. After the code runs you can see the TimeTables in the processors' Breadown tabs, and you can see the processors in the TimeTables' Members tab, as expected -- it looks exactly as if you did it manually. But it dies at the first break when running in FS2020.

Can you help me figure out how to make this work in FS2020?

Model: timetableassignmentusingcode.fsm

(* FWIW, in the actual model, the assignment table is read in from Excel, though this doesn't affect the operation of the code.)

FlexSim 20.0.0
timetables
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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Craig DIckson commented

The member nodes need a sub node with number data. The time table does this in its OnReset so here are some options:

  1. Reset the model after changing the members.
  2. Update to 20.0.1 and use the memberadd() command.
  3. Update your code to add the sub node.
See this post for more information: https://answers.flexsim.com/answers/77734/view.html
· 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.

Craig DIckson avatar image Craig DIckson commented ·

Thank you for the quick reply! @Matthew Gillespie

I did #2 and it worked.

#1 wasn't going to work because the model doesn't know the assignments until after the reset, since it is reading the assignments from Excel on reset.

#3 would probably work, but #2 was a lot simpler.

FWIW, generally, I wish it was a bit easier to find documentation on infrequently used commands like memberadd()

0 Likes 0 ·