question

pc neo avatar image
1 Like"
pc neo asked pc neo commented

exception seen when dynamically adding member to timetable

2018-timetable-ex.fsm

annotation-2020-01-08-151245.jpg

The model has a time table that stops object from 8:00-8:05am and 8:15-8:40am. To mimic dynamic adding of member I've done the following steps:

a) model start time at 8:00am. run model and stop it anytime before 8:05am

b) run the script command to clear time table and add member to time table

c) continue to run model and exception will be seen.

annotation-2020-01-08-153439.jpg

FlexSim 20.0.0
timetablesdynamic adding member
· 4
5 |100000

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

Cliff King avatar image Cliff King commented ·

I too thought you might be able to change your timetable member list dynamically during runtime, but apparently it is not possible. The memberremove() and memberadd() commands were designed to build timetable member lists automatically with code BEFORE the model is reset and run. This is something that makes sense when setting up multi-scenario experiments. The commands cannot be used after reset because the timetable object assumes the member list is the same as it was at time of reset.

However, you can still do what you want using your own code or process flow events. In most cases, the timetables are just executing the stopobject() and resumeobject() commands at set times, which you can easily do yourself with your own loop of time events within a simple process flow.

0 Likes 0 ·
pc neo avatar image pc neo Cliff King commented ·

I accept the point that the same requirement can be done using other approaches. :)

My view is that the same approach works in previous version 2018 and 2019 (you can use the same model and runs in 2018 or 2019). This change in behaviour in 2020 is a little unexpected. So, I wonder if this will be looked as a "bug" in 2020 and have a fix done in upcoming updates? This will help me decide what I need to do with those models that are done previously.

1 Like 1 ·
Phil BoBo avatar image Phil BoBo ♦♦ pc neo commented ·

In the backwards compatibility section of the 2020 release notes, it mentions a change to time tables:

  • Time tables now combine consecutive down periods if using the same state and profile or the same down behavior.

https://docs.flexsim.com/en/20.0/Reference/DeveloperAdvancedUser/ReleaseNotesAndHistory/

Perhaps this change caused this to behave differently in 20.0 than in earlier versions.

I'll add a note to the dev list to look into it.

0 Likes 0 ·
Show more comments

1 Answer

·
Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered

The TimeTable's OnReset function does an extra step to its list of members that the memberadd() command wasn't doing. Before 20.0 the TimeTable's OnTimerEvent function would just skip over a part of what it was trying to do if that step hadn't happened. As Phil mentioned, in 20.0 we modified the TimeTable's OnTimerEvent function so that it would automatically combine down periods. As part of that change we inadvertently made the code stricter so that it now throws an exception if its members list isn't set up the way the OnReset function does it.

Basically the TimeTable object and memberadd() command weren't really designed to handle members dynamically being added during the model run. That said, it seems to work pretty well despite that fact. So we've updated the memberadd() command for 20.0.1 so that this model should continue to work like it did before.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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