-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script to run training and evaluation of all agents in CCOD exa…
…mple
- Loading branch information
Showing
6 changed files
with
70 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
* | ||
!.gitignore | ||
!combine_basic_results.sh | ||
!combine_csv_files.sh | ||
!preprocess_basic_results.py | ||
!preprocess_csma_results.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
#!/usr/bin/scl enable devtoolset-11 rh-python38 -- /bin/bash -l | ||
#!/bin/bash | ||
|
||
if [[ $# -ne 3 ]]; then | ||
echo "Usage: $0 <scenario> <nWifi> <seed>" | ||
exit 1 | ||
fi | ||
|
||
NS3_DIR="${NS3_DIR:=$HOME/ns-3.37}" | ||
RLIB_DIR="${RLIB_DIR:=$HOME/reinforced-lib/examples/ns-3-ccod}" | ||
|
||
cd "$NS3_DIR/build/scratch" | ||
|
||
SIM_TIME=60 | ||
SCENARIO="convergence" | ||
N_WIFI=55 | ||
SCENARIO=$1 | ||
N_WIFI=$2 | ||
SEED=$3 | ||
|
||
NUM_REPS=10 | ||
SEED=300 | ||
|
||
for (( i = 1; i <= NUM_REPS; i += 1)); do | ||
CSV_PATH="$RLIB_DIR/outputs/CSMA_${SCENARIO}_${N_WIFI}_run${i}.csv" | ||
echo "Testing CSMA/CA ${SCENARIO} ${N_WIFI} simulation [${i}/${NUM_REPS}]" | ||
./ns3.37-ccod-sim-optimized --csvPath="$CSV_PATH" --agentType="discrete" --dryRun="true" --envStepTime="0.01" --historyLength="300" --nonZeroStart="true" --nWifi="$N_WIFI" --scenario="$SCENARIO" --simTime="$SIM_TIME" --RngRun="$SEED" | ||
./ns3.37-ccod-sim-optimized --csvPath="$CSV_PATH" --agentType="discrete" --dryRun="true" --envStepTime="0.01" --historyLength="300" --nonZeroStart="true" --nWifi="$N_WIFI" --scenario="$SCENARIO" --simTime="60.0" --RngRun="$SEED" | ||
|
||
SEED=$(( SEED + 1 )) | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
TOOLS_DIR="${TOOLS_DIR:=$HOME/reinforced-lib/examples/ns-3-ccod/tools}" | ||
cd "TOOLS_DIR/slurm" | ||
|
||
for agent in "CSMA" "DDPG" "DDQN"; do | ||
for nWifi in 5 15 30 50; do | ||
if [[ $agent == "CSMA" ]]; then | ||
./baseline.sh "basic" $nWifi 300 | ||
else | ||
./train.sh $agent "basic" $nWifi 200 | ||
./test.sh $agent "basic" $nWifi 300 | ||
fi | ||
done | ||
|
||
if [[ $agent == "CSMA" ]]; then | ||
./baseline.sh "convergence" 55 400 | ||
else | ||
./train.sh $agent "convergence" 55 200 | ||
./test.sh $agent "convergence" 55 400 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters