public static void NotifyOfWaveEnd(bool shouldLearnFromWave) { LastWaveScore = _waveScore; var willLearnFromWave = shouldLearnFromWave && _waveScore > 0 && _waveScore <= 1; if (willLearnFromWave) { _waveData.WaveInputs.Add(_currentWaveInput); _waveData.WaveScores.Add(_waveScore); var waveDataResults = new { RawWaveData = _waveScore + "," + string.Join(",", _currentWaveInput), }; AnalyticsManager.SendEventImmediately("WaveData", waveDataResults); } #if DEBUG else { var doh = 1; } #endif _waveScore = 0; if (_machineLearningModel.IsCurrentlyLearning || !willLearnFromWave) { return; } void LearnTask() { _machineLearningModel.LearnAll(_waveData); SaveData(); } var lowestPriorityThread = new Thread(LearnTask) { Priority = ThreadPriority.Lowest }; lowestPriorityThread.Start(); var lowPriorityThread = new Thread(GeneticsManager.EvaluateAndGenerate) { Priority = ThreadPriority.BelowNormal }; lowPriorityThread.Start(); }
public static void UncaughtExceptionLogger(object sender, UnhandledExceptionEventArgs args) { Exception e = (Exception)args.ExceptionObject; AddLine(e.Message); AddLine(e.StackTrace); var errorDetails = new { Message = e.Message, StackTrace = e.StackTrace }; AnalyticsManager.SendEventImmediately("UncaughtException", errorDetails); }