question

Gabri avatar image
0 Likes"
Gabri asked Gabri commented

How to save in a Parameter Table the quantity of each item's types in the queue

Hi,

I'm doing a reinforcement learning project and I have two question.

1) I have a source that generates 5 types of people. I created a model parameter table for my observation space parameters. In it, I want to have five parameters that indicate how many people for each type there are in the queue. I tried to use a WIP by type in the dashboard and it works but I'm not able to insert those values into my observation table. Can anyone tell me how to do it or tell me other ways I could do it?

2) Next I want to change the pull strategy of my processor and I have to use the values saved in the observation table, is it possible to do it or is it better to save those values in a global table and access them from there? Whether it is possible to do it, how?


Thanks for the answers

FlexSim 22.0.16
reinforcement learningmodel parameters table
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
0 Likes"
Felix Möhlmann answered Gabri commented

1) It's probably easiest to just increment/decrement the respective parameter when an item enters/exits the queue in the triggers.

ContentByType-parameter-fm.fsm

2) Have you looked at the RL tutorial yet? It showcases how to use a parameter value to control what item type is pulled.


· 3
5 |100000

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

Gabri avatar image Gabri commented ·

Hi, thanks for the answer and for the model, I wanted to ask though, if instead of having NumTypeX I have 5 different parameters with the respective colors, then "red", "green" etc. how can I do via the code snippet?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Gabri commented ·

You must have some label that determines the color. Use that in a series of if-conditions.

if(item.ColorLabel == 1)
{     Model.parameters.NumItemsRed += 1; } if(item.ColorLabel == 2) {     Model.parameters.NumItemsGreen += 1; } ...

Note: If the parameter name contains a space, you have to use the "Model.parameters[paramName].value" syntax that I used in the example model.

0 Likes 0 ·
Gabri avatar image Gabri Felix Möhlmann commented ·

Thank you so much, I made it

0 Likes 0 ·