Comments (5)
Hi,
Thanks for the comments. I am working hard to make the code robust :) and also on the documentation.
In order to run rl-tcp example, you have to execute:
In terminal 1:
./waf --run "rl-tcp"
It will start ns3 simulation process, that waits for the Python process to connect and talk with over ns3gym interface.
In terminal 2:
cd ./scratch/rl-tcp/
./test_tcp.py
It will start Gym agent that has TCP NewReno implemented in Python over ns3gym.
You can also start all in single terminal using single command:
cd ./scratch/rl-tcp/
./test_tcp.py --start=1
Note, that it gives the same number of transmitted packets as the one implemented in ns3! Please exacute the following command to cross-check:
./waf --run "rl-tcp --transport_prot=TcpNewReno"
Regarding the second issue, please make sure to kill all ns3 simulation processes that run and use the same port for communication. If your Gym agent (python) connects to the already running ns3 simulation you get the mentioned error. I will provide some check to prevent from doing that.
Let me know if the above works.
Best,
Piotr
from ns3-gym.
echo to @mkheirkhah, I have the same issue running the test_tcp.py with “Waiting for simulation script to connect” and wait around 20 min as kinda a stack.
Besides, when I ran the test.py in the ./rl-tcp/, I got a different error message as
~/ns3-gym/scratch/rl-tcp$ ./test.pyWaiting for simulation script to connect
Traceback (most recent call last):
File "./test.py", line 41, in <module>
print("Observation space: ", ob_space, ob_space.dtype)
AttributeError: 'NoneType' object has no attribute 'dtype'
I am using Ubuntu16.4 with python3.6 over a pyenv instance.
Also, many thanks to this essential work for the network community!
from ns3-gym.
Thanks! It seems running ok.
from ns3-gym.
Thanks, @pgawlowicz I switched the simulated port to 5556 in the test_tcp.py. line 27
port = 5556
Now it works without the mentioned errors.
from ns3-gym.
@huckiyang I have also added some checks today, that prevents from starting Python gym agent on the already used port. Also if you use port 0, it will find and take a free port.
I am waiting for more comments and feedback about your experience :)
from ns3-gym.
Related Issues (20)
- nvm
- the code got stuck running simple_test.py
- sum reward is 0 HOT 1
- Porting to ns 3.36 HOT 9
- Multiple agents working asynchronously to do a task HOT 1
- Cmake compilation issues ns3 HOT 1
- Updating port to ns-3.36.1 HOT 3
- Errors during ./ns3 build procedure HOT 1
- Random Early Detection
- Run the code
- Installation Error HOT 3
- protobuf messages are not generated during build configuration HOT 13
- using gdb to debug ns3-script in a separate shell results into the script restarting HOT 1
- protobuf messages are generated but could not be found during build configuration HOT 1
- Using ns3gym in Sable-Baseline3's Vevtorized Environment HOT 1
- some problem in run cognitive-agent-v1.py HOT 2
- Missing header messages.pb.h for opengym HOT 2
- GNU version still not meets requirement after updating gcc/g++
- ./ns3 configure -d release --enable-examples --enable-tests HOT 2
- ubuntu2210
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ns3-gym.