|
|
@@ -7,26 +7,15 @@ |
|
|
- Windows:先查看`.\win\CAPI\cpp\`文件夹下是否有`lib`文件夹,没有则https://cloud.tsinghua.edu.cn/d/6972138f641d4e81a446/ 下载并复制粘贴 |
|
|
- Windows:先查看`.\win\CAPI\cpp\`文件夹下是否有`lib`文件夹,没有则https://cloud.tsinghua.edu.cn/d/6972138f641d4e81a446/ 下载并复制粘贴 |
|
|
- Linux:首先自行安装`gRPC`,具体方法可以参考官方教程https://grpc.io/docs/languages/cpp/quickstart/。 |
|
|
- Linux:首先自行安装`gRPC`,具体方法可以参考官方教程https://grpc.io/docs/languages/cpp/quickstart/。 |
|
|
- 然后在`CAPI\cpp\API\src\AI.cpp`中编写代码 |
|
|
- 然后在`CAPI\cpp\API\src\AI.cpp`中编写代码 |
|
|
- 应当编译2次以上,以生成不同的API.exe, |
|
|
|
|
|
- 为了编译不同PlayerID的代码,我们可以 |
|
|
|
|
|
- 复制若干次AI.cpp |
|
|
|
|
|
- 利用constexpr |
|
|
|
|
|
 |
|
|
|
|
|
- 对于图中写法,编译前记得更改playerId |
|
|
|
|
|
- 也可以利用#if、#endif |
|
|
|
|
|
- Windows:然后用Visual Studio打开`CAPI\cpp\CAPI.sln`编译,注意使用Debug模式 |
|
|
- Windows:然后用Visual Studio打开`CAPI\cpp\CAPI.sln`编译,注意使用Debug模式 |
|
|
- Linux:用`cmake`,对`CAPI\cpp\CMakeLists.txt`进行编译 |
|
|
- Linux:用`cmake`,对`CAPI\cpp\CMakeLists.txt`进行编译 |
|
|
- 每次编译后都在\THUAI6-毕业吧少女\win\CAPI\cpp\x64\Debug中将API.exe重命名并在`RunCpp.cmd`中对应修改地址参数,Linux环境类似 |
|
|
|
|
|
 |
|
|
|
|
|
- Windows:最后使用`RunCpp.cmd`执行比赛代码 |
|
|
- Windows:最后使用`RunCpp.cmd`执行比赛代码 |
|
|
- Linux:最后使用`RunCpp.sh`执行比赛代码 |
|
|
- Linux:最后使用`RunCpp.sh`执行比赛代码 |
|
|
|
|
|
|
|
|
## Python接口使用说明 |
|
|
## Python接口使用说明 |
|
|
|
|
|
|
|
|
- 首先在Python环境下运行`GeneratePythonProto.cmd`,以安装必要的包、并生成对应的grpc python文件 |
|
|
- 首先在Python环境下运行`GeneratePythonProto.cmd`,以安装必要的包、并生成对应的grpc python文件 |
|
|
- 复制若干个`CAPI\python\PyAPI`文件夹 |
|
|
|
|
|
- 然后在`CAPI\python\PyAPI0\AI.py`、`CAPI\python\PyAPI1\AI.py`等中编写对应代码并在`RunPython.cmd`中对应修改地址参数,Linux环境类似 |
|
|
|
|
|
 |
|
|
|
|
|
|
|
|
- 然后在`CAPI\python\PyAPI\AI.py`中编写代码 |
|
|
- Windows:最后通过运行`RunPython.cmd`执行比赛代码 |
|
|
- Windows:最后通过运行`RunPython.cmd`执行比赛代码 |
|
|
- Linux:通过运行`RunPython.sh`执行比赛代码 |
|
|
- Linux:通过运行`RunPython.sh`执行比赛代码 |
|
|
|
|
|
|
|
|
|