question

Krish S avatar image
0 Likes"
Krish S asked tannerp commented

Getting Global Table Values in Experimenter

I am unable to put the values which I got in global table after experimenter. The array is created. But the values are not getting printed in the final output. Is there a problem in my end of replication code? Or I am missing something?

Attaching the file along with this.

1.fsm

FlexSim 18.1.2
global tableexperimenterflexsim 18.1.2global table to experimenter
1600706624996.png (6.6 KiB)
1.fsm (30.9 KiB)
1.fsm (81.9 KiB)
1.fsm (84.7 KiB)
5 |100000

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

Krish S avatar image
0 Likes"
Krish S answered

After working on it for sometime, I got how to get global table values during an experimenter. Still need to do some post processing after you get the data. But this might be a good start on how to get global table values in an experimenter. @abhishek.k @joerg.vogel

Final_Solution.fsm


1601004150014.png (18.4 KiB)
final-solution.fsm (34.0 KiB)
5 |100000

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

tannerp avatar image
0 Likes"
tannerp answered tannerp commented

@krish.s,

I inserted a break point into your EndofRun code and it appears that the array is created, but it is not getting filled. My guess is that it's because the length of your array is set as the number of rows in the "Final" table, which is 1. So, your loop only runs once to fill the array. This is shown in my screenshot below. I hope this makes sense. Maybe you can take a look at this and see if it's correct.

My suggestion is to add breakpoints like this and make sure your code is working how you expect line by line. Let me know if you have any questions about how to use breakpoints.


empty-array.png (105.5 KiB)
· 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.

Krish S avatar image Krish S commented ·

Hi @tanner.p. Thanks for your reply. I am unable to figure out why x is 1. If you run the simulation normally, you could see the final table getting populated. But within the replications it’s not recognizing that final table is filled. Or even the table is not getting populated.

what am I missing ?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Krish S commented ·

A scenario of an experiment is a copy of your model which runs completely independent from any other scenario. A global table is a part of this copied model and there is not a master mind which is collecting from within a copied model structure all results which you can take to manipulate while all scenarios are still running. Each scenario is completely encapsulated. The rows of a global within a scenario are filled by each single copy only once. Only the experimenter tool has a structure to collect results. Any optimization while an experiment is running is prohibited. All you can do is running several experiments in sequential order with sets of optimized values in the scenarios.

0 Likes 0 ·
Krish S avatar image Krish S Joerg Vogel commented ·
Sounds fair. What is the order of execution of the Experimenter code?
0 Likes 0 ·
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.