added start threads option to optimo

This commit is contained in:
Mark Wolters 2024-04-17 14:56:55 -04:00
parent 3fab415c6d
commit 7cf6dab367
2 changed files with 3 additions and 1 deletions

View File

@ -86,7 +86,7 @@ public class CMD_optimo extends NBBaseCommand {
model.add("rate", 10, optimoSearchParams.startRate(), optimoSearchParams.startRate()*4,
rate -> flywheel.onEvent(ParamChange.of(new CycleRateSpec(rate, 1.1d, SimRateSpec.Verb.restart)))
);
model.add("threads", 10, 50, 2000,
model.add("threads", 10, optimoSearchParams.start_threads(), 2000,
threads -> flywheel.onEvent(ParamChange.of(new SetThreads((int) (threads))))
);

View File

@ -24,6 +24,7 @@ public record OptimoSearchSettings(
long sample_time_ms,
double cutoff_quantile,
double cutoff_ms,
double start_threads,
OptimoParamModel model
) {
public OptimoSearchSettings(NBCommandParams params, OptimoParamModel model) {
@ -32,6 +33,7 @@ public record OptimoSearchSettings(
params.maybeGet("sample_time_ms").map(Long::parseLong).orElse(5000L),
params.maybeGet("cutoff_quantile").map(Double::parseDouble).orElse(0.99),
params.maybeGet("cutoff_ms").map(Double::parseDouble).orElse(50.0d),
params.maybeGet("start_threads").map(Double::parseDouble).orElse(50.0d),
model
);
}