Persist deferred launch overflow history

This commit is contained in:
axiomlogicnexus 2026-04-28 01:00:57 +02:00
parent 465b5aecdc
commit 18629edc0e
3 changed files with 51 additions and 0 deletions

View file

@ -90,6 +90,10 @@ namespace HyperTwistTrainingCoachLibraryInternal
{
return TEXT("successful tightened-launch history");
}
if (SourceLabel == TEXT("recommendation-history-deferred-tightened-launch"))
{
return TEXT("successful deferred tightened-launch history");
}
return SourceLabel.IsEmpty() ? TEXT("none") : SourceLabel;
}

View file

@ -5339,6 +5339,13 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
Snapshot.BroadenedLaunchBudgetHistoryCount = RecommendationHistory.BroadenedLaunchPlanCount;
Snapshot.TightenedLaunchBudgetHistoryCount = RecommendationHistory.TightenedLaunchPlanCount;
Snapshot.bHasRepeatRecommendationPressure = RecommendationHistory.bHasRepeatRecommendationPressure;
const int32 DeferredTightenedLaunchBias = FMath::Clamp(
RecommendationHistory.DeferredTightenedLaunchPlanCount,
0,
3
);
Snapshot.FollowUpGuidanceContinueBias += DeferredTightenedLaunchBias;
Snapshot.SuppressedPrimaryQueuePressureCount += DeferredTightenedLaunchBias;
if (RecommendationHistory.BroadenedLaunchPlanCount >= 2
&& RecommendationHistory.BroadenedLaunchAverageOutcomeScore
>= RecommendationHistory.TightenedLaunchAverageOutcomeScore + 5.0f)
@ -5353,6 +5360,21 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
Snapshot.PreferredLaunchBudgetBias = -1;
Snapshot.PreferredLaunchBudgetSourceLabel = TEXT("recommendation-history-tightened-launch");
}
if (RecommendationHistory.DeferredTightenedLaunchPlanCount >= 2
&& RecommendationHistory.DeferredTightenedLaunchAverageOutcomeScore
>= RecommendationHistory.TightenedLaunchAverageOutcomeScore - 3.0f)
{
Snapshot.PreferredLaunchBudgetBias = -1;
Snapshot.PreferredLaunchBudgetSourceLabel =
TEXT("recommendation-history-deferred-tightened-launch");
if (Snapshot.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::Recommended
|| Snapshot.PreferredGuidanceSourceLabel == TEXT("recommendation-history"))
{
Snapshot.PreferredGuidanceLane = EHyperTwistTrainingCoachGuidanceLane::FollowUp;
Snapshot.PreferredGuidanceSourceLabel =
TEXT("recommendation-history-deferred-tightened-launch");
}
}
if (!RecommendationHistory.FocusDeckId.IsEmpty()
&& (Snapshot.FocusDeckId.IsEmpty()
@ -8704,6 +8726,7 @@ FHyperTwistTrainingCoachRecommendationHistorySummary UHyperTwistTrainingReposito
int32 PlannedLaunchSampleCount = 0;
float BroadenedLaunchOutcomeAccumulator = 0.0f;
float TightenedLaunchOutcomeAccumulator = 0.0f;
float DeferredTightenedLaunchOutcomeAccumulator = 0.0f;
FString LatestPlanSortUtc;
for (const FHyperTwistTrainingCoachActionPlan& Plan : UserPlans)
@ -8895,6 +8918,12 @@ FHyperTwistTrainingCoachRecommendationHistorySummary UHyperTwistTrainingReposito
{
Summary.TightenedLaunchPlanCount += 1;
TightenedLaunchOutcomeAccumulator += OutcomeSummary.OutcomeScore;
if (OutcomeSummary.DeferredLaunchCaseIds.Num() > 0)
{
Summary.DeferredTightenedLaunchPlanCount += 1;
Summary.DeferredLaunchCaseCount += OutcomeSummary.DeferredLaunchCaseIds.Num();
DeferredTightenedLaunchOutcomeAccumulator += OutcomeSummary.OutcomeScore;
}
}
}
@ -9003,6 +9032,12 @@ FHyperTwistTrainingCoachRecommendationHistorySummary UHyperTwistTrainingReposito
Summary.TightenedLaunchAverageOutcomeScore =
TightenedLaunchOutcomeAccumulator / static_cast<float>(Summary.TightenedLaunchPlanCount);
}
if (Summary.DeferredTightenedLaunchPlanCount > 0)
{
Summary.DeferredTightenedLaunchAverageOutcomeScore =
DeferredTightenedLaunchOutcomeAccumulator
/ static_cast<float>(Summary.DeferredTightenedLaunchPlanCount);
}
Summary.bHasRepeatRecommendationPressure =
Summary.RepeatRecommendationSequenceCount > 0
&& (Summary.RecurringCaseCount > 0
@ -9018,6 +9053,7 @@ FHyperTwistTrainingCoachRecommendationHistorySummary UHyperTwistTrainingReposito
Summary.FollowUpLanePlanCount > 0
|| Summary.FollowUpReadySequenceCount > 0
|| Summary.EscalatedSequenceCount > 0
|| Summary.DeferredTightenedLaunchPlanCount > 0
|| Summary.AverageFollowUpDepth >= 1.0f;
const float RecommendedLaneScore =
1.0f
@ -9030,6 +9066,8 @@ FHyperTwistTrainingCoachRecommendationHistorySummary UHyperTwistTrainingReposito
+ static_cast<float>(Summary.FollowUpLaneContinueBias)
+ static_cast<float>(Summary.FollowUpReadySequenceCount) * 2.0f
+ static_cast<float>(Summary.EscalatedSequenceCount) * 1.5f
+ static_cast<float>(Summary.DeferredTightenedLaunchPlanCount) * 1.5f
+ FMath::Clamp(static_cast<float>(Summary.DeferredLaunchCaseCount) * 0.25f, 0.0f, 4.0f)
+ Summary.AverageFollowUpDepth;
Summary.PreferredGuidanceLane =
bHasFollowUpLaneSignal && FollowUpLaneScore > RecommendedLaneScore

View file

@ -3909,6 +3909,12 @@ struct FHyperTwistTrainingCoachRecommendationHistorySummary
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
int32 TightenedLaunchPlanCount = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
int32 DeferredTightenedLaunchPlanCount = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
int32 DeferredLaunchCaseCount = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
int32 RecurringCaseCount = 0;
@ -3933,6 +3939,9 @@ struct FHyperTwistTrainingCoachRecommendationHistorySummary
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
float TightenedLaunchAverageOutcomeScore = 0.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
float DeferredTightenedLaunchAverageOutcomeScore = 0.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
TArray<FString> RecurringCaseIds;