Skip to content

Commit

Permalink
fixed corner case bug affecting movingAverage function in combination…
Browse files Browse the repository at this point in the history
… with constantLine
  • Loading branch information
EinsamHauer committed Oct 24, 2016
1 parent 9022a74 commit 9833d0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Target shiftBy(long shift) {
@Override
public Target previous(long period) {
try {
DistheneFunction function = FunctionRegistry.getFunction(getContext(), name, to - period , to - 1);
DistheneFunction function = FunctionRegistry.getFunction(getContext(), name, from - period , from - 1);

for (Object argument : arguments) {
if (argument instanceof Target) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import net.iponweb.disthene.reader.beans.TimeSeries;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
Expand Down Expand Up @@ -75,7 +73,7 @@ private static void align(List<TimeSeries> timeSeries) {
// todo: think about different consolidation functions?
// todo: assuming timeSeries.from <= from <= to <= timeSeries.to - has to be checked?
// todo: from % step == 0 && to % step == 0
public static void consolidate(TimeSeries timeSeries, int step, long from, long to) {
private static void consolidate(TimeSeries timeSeries, int step, long from, long to) {
List<Double> consolidated = new ArrayList<>();
List<Double> buffer = new ArrayList<>();

Expand Down

0 comments on commit 9833d0d

Please sign in to comment.