|
|
@ -80,25 +80,21 @@ public class ScoreList
|
|
|
|
Frequency frequency,
|
|
|
|
Frequency frequency,
|
|
|
|
boolean isNumerical,
|
|
|
|
boolean isNumerical,
|
|
|
|
double targetValue,
|
|
|
|
double targetValue,
|
|
|
|
EntryList computedEntries
|
|
|
|
EntryList computedEntries,
|
|
|
|
|
|
|
|
Timestamp from,
|
|
|
|
|
|
|
|
Timestamp to
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
list.clear();
|
|
|
|
list.clear();
|
|
|
|
|
|
|
|
if (computedEntries.getKnown().isEmpty()) return;
|
|
|
|
List<Entry> entries = computedEntries.getKnown();
|
|
|
|
if (from.isNewerThan(to)) return;
|
|
|
|
if (entries.isEmpty()) return;
|
|
|
|
|
|
|
|
Entry oldest = entries.get(entries.size() - 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Timestamp today = DateUtils.getTodayWithOffset();
|
|
|
|
|
|
|
|
Timestamp from = oldest.getTimestamp();
|
|
|
|
|
|
|
|
if (from.isNewerThan(today)) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double rollingSum = 0.0;
|
|
|
|
double rollingSum = 0.0;
|
|
|
|
int numerator = frequency.getNumerator();
|
|
|
|
int numerator = frequency.getNumerator();
|
|
|
|
int denominator = frequency.getDenominator();
|
|
|
|
int denominator = frequency.getDenominator();
|
|
|
|
final double freq = frequency.toDouble();
|
|
|
|
final double freq = frequency.toDouble();
|
|
|
|
final Integer[] values = computedEntries
|
|
|
|
final Integer[] values = computedEntries
|
|
|
|
.getByInterval(from, today)
|
|
|
|
.getByInterval(from, to)
|
|
|
|
.stream()
|
|
|
|
.stream()
|
|
|
|
.map(Entry::getValue)
|
|
|
|
.map(Entry::getValue)
|
|
|
|
.toArray(Integer[]::new);
|
|
|
|
.toArray(Integer[]::new);
|
|
|
|