Giter Site home page Giter Site logo

Comments (5)

pgawlowicz avatar pgawlowicz commented on June 4, 2024 2

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.

huckiyang avatar huckiyang commented on June 4, 2024

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.

mkheirkhah avatar mkheirkhah commented on June 4, 2024

Thanks! It seems running ok.

from ns3-gym.

huckiyang avatar huckiyang commented on June 4, 2024

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.

pgawlowicz avatar pgawlowicz commented on June 4, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.