示例#1
0
 public Simulator(IPredictionMachine predictionMachine)
 {
     lock (_predictionMachineUpdateLock)
     {
         _predictionMachine = predictionMachine;
     }
 }
示例#2
0
 public void UpdatePredictionMachine(IPredictionMachine predictionMachine)
 {
     lock (_predictionMachineUpdateLock)
     {
         _predictionMachine = predictionMachine;
     }
 }
示例#3
0
        private static void HandleNewPredictionMachine(EventstoreEvent incomingEvent)
        {
            try
            {
                IPredictionMachine newPredictionMachine = SerializationHelper.DeserializeBot(incomingEvent.Data);
                _simulator.UpdatePredictionMachine(newPredictionMachine);

                OutputWriter.WriteLine(ConsoleColor.Cyan, "Got new PredictionMachine, updated!");

                PreloadPreviousTickersToWarmUp(EventstoreHandler);
            }
            catch (Exception ex)
            {
                OutputWriter.WriteLine(ConsoleColor.Red, $"Could not update prediction machine :(  {ex.Message}");
            }
        }