Skip to content

Commit

Permalink
Rewrite Ops time/efficiency prediction to match VBP version
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKell authored Jun 27, 2024
1 parent dd413a9 commit 9326e9e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Source/RP0/SpaceCenter/Projects/LCOpsProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,15 @@ public double GetTimeLeft()

private double TimeLeftWithEfficiencyIncrease(double timeLeft)
{
if (LC.Efficiency == LCEfficiency.MaxEfficiency)
if (LC.Efficiency == LCEfficiency.MaxEfficiency || timeLeft < 86400d)
return timeLeft;

if (timeLeft > 86400d)
double bpDivRate = timeLeft * LC.Efficiency;
double newEff = LC.Efficiency;
double portion = LC.Engineers / (double)LC.MaxEngineers;
for (int i = 0; i < 4; ++i)
{
double newEff = LC.Efficiency;
double portion = LC.Engineers / (double)LC.MaxEngineers;
for (int i = 0; i < 4; ++i)
{
timeLeft = (timeLeft * newEff) / LC.EfficiencySource.PredictWeightedEfficiency(timeLeft, portion, out newEff, LC.Efficiency);
}
timeLeft = bpDivRate / LC.EfficiencySource.PredictWeightedEfficiency(timeLeft, portion, out newEff, LC.Efficiency);
}
return timeLeft;
}
Expand Down

0 comments on commit 9326e9e

Please sign in to comment.