Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
ns3-gym - The Playground for Reinforcement Learning in Networking Research
| Date | Stars |
|---|---|
| 2026-07-31 | 690 |
| 2026-08-01 | 690 |
| 2026-08-02 | 690 |
| 2026-08-06 | 690 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
ns3-gym
============
[OpenAI Gym](https://gym.openai.com/) is a toolkit for reinforcement learning (RL) widely used in research. The network simulator [ns-3](https://www.nsnam.org/) is the de-facto standard for academic and industry studies in the areas of networking protocols and communication technologies. ns3-gym is a framework that integrates both OpenAI Gym and ns-3 in order to encourage usage of RL in networking research.
Installation
============
We recommend using Linux (e.g. Ubuntu 22 or higher).
1. Install all dependencies required by ns-3.
```
# minimal requirements for C++:
apt-get install gcc g++ python3 python3-pip cmake
```
Check [ns-3 requirements](https://www.nsnam.org/docs/tutorial/html/getting-started.html#prerequisites/)
2. Install ZMQ, Protocol Buffers and pkg-config libs:
```
sudo apt-get update
apt-get install libzmq5 libzmq3-dev
apt-get install libprotobuf-dev
apt-get install protobuf-compiler
apt-get install pkg-config
```
3. Download and install ns3
```
wget https://www.nsnam.org/releases/ns-allinone-3.40.tar.bz2
tar xf ns-allinone-3.40.tar.bz2
cd ns-allinone-3.40
```
4. Clone ns3-gym repository into `contrib` directory and change the branch:
```
cd ./ns-3.40/contrib
git clone https://github.com/tkn-tub/ns3-gym.git ./opengym
cd opengym/
git checkout app-ns-3.36+
```
Check [working with cmake](https://www.nsnam.org/docs/manual/html/working-with-cmake.html)
It is important to use the `opengym` as the name of the ns3-gym app directory.
5. Configure and build ns-3 project:
```
cd ../../
./ns3 configure --enable-examples
./ns3 build
```
Note: Opengym Protocol Buffer messages (C++ and Python) are build during configure.
6. Install ns3gym located in model/ns3gym (Python3 required)
```
cd ./contrib/opengym/
```
```
pip3 install --user ./model/ns3gym
```
or
```
python3 -m venv ns3gym-venv
source ./ns3gym-venv/bin/activate
pip3 install ./model/ns3gym
```
7. (Optional) Install all libraries required by your agent (like tensorflow, keras, etc.).
8. Run example:
```
cd ./contrib/opengym/examples/opengym/
./simple_test.py
```
9. (Optional) Start ns-3 simulation script and Gym agent separately in two terminals (useful for debugging):
```
# Terminal 1
./ns3 run "opengym"
# Terminal 2
cd ./contrib/opengym/examples/opengym/
./test.py --start=0
```
Examples
========
All examples can be found [here](./examples/).
## Basic Interface
1. Example Python script. Note, that `gym.make('ns3-v0')` starts ns-3 simulation script located in current working directory.
```
import gym
import ns3gym
import MyAgent
from ns3gym import ns3env
#env = gym.make('ns3-v0') <--- causes some errors with the new OpenAI Gym framework, please use ns3env.Ns3Env()
env = ns3env.Ns3Env()
obs = env.reset()
agent = MyAgent.Agent()
while True:
action = agent.get_action(obs)
obs, reward, done, info = env.step(action)
if done:
break
env.close()
```
2. Any ns-3 simulation script can be used as a Gym environment. This requires only to instantiate OpenGymInterface and implement the ns3-gym C++ interface consisting of the following functions:
```
Ptr<OpenGymSpace> GetObservationSpace();
Ptr<OpenGymSpace> GetActionSpace();
Ptr<OpenGymDataContainer> GetObservation();
float GetReward();
bool GetGameOver();
std::string GetExtraInfo();
bool ExecuteActions(Ptr<OpenGymDataContainer> action);
```
Note, that the generic ns3-gym interface allows to observe any variable or parameter in a simulation.
A more detailed description can be found in our [Paper](http://www.tkn.tu-berlin.de/fileadmin/fg112/Papers/2019/gawlowicz19_mswim.pdf).
## Cognitive Radio
We consider the problem of radio channel selection in a wireless multi-channel environment, e.g. 802.11 networks with external interference. The objective of the agent is to select for the next time slot a channel free of interference. We consider a simple illustrative example where the external interference follows a periodic pattern, i.e. sweeping over all channels one to four in the sExcerpt of 7,646 characters
Read on GitHub174
10
4
4
1
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:0f3c56d802287940, topic:reinforcement-learning, topic:openai-gym, desc:reinforcement learning