Closed rukyr97 closed 1 year ago
@rukyr97 thanks for this patch. I have applied the two first commits, as I have seen that there are some issues with the last one. Could you fix it? and do another PR?
The last commit was to solve an issue I was having when running my ns-3 sim script.
For context, I use symbolic links to develop my work outside of the scratch/
folder in ns-3. This requirement of mine was not compliant with the current ns3-gym version. As far as I could tell model/ns3gym/ns3gym/start_sim.py using os.getcwd()
, assumes that my ns-3 script would be placed within this scratch/
folder. The patch was a simple and "dirty" workaround to provide ns3-gym the source directory it should consider, avoiding the use of os.getcwd()
.
To make it work, simply provide the src_dir
param in the Ns3Env constructor.
ns3_gym_env = ns3env.Ns3Env(port=port,
simSeed=seed,
startSim=True,
simArgs=sim_args,
debug=True,
src_dir="~/foo/bar")
For the content of the variable, I use
src_dir = os.path.abspath(os.path.dirname(__file__))
but again it is specific for my use case and it depends on what the user may need :)
Actually, I was just refreshing my memory and now I remember that this PR has some issues, but https://github.com/tkn-tub/ns3-gym/pull/72 fixes them, iirc.
The installation of
pkg-config
was mandatory to be successful with running the./ns3 configure
command.