diff --git a/README.md b/README.md index 7ec2b12..117c95f 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,12 @@ pip install reinforced-lib ``` To have easy access to the [example files](https://github.com/m-wojnar/reinforced-lib/tree/main/examples) -you can clone the source code from our repository, and than install it locally with pip: +you can clone the source code from our repository, and then install it locally with pip: ```bash git clone git@github.com:m-wojnar/reinforced-lib.git cd reinforced-lib -pip install . +pip install -e . ``` In the spirit of making Reinforced-lib a lightweight solution, we include only the necessary dependencies in the base diff --git a/examples/ns-3-ccod/main.py b/examples/ns-3-ccod/main.py index 8b426e4..f078284 100644 --- a/examples/ns-3-ccod/main.py +++ b/examples/ns-3-ccod/main.py @@ -184,7 +184,7 @@ def run( else: rl = RLib.load(rlib_args['load_path']) - exp = Experiment(mempool_key, memory_size, simulation, ns3_path, debug=False) + exp = Experiment(mempool_key, memory_size, simulation, ns3_path, using_waf=False) var = Ns3AIRL(memblock_key, Env, Act) try: diff --git a/examples/ns-3-ccod/scratch/ccod-sim.cc b/examples/ns-3-ccod/scratch/ccod-sim.cc index 51e8af7..db91f17 100644 --- a/examples/ns-3-ccod/scratch/ccod-sim.cc +++ b/examples/ns-3-ccod/scratch/ccod-sim.cc @@ -535,6 +535,8 @@ main (int argc, char *argv[]) } Simulator::Destroy(); + m_env->SetFinish (); + cout << "Packets registered by handler: " << g_rxPktNum << " Packets" << endl; return 0; diff --git a/examples/ns-3-ra/contrib/rlib-wifi-manager/model/rlib-wifi-manager.cc b/examples/ns-3-ra/contrib/rlib-wifi-manager/model/rlib-wifi-manager.cc index f465949..246ac68 100644 --- a/examples/ns-3-ra/contrib/rlib-wifi-manager/model/rlib-wifi-manager.cc +++ b/examples/ns-3-ra/contrib/rlib-wifi-manager/model/rlib-wifi-manager.cc @@ -1,14 +1,11 @@ #include "ns3/string.h" #include "ns3/double.h" #include "ns3/log.h" -#include "rlib-wifi-manager.h" +#include "ns3/rlib-wifi-manager.h" #include "ns3/wifi-phy.h" #include "ns3/wifi-tx-vector.h" #include "ns3/wifi-utils.h" -#define Min(a,b) ((a < b) ? a : b) -#define DEFAULT_MEMBLOCK_KEY 2333 - namespace ns3 { NS_LOG_COMPONENT_DEFINE ("RLibWifiManager"); @@ -50,8 +47,6 @@ RLibWifiManager::RLibWifiManager () { NS_LOG_FUNCTION (this); - // Setup ns3-ai Env - m_env = new Ns3AIRL (DEFAULT_MEMBLOCK_KEY); m_env->SetCond (2, 0); } diff --git a/examples/ns-3-ra/contrib/rlib-wifi-manager/model/rlib-wifi-manager.h b/examples/ns-3-ra/contrib/rlib-wifi-manager/model/rlib-wifi-manager.h index e8217ca..aecd1c9 100644 --- a/examples/ns-3-ra/contrib/rlib-wifi-manager/model/rlib-wifi-manager.h +++ b/examples/ns-3-ra/contrib/rlib-wifi-manager/model/rlib-wifi-manager.h @@ -4,6 +4,8 @@ #include "ns3/wifi-remote-station-manager.h" #include "ns3/ns3-ai-module.h" +#define DEFAULT_MEMBLOCK_KEY 2333 + namespace ns3 { // ns3-ai structures @@ -25,6 +27,8 @@ struct sAct uint8_t mcs; } Packed; +Ns3AIRL * m_env = new Ns3AIRL (DEFAULT_MEMBLOCK_KEY); + // Structure holding additional information required by the RLibWifiManager struct RLibWifiRemoteStation : public WifiRemoteStation { @@ -64,8 +68,6 @@ class RLibWifiManager : public WifiRemoteStationManager uint32_t m_nWifi; uint32_t m_nss; double m_power; - - Ns3AIRL * m_env; }; } diff --git a/examples/ns-3-ra/main.py b/examples/ns-3-ra/main.py index b9433f4..2d9f42b 100644 --- a/examples/ns-3-ra/main.py +++ b/examples/ns-3-ra/main.py @@ -76,7 +76,7 @@ def run( ext_type=IEEE_802_11_ax_RA ) - exp = Experiment(mempool_key, memory_size, simulation, ns3_path) + exp = Experiment(mempool_key, memory_size, simulation, ns3_path, using_waf=False) var = Ns3AIRL(memblock_key, Env, Act) try: diff --git a/examples/ns-3-ra/scratch/ra-sim.cc b/examples/ns-3-ra/scratch/ra-sim.cc index 337420a..ec7bda7 100644 --- a/examples/ns-3-ra/scratch/ra-sim.cc +++ b/examples/ns-3-ra/scratch/ra-sim.cc @@ -13,6 +13,7 @@ #include "ns3/ssid.h" #include "ns3/wifi-net-device.h" #include "ns3/yans-wifi-helper.h" +#include "ns3/rlib-wifi-manager.h" using namespace ns3; @@ -412,6 +413,7 @@ main (int argc, char *argv[]) //Clean-up Simulator::Destroy (); + m_env->SetFinish (); return 0; } diff --git a/examples/ns-3-ra/tools/slurm/build.sh b/examples/ns-3-ra/tools/slurm/build.sh index 4fb5414..98fa997 100644 --- a/examples/ns-3-ra/tools/slurm/build.sh +++ b/examples/ns-3-ra/tools/slurm/build.sh @@ -3,5 +3,5 @@ NS3_DIR="${NS3_DIR:=$HOME/ns-3.37}" cd $NS3_DIR -./ns3 configure -d optimized --disable-python -./ns3 +./ns3 configure --build-profile=optimized --disable-examples --disable-tests +./ns3 build