can i configure flexsim model with tensorflow for reinforcement learning

damini_c
Not applicable
0 Views
1 Reply
Message 1 of 2

can i configure flexsim model with tensorflow for reinforcement learning

damini_c
Not applicable

[ FlexSim 21.0.8 ]

Hi , I want to configure flexsim model with tensorflow. I want to train agent for flexsim model using reinforcement learning. How will i configure flexsim model in tensorflow?

thank you

0 Likes
Reply (1)
Message 2 of 2

philboboADSK
Autodesk
Autodesk
Accepted solution

To train a TensorFlow agent using reinforcement learning currently, you will need to write a custom environment that communicates with FlexSim.

See Environments | TensorFlow Agents.

You'll want to spawn a FlexSim process from the __init__() method of your custom environment.

See Automatically Configure and Run a FlexSim Model - FlexSim Community.

Then you'll want to communicate with FlexSim in the reset() and step() methods of your custom environment. I suggest using sockets to communicate.

See Using FlexSim with Python/C api - FlexSim Community.

I would use the Module SDK or DLL Maker to write the socket code in C++ on the FlexSim side so that you have full control, but there are also FlexScript socket functions that may be good enough:

See how to use flexsim socket communication with server and client - FlexSim Community and Socket Examples - FlexSim Community Forum.

The FlexSim Development Team is currently working on making this integration easier by creating a custom OpenAI Gym Environment that communicates with FlexSim directly by loading and executing functions in the FlexSim.dll. If you want to make this work right now before that development is available, you can write the communication code yourself using the references above.



Phil BoBo
Sr. Manager, Software Development