less sleep oscillation

pull/1/head
valyrie97 2022-12-31 23:42:08 -05:00
parent 8c3a18a2e8
commit 6f977bd972
1 changed files with 3 additions and 3 deletions

View File

@ -30,20 +30,20 @@ public class SleepActivity extends Activity {
@Override
public float getBenefit() {
float minSleepRechargePerCycle = 0.2f;
// subtract because sleeping for only 5 minutes when
// you're not that tired to hit 100% is undesireable.
// as it will induce oversleep
WeightedAverage average = new WeightedAverage();
average.add(needs.getSleepNeed() - minSleepRechargePerCycle, 1);
average.add(needs.getSleepNeed(), 1);
// System.out.println(1 - 2 * clock.getSunlight());
average.add(1 - 2 * clock.getSunlight(), circadianStrength);
return average.calculate();
}
// isValid vs canBeStarted? idk, maybe thats not important.
@Override
public boolean isValid() {
return true;
return needs.getSleepNeed() > 0.2f;
}
@Override