feat: NeuralBot — ONNX模型驱动的Bot + 混合Bot训练架构

NeuralBot.cs:
- 加载ONNX模型,状态编码与Python trainer完全一致(13rank×4suit×7ch=364)
- ε-greedy探索(10%) + ONNX推理选Q值最高动作
- 多牌候选: 对子/三带二(优先带对子)/顺子/炸弹

PdkGameMain:
- BotTypes静态配置: ["NEURAL","NEURAL","ISMCTS"] = 2模型+1ISMCTS
- --mix参数: dotnet run -- --mix 100

hjha-console:
- --mix参数自动设置BotTypes并转调--stress

验证: 3局0错误, 1.3s/局, NeuralBot出牌正常
This commit is contained in:
2026-07-13 02:20:44 +08:00
parent 68e8c038f4
commit 89743cd511
16 changed files with 621 additions and 101 deletions

View File

@ -56,12 +56,22 @@ namespace PdkFriendServer.Logic
this.GamePack = new PdkGamePack();
}
/// <summary>懒初始化3个botBotMode==true时首次WaitWanJiaShuRu调用</summary>
private void InitBots()
/// <summary>懒初始化3个botBotMode==true时首次WaitWanJiaShuRu调用
/// BotTypes: "ISMCTS" / "NEURAL" / null=默认ISMCTS
/// 训练模式: ["NEURAL","NEURAL","ISMCTS"] = 2个模型bot + 1个ISMCTS</summary>
public static string[] BotTypes = null;
private void InitBots()
{
_bots = new IPdkBot[3];
for (int i = 0; i < 3; i++)
_bots[i] = new IsmctsBot();
{
string type = BotTypes != null && BotTypes.Length > i ? BotTypes[i] : null;
if (type == "NEURAL")
_bots[i] = new NeuralBot("model.onnx", 0.1f);
else
_bots[i] = new IsmctsBot();
}
}
/// <summary>构建当前玩家的可见视图——只看自己手牌+公开信息</summary>