chore: standardize internal bot dir structure (src/, tests/, out/)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-08-27 18:42:03 +02:00
parent c5115fdf61
commit 259e67d7ff
42 changed files with 33 additions and 26 deletions
+1
View File
@@ -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
View File
View File
View File
View File
+1
View File
@@ -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
+1
View File
@@ -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"
View File
@@ -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
+2
View File
@@ -0,0 +1,2 @@
switch("path", "../src")
switch("path", "../../common_libs/tankroyale_botapi")
+2 -2
View File
@@ -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)
+3 -3
View File
@@ -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"
+1 -1
View File
@@ -3,7 +3,7 @@
import arraymancer
import std/math
import "../actions"
import PPO_Bot/actions
template check(cond: bool, msg: string) =
if not cond:
+1 -1
View File
@@ -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:
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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:
+2 -2
View File
@@ -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:
+2 -2
View File
@@ -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:
+3 -3
View File
@@ -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:
Binary file not shown.
+1
View File
@@ -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
+1
View File
@@ -1,2 +1,3 @@
--path:"../common_libs"
switch("outdir", "out")
switch("path", thisDir() & "/src")
View File
@@ -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
View File
View File
View File