public void Receive(object sender, Sender.SendMessageArgs args) { var spots = args.Spots; var function = args.Function; var(a, b, c) = _solver.Solve(spots, function); var lambdaFunction = new FunctionDeterminant().GetFunction(function); var receivedMessage = spots.Select(spot => lambdaFunction(spot.X, a, b, c)) .ToList(); _recorder.RecordReceivedMessage(receivedMessage); _recorder.RecordParameters(a, b, c); }
internal IReadOnlyCollection <Point> Build() { var function = new FunctionDeterminant().GetFunction(_function); var h = (_max - _min) / (_count - 1); var spots = new List <Point>(); for (var x = _min; x <= _max; x += h) { spots.Add(new Point(x, function(x, _a, _b, _c))); } _recorder.RecordSource(spots); return(spots); }