Global table as parameter in experimenter

Global table as parameter in experimenter

mapo19
Participant Participant
39 Views
6 Replies
Message 1 of 7

Global table as parameter in experimenter

mapo19
Participant
Participant

[ FlexSim 24.1.0 ]

Hello everyone!

I have a model that uses several global tables to determine the route, speed, consumption etc. These tables are called via code snippets like the one in the picture below and in several other process blocks.

skarmbild-2024-04-04-105609.png

I am wondering if it is possible to set up an experiment that can call in new tables and run the experiment with these new tables instead of manually changing each table in all blocks and running it as normal. For example (with the tables from the picture in mind), an experiment that replaces all "DumpCharger", "ChargerLoad", and "LoadDump" with "DumpCharger1", "ChargerLoad1", and "LoadDump1" in the process flow blocks that uses them.

Thank you for your time and expertise!

0 Likes
Accepted solutions (1)
40 Views
6 Replies
Replies (6)
Message 2 of 7

moehlmann_fe
Observer
Observer
Accepted solution

You can use an "Expression" type parameter. Theoretically the parameter could then already contain a reference to the table node. But since that would be more complex when entering the values in the scenario table and also less readable I mostly just set the table name as the parameter and then always refer to that parameter when calling the table.

1712226294363.png

Table dumpChargerTable = Table(Model.parameters.DC_TableName);
Message 3 of 7

mapo19
Participant
Participant

Hello!

I have tried and tested but have not gotten the desired results. However, I will test some more tomorrow to see if I can get it to work!

Thank you for answering!

0 Likes
Message 4 of 7

moehlmann_fe
Observer
Observer

Here's a small example in which the process times of a processor are determined by one of three tables.

table-parameter-fm.fsm

0 Likes
Message 5 of 7

mapo19
Participant
Participant
I got it to work. Thank you for your time and expertise!
0 Likes
Message 6 of 7

mapo19
Participant
Participant
Just wondering, but is it possible to refer to two tables in one value? For example, writing "DumpCharger1" && "DumpCharger2"?
0 Likes
Message 7 of 7

moehlmann_fe
Observer
Observer

You can write an array into the expression parameter. Though you will handle the value accordingly when reading the parameter.

1712332711340.png