#submission #competitive #evaluate #cli #tester #execute #heuristic

bin+lib ahc-evaluation

评估 AHC(AtCoder Heuristic Contest)提交的代码

2 个版本

0.1.1 2024 年 4 月 11 日
0.1.0 2024 年 4 月 11 日

#2 in #submission

MIT 许可证

28KB
570

ahc-evaluation

评估 AHC(AtCoder Heuristic Contest)提交的代码。

此程序自动化

  • 构建提交代码和本地测试器。
  • 为每个种子执行提交代码和本地测试器,并收集分数和执行时间。
    • 程序与输入/输出文件之间的通信。
    • 从本地测试器的输出中检索分数。

安装

使用以下命令从 crates.io 安装。

cargo install ahc-evaluation

使用方法

Evaluates the submission code for AHC (AtCoder Heuristic Contest).

Usage: ahc-evaluation [OPTIONS]

Options:
  -c, --config <CONFIG>  Path of the configuration file [default: evaluation/config.toml]
  -h, --help             Print help
  -V, --version          Print version

配置

将配置文件 evaluation/config.toml 放置在当前目录下。您也可以使用选项 --config 指定配置文件的路径。

以下是一个配置文件的示例。键不可更改,但值必须根据需要更改。

[thread]
# Number of threads used for evaluation.
# If not specified, it is automatically determined by Rayon.
thread_num = 8

[path]
# Path of the seed list file.
seed_file = "tools/seeds.txt"

# Path of the directory of input files.
input_dir = "tools/in"

# Path of the directory of output files.
output_dir = "evaluation/out"

# Path of the file that outputs a list summarizing the score and execution time for each seed.
evaluation_record = "evaluation/summary.csv"

[command]
# Build command for submission code.
# Specify an empty array if build execution is not required.
build.submission = ["cargo", "build", "--release"]

# Build command for local tester.
# Specify an empty array if build execution is not required.
build.tester = []

# Execution command for submission code.
execute.submission = ["submission/target/release/submission"]

# Execution command for local tester.
# The following placeholders can be used (Placeholders must be quoted independently).
# - `{input}`: The path of the input file corresponding to the seed.
# - `{output}`: The path of the output file corresponding to the seed.
# - `{cmd}`: Execution command of the submission code.
execute.tester = ["tools/tester", "{input}", "{output}"]

# Set this flag to `true` if the submission code is to be executed via the local tester rather than independently.
execute.integrated = false

依赖项

~8–17MB
~201K SLoC