question

C avatar image
0 Likes"
C asked C commented

Repeating "Schedule Source" depending on the name of the day

Hello everyone,

What I'm trying to do is I want to change the arrival times in all "Schedule Source"s in all Process Flows, depending on the day of the week. And I want to make them repeat for 52 weeks.

I'm aware that there is a number (0 to 6 for Monday to Sunday) assigned for each day of the week; at least, it shows those values under the tree view.

The current Schedule Sources would be for days 0,1,2 and 3 (Monday, Tuesday, Wednesday, and Thursday). Friday would have a different schedule with the same routes. The weekend has different routes and schedules, which I'll be setting up after this.

Approach 1:

So my pseudo-code thingy (sorry for the eye bleeding, this is coming from a non-coder) would be something like this:

if (Model.dateTime.dayOfWeek == "0,1,2,3")
then Schdedule (bos_uck), Schedule (uck_bos), Schedule (ksk_kon) etc happens
if (Model.dateTime.dayOfWeek == "4")
then Schdedule (bos_uck_fri), Schedule (uck_bos_fri), Schedule (ksk_kon_fri) etc happens
if (Model.dateTime.dayOfWeek == "5,6")
then Schdedule (bos_uck_we), Schedule (uck_bos_we), Schedule (ksk_kon_we) etc happens
else
Phd == "fail" :)


Approach 2:

I believe there is another very crude way of doing this, but I need help with that again. I can arrange the arrival times for each Schedule Source for a year in Excel. But I need to copy it to the "Schedule Source". I need to add them row by row in the interface, which would take quite a long time. Maybe we can set a different table for each Schedule Source and copy times from there (which I don't know how to or how to code this either)?


v4-ships-are-sailing-base-custom code selective charging_all ferries working all day.fsm

FlexSim 19.0.0
repeating schedule
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 C commented

You can use the Date Time Source activity and define a weekly schedule that repeats every week.

· 8
5 |100000

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

C avatar image C commented ·
Hi, did you check my model attached? When I implement the Date Time Source Activity for "Ferry" Process Flow it simply sends the first ferry at 07:15 and it fails to send the second ferry at 07:30. For me, it doesn't work.
0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ C commented ·

I'm not sure what you did in your model, but here's a version of your model with the BOS_UCK activity replaced with a Date Time Source activity.


v4-ships-are-sailing-base-custom-code-selective-ch_DateTimeSource.fsm

0 Likes 0 ·
C avatar image C Matthew Gillespie ♦♦ commented ·

Thank you very much Matthew, I did the same thing but I must have done something wrong. However there is a problem with this approach. Ferries act wrong after around 13:00.

Without Date Time Source Activity:

2.png

With Date Time Source Activity:

1.png

Can you please comment on this?

0 Likes 0 ·
1.png (9.0 KiB)
2.png (6.1 KiB)
Show more comments

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.