diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp index 5d8d194..1783deb 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp @@ -2493,6 +2493,29 @@ FHyperTwistCoachBrief UHyperTwistTrainingCoachLibrary::DeriveCoachFollowUpBrief( const FString MethodDrillFollowUpPacketLaneLabel = HyperTwistTrainingCoachLibraryInternal::DescribeMethodDrillFollowUpPacketLane( MethodDrillFollowUpPacketHandoffKind); + const FString AlignedGuidanceOutcomeSourceLabel = + ActionPlan.PreferredCoachHandoffSourceLabel + == TEXT("recommendation-history-aligned-tight-follow-up-outcome") + || ActionPlan.PreferredCoachHandoffSourceLabel + == TEXT("recommendation-history-aligned-broad-recommended-outcome") + ? ActionPlan.PreferredCoachHandoffSourceLabel + : ((ActionPlan.PreferredGuidanceSourceLabel + == TEXT("recommendation-history-aligned-tight-follow-up-outcome")) + || (ActionPlan.PreferredGuidanceSourceLabel + == TEXT("recommendation-history-aligned-broad-recommended-outcome")) + ? ActionPlan.PreferredGuidanceSourceLabel + : FString()); + const bool bAlignedTightFollowUpOutcomeSource = + AlignedGuidanceOutcomeSourceLabel + == TEXT("recommendation-history-aligned-tight-follow-up-outcome"); + const bool bAlignedBroadRecommendedOutcomeSource = + AlignedGuidanceOutcomeSourceLabel + == TEXT("recommendation-history-aligned-broad-recommended-outcome"); + const FString AlignedGuidanceOutcomeSourceDescription = + AlignedGuidanceOutcomeSourceLabel.IsEmpty() + ? TEXT("none") + : HyperTwistTrainingCoachLibraryInternal::DescribeCoachMemorySourceLabel( + AlignedGuidanceOutcomeSourceLabel); const FString NarrowedContinuationSourceLabel = bNarrowedContinuationSource ? HyperTwistTrainingCoachLibraryInternal::DescribeCoachMemorySourceLabel( @@ -2619,6 +2642,29 @@ FHyperTwistCoachBrief UHyperTwistTrainingCoachLibrary::DeriveCoachFollowUpBrief( : TEXT("broadened-redirect-first"); } } + else if (bAlignedTightFollowUpOutcomeSource) + { + if (bHasLaunchedFollowUpCases) + { + Brief.FocusCaseIds = HyperTwistTrainingCoachLibraryInternal::MergeFocusCaseIds( + OutcomeSummary.FollowUpCaseIds, + bHasDeferredLaunchCases ? OutcomeSummary.DeferredLaunchCaseIds : ActionPlan.FocusCaseIds); + FollowUpPacketStructureLabel = TEXT("aligned-tight-follow-up-first"); + } + else if (ActionPlan.FocusCaseIds.Num() > 0) + { + Brief.FocusCaseIds = ActionPlan.FocusCaseIds; + FollowUpPacketStructureLabel = TEXT("aligned-tight-follow-up-carry-forward"); + } + } + else if (bAlignedBroadRecommendedOutcomeSource) + { + if (RecommendedPacketCases.Num() > 0) + { + Brief.FocusCaseIds = RecommendedPacketCases; + FollowUpPacketStructureLabel = TEXT("aligned-broad-recommended-first"); + } + } if (!OutcomeSummary.bNeedsFollowUpPlan && Brief.FocusCaseIds.Num() == 0) { @@ -2754,6 +2800,18 @@ FHyperTwistCoachBrief UHyperTwistTrainingCoachLibrary::DeriveCoachFollowUpBrief( Brief.SuggestedSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Weighted; Brief.SuggestedMode = ActionPlan.SuggestedMode; } + else if (bAlignedTightFollowUpOutcomeSource) + { + Brief.SuggestedSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Scripted; + Brief.SuggestedMode = Brief.bPreferRecognitionReplayReview + ? EHyperTwistTrainingDeliveryMode::RecognitionAssisted + : EHyperTwistTrainingDeliveryMode::CoachReviewed; + } + else if (bAlignedBroadRecommendedOutcomeSource) + { + Brief.SuggestedSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Weighted; + Brief.SuggestedMode = ActionPlan.SuggestedMode; + } if (OutcomeSummary.bTightenedLaunchBudget) { @@ -2784,6 +2842,20 @@ FHyperTwistCoachBrief UHyperTwistTrainingCoachLibrary::DeriveCoachFollowUpBrief( *NarrowedContinuationSourceLabel ); } + if (bAlignedTightFollowUpOutcomeSource) + { + Brief.Headline = FString::Printf( + TEXT("%s (accepted aligned tight follow-up continuation)"), + *Brief.Headline + ); + } + else if (bAlignedBroadRecommendedOutcomeSource) + { + Brief.Headline = FString::Printf( + TEXT("%s (accepted aligned broad recommended redirect)"), + *Brief.Headline + ); + } if (bStrongMethodDrillRecoveryPacketSource && MethodDrillRecoveryPacketHandoffKind != EHyperTwistTrainingCoachHandoffKind::None) @@ -2831,12 +2903,12 @@ FHyperTwistCoachBrief UHyperTwistTrainingCoachLibrary::DeriveCoachFollowUpBrief( Brief.PriorityScore, Brief.Headline, FString::Printf( - TEXT("followUpCases=%d, deferredLaunchCases=%d, success=%d, failure=%d, timeout=%d, dnf=%d, launchBudget=%s, plannedLaunchCases=%d, requestedLaunchCases=%d, launchBudgetReason=%s, preferredHandoff=%s, preferredHandoffSource=%s, narrowedContinuation=%d, deferredFirstContinuation=%d, deferredPacketOrdering=%s, drillFollowUpPacketLane=%s, drillFollowUpPacketStance=%s, drillRecoveryPacketLane=%s, drillRecoveryPacketStance=%s"), - Brief.FocusCaseIds.Num(), - OutcomeSummary.DeferredLaunchCaseIds.Num(), - OutcomeSummary.SuccessCount, - OutcomeSummary.FailureCount, - OutcomeSummary.TimeoutCount, + TEXT("followUpCases=%d, deferredLaunchCases=%d, success=%d, failure=%d, timeout=%d, dnf=%d, launchBudget=%s, plannedLaunchCases=%d, requestedLaunchCases=%d, launchBudgetReason=%s, preferredHandoff=%s, preferredHandoffSource=%s, alignedGuidanceOutcomeSource=%s, narrowedContinuation=%d, deferredFirstContinuation=%d, alignedTightContinuation=%d, alignedBroadRedirect=%d, deferredPacketOrdering=%s, drillFollowUpPacketLane=%s, drillFollowUpPacketStance=%s, drillRecoveryPacketLane=%s, drillRecoveryPacketStance=%s"), + Brief.FocusCaseIds.Num(), + OutcomeSummary.DeferredLaunchCaseIds.Num(), + OutcomeSummary.SuccessCount, + OutcomeSummary.FailureCount, + OutcomeSummary.TimeoutCount, OutcomeSummary.DNFCount, *HyperTwistTrainingCoachLibraryInternal::DescribeLaunchBudgetScopeLabel( OutcomeSummary.bBroadenedLaunchBudget, @@ -2850,8 +2922,11 @@ FHyperTwistCoachBrief UHyperTwistTrainingCoachLibrary::DeriveCoachFollowUpBrief( ActionPlan.PreferredCoachHandoffKind ), *NarrowedContinuationSourceLabel, + *AlignedGuidanceOutcomeSourceDescription, bNarrowedContinuationSource ? 1 : 0, bDeferredFirstContinuationSource ? 1 : 0, + bAlignedTightFollowUpOutcomeSource ? 1 : 0, + bAlignedBroadRecommendedOutcomeSource ? 1 : 0, *FollowUpPacketStructureLabel, *MethodDrillFollowUpPacketLaneLabel, bStrongMethodDrillFollowUpPacketSource @@ -3057,6 +3132,26 @@ FHyperTwistCoachSessionQueueSummary UHyperTwistTrainingCoachLibrary::DeriveCoach HyperTwistTrainingCoachLibraryInternal::MethodDrillFollowUpPacketHandoffKindFromSourceLabel( CoachMemorySnapshot.PreferredCoachHandoffSourceLabel, CoachMemorySnapshot.PreferredCoachHandoffKind)); + const FString AlignedGuidanceOutcomeSourceLabel = + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + == TEXT("recommendation-history-aligned-tight-follow-up-outcome") + || CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + == TEXT("recommendation-history-aligned-broad-recommended-outcome") + ? CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + : ((CoachMemorySnapshot.PreferredGuidanceSourceLabel + == TEXT("recommendation-history-aligned-tight-follow-up-outcome")) + || (CoachMemorySnapshot.PreferredGuidanceSourceLabel + == TEXT("recommendation-history-aligned-broad-recommended-outcome")) + ? CoachMemorySnapshot.PreferredGuidanceSourceLabel + : FString()); + const bool bAlignedTightFollowUpOutcomeContinuation = + AlignedGuidanceOutcomeSourceLabel + == TEXT("recommendation-history-aligned-tight-follow-up-outcome") + && SourceLabel == TEXT("follow-up-brief"); + const bool bAlignedBroadRecommendedOutcomeRedirect = + AlignedGuidanceOutcomeSourceLabel + == TEXT("recommendation-history-aligned-broad-recommended-outcome") + && SourceLabel == TEXT("primary-brief"); if (bNarrowedQueueContinuation || bNarrowedFollowUpContinuation || bNarrowedRecommendedContinuation) @@ -3078,6 +3173,17 @@ FHyperTwistCoachSessionQueueSummary UHyperTwistTrainingCoachLibrary::DeriveCoach *ContinuationLabel ); } + if (bAlignedTightFollowUpOutcomeContinuation + || bAlignedBroadRecommendedOutcomeRedirect) + { + Entry.Headline = FString::Printf( + TEXT("%s (%s)"), + *Entry.Headline, + bAlignedTightFollowUpOutcomeContinuation + ? TEXT("accepted aligned tight follow-up continuation") + : TEXT("accepted aligned broad recommended redirect") + ); + } if (bStrongRetainedMethodDrillFollowUpPacketContinuation || bWeakRetainedMethodDrillFollowUpPacketRedirect) {