question

Farah A avatar image
1 Like"
Farah A asked Farah A commented

Testing Reinforcement learning functionality

Hello everyone,

I'm discovering the new functionality of Flexsim Reinforcement Learning and i'm still not familiar with the concept application, i'm struggling a bit to make it work.

I want to generate disturbance, when an item arrives at a turn, it is blocked for few seconds, i want from my agent to be aware of that blocking state and send the information to release the item.

How to make the agent receive the information and send the action ?

Here's the model i'm working on testRL.fsm, can you please help me ?

Thank you in advance

FlexSim 22.0.0
reinforcement learning
testrl.fsm (282.0 KiB)
· 1
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

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Farah A commented

Let me clear up a concept first. The agent won't be watching the model, waiting for something to happen. Instead, something will happen in the model, and the model will ask the agent what to do. This means the Agent doesn't have to detect the issue; the agent won't be good at that. The model (or in real life, sensors) can detect the issue.

In your case, it sounds like the conveyor system gets backed up for some reason, and you want the AI to decide what to do about it. So the first step is building a model that gets backed up, and then using the Reinforcement Learning tool listen to something, such as the OnBlock of a photo eye. That way, when the model detects a block, you can ask the AI what to do. In FlexSim, that means you'll set the parameters that are part of the observation space. My guess is you'll want to send the values for how many items are at various parts of the model (such as in a given lane, or in a queue) or something like that. Whatever info you send, it should be info that the AI needs to make a decision. Note that it doesn't need to know "there's a problem", because you're only asking in that situation, and reducing the number of observation space parameters is a good idea.

Anyways, the AI will then express an action. In FlexSim that means the AI will set the parameter values in your action space. You need to make sure that your model uses the values in the action space to change its behavior. To do that, you'll first set the Reinforcement Learning tool to just pick random values. That way, you can test that your model detects the issue and responds to random actions correctly. Once you've done that, you're ready to train the AI as directed in the walkthrough material:

https://docs.flexsim.com/en/22.0/ModelLogic/ReinforcementLearning/KeyConcepts/

https://docs.flexsim.com/en/22.0/ModelLogic/ReinforcementLearning/Training/

https://docs.flexsim.com/en/22.0/ModelLogic/ReinforcementLearning/UsingATrainedModel/

· 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.