feat(planning): make optimization rules composable
Evaluate explicit, ordered optimization configurations through one shared planner model. Add six editable presets, durable one-time legacy migration, and consistent completed and cancelled plan provenance. Include functional regressions and the agreed trace-removal and benchmark follow-up specs. Performance acceptance remains in #78 under unchanged gates. Refs: #70, #71, #72, #73, #74, #75, #76, #77, #78
This commit is contained in:
1 parent
209bf05f36
commit
6811142299
45 files changed
+8795
-3075
No files matched your search
@@ -4,6 +4,7 @@ import {
|
||||
PlanningRequest,
|
||||
PlanningTrace,
|
||||
} from '../services/leave-planner.service';
|
||||
import { createOptimizationPresetRules } from '../services/rule-service';
|
||||
|
||||
export interface BenchmarkScenario {
|
||||
name: string;
|
||||
@@ -47,7 +48,8 @@ const balance = (
|
||||
|
||||
export function benchmarkScenarios(): BenchmarkScenario[] {
|
||||
const horizon = { start: '2024-01-01', end: '2025-01-01' };
|
||||
return [
|
||||
const presets = createOptimizationPresetRules();
|
||||
const scenarios: BenchmarkScenario[] = [
|
||||
{
|
||||
name: 'representative year',
|
||||
request: {
|
||||
@@ -169,6 +171,13 @@ export function benchmarkScenarios(): BenchmarkScenario[] {
|
||||
}),
|
||||
),
|
||||
];
|
||||
return scenarios.map((scenario) => ({
|
||||
...scenario,
|
||||
request: {
|
||||
...scenario.request,
|
||||
rules: [presets[0], ...scenario.request.rules, ...presets.slice(1)],
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
function resultSummary(outcome: PlanningOutcome): {
|
||||
|
||||
Reference in new issue
Block a user