question

Noah Z avatar image
0 Likes"
Noah Z asked Logan Gold commented

Date Time Source Not Updating

Running into an issue. Essentially I want use a Date Time Source that has references to quantities of tokens to generate with the value of how many to generate stored in a global table cell. The quantity in those global table cells are subject to change during the simulation run. My attempts in my real model were not working so I built a dummy model and was able to recreate the issue.

The model should run where at time zero a single token is generated based on an initial value of 1 in the referenced global table cell. Then 30 minutes into the run I change the global table cell value to 500. When the next hour occurs the next generation of tokens should read from the global table cell again and generate 500 fresh tokens for a total of 501 tokens generated.

Instead what happens is that only one additional token is being created at the second hour token creation point. It feels like the Date Time Source took a snapshot of the Quantity values at run start and doesn't check again when it is time to execute the token generation? Is this intentional? If so, is there a workaround to force the source to recheck the quantity reference each time it's going to generate tokens?


Secondly, a new issue popped up which can be seen in the attached video. When I push Reset on the model to try again it resets the global table cell value back to 1. However, if I only push Reset one time, the cell itself changes back to 1 as expected, however, when I run the model it's like the Source thinks it's still set to 500 and generates to batches of 500 tokens erroneously. To prevent this issue from happening I can push Reset twice back to back and it appears the source goes back to a value of 1 AND the source recognizes the cell value as 1.


Testing Date Source Arrivals Snapshot Time.fsm

FlexSim 24.2.0
sourcetokens
· 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.

Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @Noah Z, was Emily Hardy's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Emily Hardy avatar image
0 Likes"
Emily Hardy answered Emily Hardy commented

I looked into this and I agree that the Date Time source is probably not checking the table for new values. One way you can easily get around this is to create only 1 token, and then use a "Create Tokens" activity and have that read from your Global Table as so:

1726249325197.png

You can copy any or all the labels from the original token from the Date Time source if you need specific data tied to certain arrival times.


I was unable to replicate the second problem you identified. Can you see if you're still getting that same issue on the model that I'm attaching to this reply?

testing-date-source-arrivals-snapshot-time_EditedEH.fsm


· 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.

Noah Z avatar image Noah Z commented ·

Thanks for the quick reply. Your work around works well for bypassing the lack of live updating if the global table value changes (also I do not see the second error show up either in your model) that I was seeing.


My issue (which I didn't really specify in my original post) is that the reason I need/want to use the Date Time Source specifically is I can feed it a number (let's say 50 for a given hour) and then can specify in the source drop-down to "randomly space" them out over the hour to mimic a target quantity arriving over an hour but randomly arriving within that time.

I suppose one work around for that would be if I drew from a uniform(0-60) and assigned intial wait times labels to the tokens that were just created to prevent them moving forward (i.e. actually arriving) until their individual delay was finished. Is that kind of what the Date Time Source does under the hood when assigning arrival times when "Randomly Spaced" is the option selected within the source settings?



0 Likes 0 ·
Emily Hardy avatar image Emily Hardy ♦ Noah Z commented ·

I see. Would it be possible for you to just have the table with the quantities in the Date Time source? If you're reading from another table and the number of arrivals changes every hour (or some other amount of time) can you not just read from a global table with multiple rows?

1726258447834.png

If this isn't possible, then yes, I would probably use a delay after the token is created to replicate the random behavior.

0 Likes 0 ·
1726258447834.png (93.6 KiB)