Update
This commit is contained in:
rodič
e0a9f6da12
revize
e5076f4c45
10
Makefile
10
Makefile
|
@ -73,9 +73,17 @@ tags:
|
|||
schedule: plan
|
||||
|
||||
plan:
|
||||
deno run --unstable --allow-read --allow-write utils/plan.js $(num)
|
||||
deno run --unstable --allow-read --allow-write utils/plan.js $(num) $(append)
|
||||
|
||||
plan-candidates:
|
||||
js-yaml dist/22/schedule-candidates.json > spec/22/schedule-candidates.yaml
|
||||
|
||||
schedule: plan plan-candidates build
|
||||
|
||||
schedule-multi:
|
||||
tmux new-session -d "make schedule num=$(num) append=true"
|
||||
tmux split-window -d "make schedule num=$(num) append=true"
|
||||
tmux split-window -d "make schedule num=$(num) append=true"
|
||||
tmux split-window -d "make schedule num=$(num) append=true"
|
||||
tmux split-window -d "make schedule num=$(num) append=true"
|
||||
tmux attach
|
||||
|
|
Rozdílový obsah nebyl zobrazen, protože je příliš veliký
Načíst rozdílové porovnání
|
@ -463,10 +463,12 @@ async function main() {
|
|||
const limit = null;
|
||||
let i = 0;
|
||||
const numResults = Deno.args[0] || 10;
|
||||
const appendResults = Boolean(Deno.args[1]) || false;
|
||||
const startTime = new Date();
|
||||
|
||||
console.log("Planning started ..");
|
||||
console.log(`Looking for ${numResults} results`);
|
||||
console.log(`Append results: ${appendResults}`);
|
||||
|
||||
const plans = [];
|
||||
|
||||
|
@ -516,11 +518,28 @@ async function main() {
|
|||
`, best score: ${bestScore()}`,
|
||||
);
|
||||
const outputFn = "./dist/22/schedule-candidates.json";
|
||||
console.log(`Writing result: ${outputFn}`);
|
||||
const filtered = plans.sort((x, y) =>
|
||||
x.metrics.score > y.metrics.score ? -1 : 1
|
||||
).slice(0, 10);
|
||||
Deno.writeTextFile(outputFn, JSON.stringify(filtered, null, 2));
|
||||
|
||||
if (appendResults) {
|
||||
const current = JSON.parse(await Deno.readTextFile(outputFn))
|
||||
for (const fi of plans) {
|
||||
if (current.find(c => c.hash === fi.hash)) {
|
||||
continue
|
||||
}
|
||||
current.push(fi)
|
||||
}
|
||||
const filtered = current.sort((x, y) =>
|
||||
x.metrics.score > y.metrics.score ? -1 : 1
|
||||
).slice(0, 10);
|
||||
console.log(`Appending result: ${outputFn}`);
|
||||
Deno.writeTextFile(outputFn, JSON.stringify(filtered, null, 2));
|
||||
|
||||
} else {
|
||||
const filtered = plans.sort((x, y) =>
|
||||
x.metrics.score > y.metrics.score ? -1 : 1
|
||||
).slice(0, 10);
|
||||
console.log(`Writing result: ${outputFn}`);
|
||||
Deno.writeTextFile(outputFn, JSON.stringify(filtered, null, 2));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Načítá se…
Odkázat v novém úkolu