question

mattias avatar image
0 Likes"
mattias asked Felix Möhlmann commented

Global table as parameter in experimenter

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!

FlexSim 24.1.0
global tableexperimeterusing code
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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

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

  1. Table dumpChargerTable = Table(Model.parameters.DC_TableName);

1712226294363.png (1.8 KiB)
· 5
5 |100000

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