1
This commit is contained in:
29
src/services/storyEngine/narrativeRegressionRerun.ts
Normal file
29
src/services/storyEngine/narrativeRegressionRerun.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { SimulationRunResult } from '../../types';
|
||||
|
||||
export interface NarrativeRerunSeed {
|
||||
id: string;
|
||||
seed: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export function recordRerunSeed(params: {
|
||||
seed: string;
|
||||
label: string;
|
||||
}) {
|
||||
return {
|
||||
id: `rerun-seed:${params.seed}`,
|
||||
seed: params.seed,
|
||||
label: params.label,
|
||||
} satisfies NarrativeRerunSeed;
|
||||
}
|
||||
|
||||
export function rerunNarrativeSimulation(params: {
|
||||
recordedSeed: NarrativeRerunSeed;
|
||||
result: SimulationRunResult;
|
||||
}) {
|
||||
return {
|
||||
rerunId: `rerun:${params.recordedSeed.id}`,
|
||||
seed: params.recordedSeed.seed,
|
||||
summary: `${params.recordedSeed.label} 复测结果:${params.result.summary}`,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user