30 lines
668 B
TypeScript
30 lines
668 B
TypeScript
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}`,
|
|
};
|
|
}
|