diff --git a/GotoTest_garage/GotoTest.nimble b/GotoTest_garage/GotoTest.nimble index ef52289..60e348e 100644 --- a/GotoTest_garage/GotoTest.nimble +++ b/GotoTest_garage/GotoTest.nimble @@ -3,6 +3,7 @@ version = "0.1.0" author = "Davide Cappellini" description = "GotoTest — throwaway goto(x,y) controller prototype" license = "MIT" +srcDir = "src" bin = @["GotoTest"] # Dependencies diff --git a/GotoTest_garage/out/.gitkeep b/GotoTest_garage/out/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/GotoTest_garage/GotoTest.json b/GotoTest_garage/src/GotoTest.json similarity index 100% rename from GotoTest_garage/GotoTest.json rename to GotoTest_garage/src/GotoTest.json diff --git a/GotoTest_garage/GotoTest.nim b/GotoTest_garage/src/GotoTest.nim similarity index 100% rename from GotoTest_garage/GotoTest.nim rename to GotoTest_garage/src/GotoTest.nim diff --git a/GotoTest_garage/src/GotoTest/.gitkeep b/GotoTest_garage/src/GotoTest/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/GotoTest_garage/tests/.gitkeep b/GotoTest_garage/tests/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/OscillatorBot_garage/out/.gitkeep b/OscillatorBot_garage/out/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/OscillatorBot_garage/OscillatorBot.json b/OscillatorBot_garage/src/OscillatorBot.json similarity index 100% rename from OscillatorBot_garage/OscillatorBot.json rename to OscillatorBot_garage/src/OscillatorBot.json diff --git a/OscillatorBot_garage/OscillatorBot.nim b/OscillatorBot_garage/src/OscillatorBot.nim similarity index 100% rename from OscillatorBot_garage/OscillatorBot.nim rename to OscillatorBot_garage/src/OscillatorBot.nim diff --git a/OscillatorBot_garage/src/OscillatorBot/.gitkeep b/OscillatorBot_garage/src/OscillatorBot/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/OscillatorBot_garage/tests/.gitkeep b/OscillatorBot_garage/tests/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/PPO_Bot_garage/PPO_Bot.nimble b/PPO_Bot_garage/PPO_Bot.nimble index e35363c..5ecbc2c 100644 --- a/PPO_Bot_garage/PPO_Bot.nimble +++ b/PPO_Bot_garage/PPO_Bot.nimble @@ -3,6 +3,7 @@ version = "0.1.0" author = "Davide Cappellini" description = "PPO-trained Tank Royale bot" license = "MIT" +srcDir = "src" bin = @["PPO_Bot"] # Dependencies diff --git a/PPO_Bot_garage/config.nims b/PPO_Bot_garage/config.nims index eaa9253..c603e18 100644 --- a/PPO_Bot_garage/config.nims +++ b/PPO_Bot_garage/config.nims @@ -3,6 +3,7 @@ switch("passL", "-L/nix/store/v07svn2y92bvzjl51aj7c9ca1cwg7rw7-openblas-0.3.32/lib -lopenblas") switch("threads", "on") switch("outdir", "out") +switch("path", thisDir() & "/src") # begin Nimble config (version 2) when withDir(thisDir(), system.fileExists("nimble.paths")): include "nimble.paths" diff --git a/PPO_Bot_garage/out/.gitkeep b/PPO_Bot_garage/out/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/PPO_Bot_garage/PPO_Bot.json b/PPO_Bot_garage/src/PPO_Bot.json similarity index 100% rename from PPO_Bot_garage/PPO_Bot.json rename to PPO_Bot_garage/src/PPO_Bot.json diff --git a/PPO_Bot_garage/PPO_Bot.nim b/PPO_Bot_garage/src/PPO_Bot.nim similarity index 98% rename from PPO_Bot_garage/PPO_Bot.nim rename to PPO_Bot_garage/src/PPO_Bot.nim index efb0a54..42cd362 100644 --- a/PPO_Bot_garage/PPO_Bot.nim +++ b/PPO_Bot_garage/src/PPO_Bot.nim @@ -4,12 +4,12 @@ import std/[os, strformat, strutils, math, times, algorithm] import arraymancer import tankroyale_botapi -import network -import actions -import training -import weights -import ./enemy_tracker -import ./state_vector +import PPO_Bot/network +import PPO_Bot/actions +import PPO_Bot/training +import PPO_Bot/weights +import PPO_Bot/enemy_tracker +import PPO_Bot/state_vector # ── Hyperparameters from env vars (PPOB_ prefix) ───────────────────────────── # All optional; defaults match ppoUpdate signature in training.nim. @@ -64,7 +64,7 @@ proc hyperparmSnapshot(): string = &"\"logStdFloor\":{logStdFloor},\"logStdCeiling\":{logStdCeiling},\"initialLogStd\":{initialLogStd}" const botJsonPath = currentSourcePath().parentDir / "PPO_Bot.json" -const weightsRoot = currentSourcePath().parentDir / "weights" +const weightsRoot = currentSourcePath().parentDir / "../weights" type InFlightBullet = object diff --git a/PPO_Bot_garage/actions.nim b/PPO_Bot_garage/src/PPO_Bot/actions.nim similarity index 100% rename from PPO_Bot_garage/actions.nim rename to PPO_Bot_garage/src/PPO_Bot/actions.nim diff --git a/PPO_Bot_garage/controllers.nim b/PPO_Bot_garage/src/PPO_Bot/controllers.nim similarity index 100% rename from PPO_Bot_garage/controllers.nim rename to PPO_Bot_garage/src/PPO_Bot/controllers.nim diff --git a/PPO_Bot_garage/enemy_tracker.nim b/PPO_Bot_garage/src/PPO_Bot/enemy_tracker.nim similarity index 100% rename from PPO_Bot_garage/enemy_tracker.nim rename to PPO_Bot_garage/src/PPO_Bot/enemy_tracker.nim diff --git a/PPO_Bot_garage/network.nim b/PPO_Bot_garage/src/PPO_Bot/network.nim similarity index 100% rename from PPO_Bot_garage/network.nim rename to PPO_Bot_garage/src/PPO_Bot/network.nim diff --git a/PPO_Bot_garage/state_vector.nim b/PPO_Bot_garage/src/PPO_Bot/state_vector.nim similarity index 100% rename from PPO_Bot_garage/state_vector.nim rename to PPO_Bot_garage/src/PPO_Bot/state_vector.nim diff --git a/PPO_Bot_garage/training.nim b/PPO_Bot_garage/src/PPO_Bot/training.nim similarity index 100% rename from PPO_Bot_garage/training.nim rename to PPO_Bot_garage/src/PPO_Bot/training.nim diff --git a/PPO_Bot_garage/weights.nim b/PPO_Bot_garage/src/PPO_Bot/weights.nim similarity index 100% rename from PPO_Bot_garage/weights.nim rename to PPO_Bot_garage/src/PPO_Bot/weights.nim diff --git a/PPO_Bot_garage/tests/config.nims b/PPO_Bot_garage/tests/config.nims new file mode 100644 index 0000000..dda7217 --- /dev/null +++ b/PPO_Bot_garage/tests/config.nims @@ -0,0 +1,2 @@ +switch("path", "../src") +switch("path", "../../common_libs/tankroyale_botapi") diff --git a/PPO_Bot_garage/tests/diag_ppo_fullbuffer.nim b/PPO_Bot_garage/tests/diag_ppo_fullbuffer.nim index dcddb1d..8f61c6a 100644 --- a/PPO_Bot_garage/tests/diag_ppo_fullbuffer.nim +++ b/PPO_Bot_garage/tests/diag_ppo_fullbuffer.nim @@ -4,8 +4,8 @@ import std/[math, random] import arraymancer -import "../network" -import "../training" +import PPO_Bot/network +import PPO_Bot/training var ac = initActorCritic() var adam: ACAdamStates # uninitialised → ppoUpdate must reinit (fresh-process path) diff --git a/PPO_Bot_garage/tests/diag_savecheckpoint.nim b/PPO_Bot_garage/tests/diag_savecheckpoint.nim index 9fcce98..c47a684 100644 --- a/PPO_Bot_garage/tests/diag_savecheckpoint.nim +++ b/PPO_Bot_garage/tests/diag_savecheckpoint.nim @@ -4,9 +4,9 @@ import std/[os] import arraymancer -import "../network" -import "../training" -import "../weights" +import PPO_Bot/network +import PPO_Bot/training +import PPO_Bot/weights const weightsRoot = currentSourcePath().parentDir.parentDir / "weights" diff --git a/PPO_Bot_garage/tests/test_actions.nim b/PPO_Bot_garage/tests/test_actions.nim index f7695d0..96cffd0 100644 --- a/PPO_Bot_garage/tests/test_actions.nim +++ b/PPO_Bot_garage/tests/test_actions.nim @@ -3,7 +3,7 @@ import arraymancer import std/math -import "../actions" +import PPO_Bot/actions template check(cond: bool, msg: string) = if not cond: diff --git a/PPO_Bot_garage/tests/test_controllers.nim b/PPO_Bot_garage/tests/test_controllers.nim index adaaaf0..25f6b82 100644 --- a/PPO_Bot_garage/tests/test_controllers.nim +++ b/PPO_Bot_garage/tests/test_controllers.nim @@ -2,7 +2,7 @@ ## Run: nim c -r tests/test_controllers.nim import std/math -import "../controllers" +import PPO_Bot/controllers template check(cond: bool, msg: string) = if not cond: diff --git a/PPO_Bot_garage/tests/test_network.nim b/PPO_Bot_garage/tests/test_network.nim index 5aaed99..c3d184d 100644 --- a/PPO_Bot_garage/tests/test_network.nim +++ b/PPO_Bot_garage/tests/test_network.nim @@ -3,8 +3,8 @@ import arraymancer import std/[math, strformat] -import ../network -import ../actions +import PPO_Bot/network +import PPO_Bot/actions func isFiniteF(x: float32): bool = classify(x) notin {fcNan, fcInf, fcNegInf} func isNaNF(x: float32): bool = classify(x) == fcNan diff --git a/PPO_Bot_garage/tests/test_radar_lock.nim b/PPO_Bot_garage/tests/test_radar_lock.nim index 75a6744..821e240 100644 --- a/PPO_Bot_garage/tests/test_radar_lock.nim +++ b/PPO_Bot_garage/tests/test_radar_lock.nim @@ -2,7 +2,7 @@ ## Run: nim c -r tests/test_radar_lock.nim import std/[math, strformat] -import "../enemy_tracker" +import PPO_Bot/enemy_tracker template check(cond: bool, msg: string) = if not cond: diff --git a/PPO_Bot_garage/tests/test_state.nim b/PPO_Bot_garage/tests/test_state.nim index cf538dd..82c2f45 100644 --- a/PPO_Bot_garage/tests/test_state.nim +++ b/PPO_Bot_garage/tests/test_state.nim @@ -5,8 +5,8 @@ import std/[math, strformat] import arraymancer # Import from parent dir -import "../enemy_tracker" -import "../state_vector" +import PPO_Bot/enemy_tracker +import PPO_Bot/state_vector template check(cond: bool, msg: string) = if not cond: diff --git a/PPO_Bot_garage/tests/test_training.nim b/PPO_Bot_garage/tests/test_training.nim index 1ff470d..de537e8 100644 --- a/PPO_Bot_garage/tests/test_training.nim +++ b/PPO_Bot_garage/tests/test_training.nim @@ -3,8 +3,8 @@ import std/[math, random] import arraymancer -import "../network" -import "../training" +import PPO_Bot/network +import PPO_Bot/training template check(cond: bool, msg: string) = if not cond: diff --git a/PPO_Bot_garage/tests/test_weights.nim b/PPO_Bot_garage/tests/test_weights.nim index b2143dc..73654ed 100644 --- a/PPO_Bot_garage/tests/test_weights.nim +++ b/PPO_Bot_garage/tests/test_weights.nim @@ -3,9 +3,9 @@ import std/[os, math] import arraymancer -import "../network" -import "../training" -import "../weights" +import PPO_Bot/network +import PPO_Bot/training +import PPO_Bot/weights template check(cond: bool, msg: string) = if not cond: diff --git a/PPO_Bot_garage/training b/PPO_Bot_garage/training deleted file mode 100755 index df1ef13..0000000 Binary files a/PPO_Bot_garage/training and /dev/null differ diff --git a/QBot_garage/QBot.nimble b/QBot_garage/QBot.nimble index e8bf9a9..0c1bd0e 100644 --- a/QBot_garage/QBot.nimble +++ b/QBot_garage/QBot.nimble @@ -3,6 +3,7 @@ version = "0.1.0" author = "Davide Cappellini" description = "Tabular Q-learning Tank Royale bot — chained action decomposition prototype" license = "MIT" +srcDir = "src" bin = @["QBot"] # Dependencies diff --git a/QBot_garage/config.nims b/QBot_garage/config.nims index d450296..45db712 100644 --- a/QBot_garage/config.nims +++ b/QBot_garage/config.nims @@ -1,2 +1,3 @@ --path:"../common_libs" switch("outdir", "out") +switch("path", thisDir() & "/src") diff --git a/QBot_garage/out/.gitkeep b/QBot_garage/out/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/QBot_garage/QBot.json b/QBot_garage/src/QBot.json similarity index 100% rename from QBot_garage/QBot.json rename to QBot_garage/src/QBot.json diff --git a/QBot_garage/QBot.nim b/QBot_garage/src/QBot.nim similarity index 99% rename from QBot_garage/QBot.nim rename to QBot_garage/src/QBot.nim index adb65cb..55d57f0 100644 --- a/QBot_garage/QBot.nim +++ b/QBot_garage/src/QBot.nim @@ -15,8 +15,8 @@ import radar_lock/radar_lock as radar_lock # ── Constants ────────────────────────────────────────────────────────────────── -const botJsonPath = currentSourcePath().parentDir / "QBot.json" -const qtablesDir = currentSourcePath().parentDir / "qtables" +const botJsonPath = currentSourcePath().parentDir / "../QBot.json" +const qtablesDir = currentSourcePath().parentDir / "../qtables" const # State features diff --git a/QBot_garage/src/QBot/.gitkeep b/QBot_garage/src/QBot/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/QBot_garage/tests/.gitkeep b/QBot_garage/tests/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/SAC_LSTM_Bot_garage/out/.gitkeep b/SAC_LSTM_Bot_garage/out/.gitkeep new file mode 100644 index 0000000..e69de29