Shape coach decks by handoff preference

This commit is contained in:
axiomlogicnexus 2026-04-27 22:54:27 +02:00
parent 880d578de9
commit 382c7e5d1c

View file

@ -97,26 +97,54 @@ namespace HyperTwistTrainingSubsystemInternal
int32 ResolvePreferredCoachCaseBudget(
const int32 MaxCases,
const EHyperTwistTrainingCoachGuidanceLane DeckLane,
const FHyperTwistTrainingCoachMemorySnapshot& CoachMemorySnapshot)
const FHyperTwistTrainingCoachMemorySnapshot& CoachMemorySnapshot,
const bool bQueuedLaunch)
{
int32 DesiredCaseCount = MaxCases > 0 ? MaxCases : 3;
const int32 DesiredCaseCount = MaxCases > 0 ? MaxCases : 3;
int32 AdjustedCaseCount = DesiredCaseCount;
if (CoachMemorySnapshot.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp
&& DeckLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp)
{
return FMath::Max(1, DesiredCaseCount - 1);
AdjustedCaseCount = FMath::Max(1, AdjustedCaseCount - 1);
}
if (CoachMemorySnapshot.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::Recommended
else if (CoachMemorySnapshot.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::Recommended
&& DeckLane == EHyperTwistTrainingCoachGuidanceLane::Recommended
&& DesiredCaseCount <= 3
&& AdjustedCaseCount <= 3
&& (CoachMemorySnapshot.bHasRepeatRecommendationPressure
|| CoachMemorySnapshot.RecommendedGuidanceContinueBias > 0
|| CoachMemorySnapshot.RecurringCoachCaseIds.Num() >= 3))
{
return DesiredCaseCount + 1;
AdjustedCaseCount += 1;
}
return DesiredCaseCount;
if (CoachMemorySnapshot.PreferredCoachHandoffKind == EHyperTwistTrainingCoachHandoffKind::Queue
&& bQueuedLaunch
&& DeckLane != EHyperTwistTrainingCoachGuidanceLane::FollowUp
&& (CoachMemorySnapshot.ScheduleDeferredEventCount > 0
|| CoachMemorySnapshot.ScheduleManualRescheduleEventCount > 0
|| CoachMemorySnapshot.bHasQueueExecutionCompletionGap))
{
AdjustedCaseCount += 1;
}
else if (CoachMemorySnapshot.PreferredCoachHandoffKind == EHyperTwistTrainingCoachHandoffKind::FollowUp
&& DeckLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp
&& (CoachMemorySnapshot.FollowUpReadyCoachSequenceCount > 0
|| CoachMemorySnapshot.ScheduleBlockedFollowUpEventCount > 0
|| CoachMemorySnapshot.FollowUpGuidanceContinueBias > 0))
{
AdjustedCaseCount = FMath::Max(1, AdjustedCaseCount - 1);
}
else if (CoachMemorySnapshot.PreferredCoachHandoffKind == EHyperTwistTrainingCoachHandoffKind::Recommended
&& DeckLane == EHyperTwistTrainingCoachGuidanceLane::Recommended
&& AdjustedCaseCount <= 4
&& (CoachMemorySnapshot.bHasRepeatRecommendationPressure
|| CoachMemorySnapshot.RecommendedGuidanceContinueBias > 0
|| CoachMemorySnapshot.RecurringCoachCaseIds.Num() >= 2))
{
AdjustedCaseCount += 1;
}
return FMath::Max(1, AdjustedCaseCount);
}
const FHyperTwistTrainingCoachSessionQueueStateEntry* FindNextRunnableCoachQueueEntry(
@ -176,7 +204,8 @@ namespace HyperTwistTrainingSubsystemInternal
const int32 DesiredCaseCount = ResolvePreferredCoachCaseBudget(
MaxCases,
GuidanceLaneFromQueueSourceLabel(QueueEntry.SourceLabel),
CoachMemorySnapshot
CoachMemorySnapshot,
true
);
FHyperTwistTrainingDeck SourceDeck;
if (!QueueEntry.FocusDeckId.IsEmpty())
@ -1166,7 +1195,8 @@ FHyperTwistTrainingDeck UHyperTwistTrainingSubsystem::BuildActiveCoachRecommende
const int32 DesiredCaseCount = HyperTwistTrainingSubsystemInternal::ResolvePreferredCoachCaseBudget(
MaxCases,
EHyperTwistTrainingCoachGuidanceLane::Recommended,
ActiveCoachMemorySnapshot
ActiveCoachMemorySnapshot,
false
);
TArray<FHyperTwistTrainingCase> FocusCases;
for (const FString& FocusCaseId : ActiveCoachBrief.FocusCaseIds)
@ -1244,7 +1274,8 @@ FHyperTwistTrainingDeck UHyperTwistTrainingSubsystem::BuildActiveCoachFollowUpDe
const int32 DesiredCaseCount = HyperTwistTrainingSubsystemInternal::ResolvePreferredCoachCaseBudget(
MaxCases,
EHyperTwistTrainingCoachGuidanceLane::FollowUp,
ActiveCoachMemorySnapshot
ActiveCoachMemorySnapshot,
false
);
TArray<FHyperTwistTrainingCase> FocusCases;
for (const FString& FocusCaseId : ActiveCoachFollowUpBrief.FocusCaseIds)