Punishment update
This commit is contained in:
@@ -39,6 +39,7 @@ constexpr int ID_MINUTES = 1003;
|
||||
constexpr int ID_TOPOLOGY_FROM = 1004;
|
||||
constexpr int ID_TOPOLOGY_TO = 1005;
|
||||
constexpr int ID_CHECKPOINT_SECONDS = 1006;
|
||||
constexpr int ID_SEARCH_MODE = 1007;
|
||||
constexpr int ID_START = 2001;
|
||||
constexpr int ID_STOP = 2002;
|
||||
|
||||
@@ -59,6 +60,7 @@ HWND g_minutes = nullptr;
|
||||
HWND g_topology_from = nullptr;
|
||||
HWND g_topology_to = nullptr;
|
||||
HWND g_checkpoint_seconds = nullptr;
|
||||
HWND g_search_mode = nullptr;
|
||||
std::vector<HWND> g_setting_controls;
|
||||
|
||||
HFONT g_ui_font = nullptr;
|
||||
@@ -569,6 +571,28 @@ HWND make_button(
|
||||
return control;
|
||||
}
|
||||
|
||||
HWND make_search_mode_combo(HWND parent, int x, int y, int width, int height) {
|
||||
HWND control = CreateWindowExW(
|
||||
0,
|
||||
L"COMBOBOX",
|
||||
L"",
|
||||
WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
parent,
|
||||
reinterpret_cast<HMENU>(static_cast<INT_PTR>(ID_SEARCH_MODE)),
|
||||
nullptr,
|
||||
nullptr);
|
||||
SendMessageW(control, WM_SETFONT, reinterpret_cast<WPARAM>(g_ui_font), TRUE);
|
||||
SendMessageW(control, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Обычный"));
|
||||
SendMessageW(control, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Проработка худших"));
|
||||
SendMessageW(control, CB_SETCURSEL, 0, 0);
|
||||
g_setting_controls.push_back(control);
|
||||
return control;
|
||||
}
|
||||
|
||||
void create_controls(HWND window) {
|
||||
g_title_font = CreateFontW(
|
||||
24, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
|
||||
@@ -606,6 +630,9 @@ void create_controls(HWND window) {
|
||||
g_checkpoint_seconds =
|
||||
make_number_edit(window, ID_CHECKPOINT_SECONDS, L"30", 592, 110, 125, 27);
|
||||
|
||||
make_label(window, L"Режим поиска", 735, 86, 245, 22);
|
||||
g_search_mode = make_search_mode_combo(window, 735, 110, 245, 180);
|
||||
|
||||
make_label(
|
||||
window,
|
||||
L"CUDA-устройство выбирается автоматически. Поиск: FP32; финальная проверка кандидатов: DD.",
|
||||
@@ -688,26 +715,37 @@ void start_search() {
|
||||
const int seed = make_automatic_seed();
|
||||
append_log_direct(L"Seed запуска: " + std::to_wstring(seed));
|
||||
|
||||
const bool prioritize_worst =
|
||||
SendMessageW(g_search_mode, CB_GETCURSEL, 0, 0) == 1;
|
||||
append_log_direct(
|
||||
prioritize_worst
|
||||
? L"Режим поиска: проработка худших вариантов."
|
||||
: L"Режим поиска: обычный.");
|
||||
|
||||
const fs::path stop_path = make_stop_path();
|
||||
const std::wstring title =
|
||||
L"CUDA-поиск, топологии " + std::to_wstring(topology_from) +
|
||||
L"–" + std::to_wstring(topology_to);
|
||||
std::vector<std::wstring> args{
|
||||
L"--global-search",
|
||||
L"--cuda",
|
||||
L"--seed", std::to_wstring(seed),
|
||||
L"--cuda-chains", std::to_wstring(cuda_chains),
|
||||
L"--cuda-iters", std::to_wstring(cuda_iters),
|
||||
L"--minutes", std::to_wstring(minutes),
|
||||
L"--topology-from", std::to_wstring(topology_from),
|
||||
L"--topology-to", std::to_wstring(topology_to),
|
||||
L"--checkpoint-seconds", std::to_wstring(checkpoint_seconds),
|
||||
L"--stop-file", stop_path.wstring(),
|
||||
L"--global-dir", L"results\\search"
|
||||
};
|
||||
if (prioritize_worst) {
|
||||
args.push_back(L"--prioritize-worst");
|
||||
}
|
||||
start_process(
|
||||
title,
|
||||
main_exe(),
|
||||
{
|
||||
L"--global-search",
|
||||
L"--cuda",
|
||||
L"--seed", std::to_wstring(seed),
|
||||
L"--cuda-chains", std::to_wstring(cuda_chains),
|
||||
L"--cuda-iters", std::to_wstring(cuda_iters),
|
||||
L"--minutes", std::to_wstring(minutes),
|
||||
L"--topology-from", std::to_wstring(topology_from),
|
||||
L"--topology-to", std::to_wstring(topology_to),
|
||||
L"--checkpoint-seconds", std::to_wstring(checkpoint_seconds),
|
||||
L"--stop-file", stop_path.wstring(),
|
||||
L"--global-dir", L"results\\search"
|
||||
},
|
||||
args,
|
||||
stop_path);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user