public void RunSimulationAge() { if (_dataSource == null) { return; } //TODO: this does not work with logging var output = _neurons.Values.First(n => n.AxonsCount == 0); using (_dataSource.BeginDataFetch()) { double[] data = _dataSource.GetNextDataPortion(); while (data != null) { for (int i = 0; i < _sensors.Count; i++) { _sensors[i].Emit(data[i]); } var label = data.Last(); _logAggregator.Publish($"Got {output.Output} but expect {label}."); output.Learn(label - output.Output); data = _dataSource.GetNextDataPortion(); } } }