tkn-tub / ns3-gym

ns3-gym - The Playground for Reinforcement Learning in Networking Research
GNU General Public License v2.0
514 stars 196 forks source link

How to perform the simulation with a python script? #56

Open WytheC opened 2 years ago

WytheC commented 2 years ago

Hello! In the example "rl-tcp", the details and steps of the simulation are defined in "sim.cc". Can I write a python script to do the simulation? I tried to generate the python bindings for opengym module but it ended up with failure. Do you have some suggestions? Thank you so much!

carlee0 commented 2 years ago

I don't think this repo provides a way to build python bindings. ns3 allows writing simulation scripts in python (e.g. examples/tutorial/first.py) and run by waf --pyrun, but not in ns3-gym I am afraid. If you figured out how to do that, I would be very happy to know. :) The only two ways to start the simulation (that I know of) are either using waf --run or using a gym environment to start a simulation script like in the scratch examples.