chore: standardize internal bot dir structure (src/, tests/, out/)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,2 @@
|
||||
switch("path", "../src")
|
||||
switch("path", "../../common_libs/tankroyale_botapi")
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import arraymancer
|
||||
import std/math
|
||||
import "../actions"
|
||||
import PPO_Bot/actions
|
||||
|
||||
template check(cond: bool, msg: string) =
|
||||
if not cond:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,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.
Reference in New Issue
Block a user