Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't change nodeNum where I run the example of qlearn.py #8

Closed
hzr1140521792 opened this issue Dec 12, 2018 · 5 comments
Closed

Comments

@hzr1140521792
Copy link

When I change the nodeNum in the code,I get nothing but this
image
My environment is :Ubuntu 16.04 and Python3
Thanks very much

@pgawlowicz
Copy link
Contributor

Hi,

The dqn-agent-v1.py is not generic and will work only with 5 nodes. If you change the node number to 6, then the action vector should contain 6 values , but in a current version, it still sends a vector with 5 elements.

You can simply extend it to more nodes or make it more generic - i.e. independent of the number of nodes.

The linear-mesh ns3 simulation script is generic. To test it please play with no_op2.py that is independent of number of nodes, i.e. you can change it easily.

Best,
Piotr

@hzr1140521792
Copy link
Author

I got it,thank you very much.

@hzr1140521792
Copy link
Author

hzr1140521792 commented Dec 13, 2018

But I hava another question.Did you write all of your param of environment in the file sim.cc,but how
can you use it with python,these code are written with C++?

@pgawlowicz
Copy link
Contributor

pgawlowicz commented Dec 13, 2018

This part of the code allows you to pass command line arguments to the ns-3 process, that will be started by ns3gym. Of course those command line parameters have to be parsed correctly in ns3 simulation script, here called sim.cc:

simArgs = {"--simTime": simTime,
       "--testArg": 123,
       "--nodeNum": 5,
       "--distance": 500}

env = ns3env.Ns3Env(port=port, stepTime=stepTime, startSim=startSim, simSeed=seed, simArgs=simArgs, debug=debug)

@hzr1140521792
Copy link
Author

OK,I got it.Thank you very much.

Okabe-Junya referenced this issue in Okabe-Junya/ns3-gym Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants