Reinforcement learning

Reinforcement learning

Clara1
Not applicable
709 Views
5 Replies
Message 1 of 6

Reinforcement learning

Clara1
Not applicable

[ FlexSim 24.0.1 ]

I am trying to simulate model with AI using reinforcement learning. I am following your tutorial of flexsim 2022 (https://docs.flexsim.com/en/22.1/ModelLogic/ReinforcementLearning/Training/Training.html) . But I am facing issue in python It cant able to fetch observation data. It did not update further value.

1706610806990.png

1706610817993.pngChangeoverTimesRL.fsm

Version 24.0.2


0 Likes
Accepted solutions (1)
710 Views
5 Replies
Replies (5)
Message 2 of 6

nilP8GEZ
Advocate
Advocate
Accepted solution

Hello,

I've reviewed your model and it appears that it should be working perfectly. However, it seems there might be a bug causing the issue you're experiencing.


I'm sending you a modified model that resolves this problem. I believe this is a better approach and I highly recommend it. The problem lies in the Decision Events within the Reinforcement Learning tab. We’re going to delete them all (as they seem to be failing) and we’ll call the RL from another place.


The solution involves using ProcessFlow to create a token each time an event triggers, and then calling the RL from a customCode. The default code for this is located in control. After this, we remove the token.


I hope this helps!

changeovertimesrl.fsm


0 Likes
Message 3 of 6

Clara1
Not applicable
Thank you so much!!
0 Likes
Message 4 of 6

Clara1
Not applicable

Hello, even tough your answer solved the issue, i have kept going with the training part and i'm facing another problem now.

It seems that, because we changed the way observation and action space are defined, it's not able to inherit from the gymnasium class correctly. (Error image attached).
1706769166412.png
Thanks in advance!

0 Likes
Message 5 of 6

nilP8GEZ
Advocate
Advocate

Hello Clara,

We will try to look at it as soon as possible.

However, since it’s not the same problem as before, I strongly recommend that you create a new question, so it will have more visibility for all users

0 Likes
Message 6 of 6

Clara1
Not applicable
Ok, thanks for you time!
0 Likes