use of io.mantisrx.mantis.examples.sinefunction.core.Point in project mantis by Netflix.
the class SinePointGeneratorStage method call.
@Override
public Observable<Point> call(Context context, Observable<Integer> o) {
final double amplitude = (double) context.getParameters().get(SineFunctionJob.AMPLITUDE);
final double frequency = (double) context.getParameters().get(SineFunctionJob.FREQUENCY);
final double phase = (double) context.getParameters().get(SineFunctionJob.PHASE);
return o.filter(x -> x % 2 == 0).map(x -> new Point(x, amplitude * Math.sin((frequency * x) + phase)));
}
Aggregations