MOTOR_FLOP_ECHTGROESSE: frueher Abbruch (passt die erste Pruefung nach dem Bau nicht mehr; ab Pruefung 10 aussichtslos bei Abfall 1/t^2), spart Rechenzeit beim Rueckfall

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-29 18:49:31 +01:00
co-authored by Claude Opus 5.5
parent 8689ea7030
commit c73fb4e899
+12
View File
@@ -146,12 +146,24 @@ pub fn loese_flop(a: &Aufgabe, zuege: &[Zug2], runden: u32, gut: f32, not: f32,
return Err(if rest.is_nan() { format!("{FRIST} nach {i} Iterationen") } else { format!("{FRIST} nach {i} Iterationen, Rest {:.1} %", rest * 100.0) });
}
solve_step(&g, i);
// Orchestrator 18:10: Rechenzeit sparen, wenn es ohnehin auf die Uebersetzung hinauslaeuft (12 Tische).
// Nach der ersten Iteration: passt die erste Pruefung (5 Iterationen + Pruefung ~2) nicht mehr, sofort zurueck.
if i == 0 && std::time::Instant::now() + t0.elapsed() * 6 >= bis {
return Err(format!("{FRIST} voraus nach Bau"));
}
if pruef {
rest = compute_exploitability(&g) / a.pot as f32;
if rest < gut {
gemacht = i + 1;
break;
}
// Aussichtslos (ab der Pruefung nach 10): selbst bei Abfall wie 1/t^2 bliebe der Rest bis zur Frist ueber `not`.
// Rauchprobe 18:20: 1/t schon nach 5 schnitt 4 von 16 spaeter genauen Lagen ab (49,8 % nach 5 -> 3,7 % nach 29).
let je = t0.elapsed() / (i + 1);
let noch = bis.saturating_duration_since(std::time::Instant::now()).as_secs_f32() / je.as_secs_f32().max(1e-6);
if i >= 9 && rest >= not && rest * ((i + 1) as f32 / (i as f32 + 1.0 + noch)).powi(2) >= not {
return Err(format!("{FRIST} aussichtslos nach {} Iterationen, Rest {:.1} %", i + 1, rest * 100.0));
}
}
}
finalize(&mut g);