Пример #1
0
        protected virtual StreamPipeline ComposeOffPipeline(string id, DataExchange exchange)
        {
            var offlinePipeline = new StreamPipeline();

            Dictionary<string, int> time = new Dictionary<string, int>();

            var trainUntil = testStartDateProvider.GetTimestampOfTestStart(id);

            offlinePipeline.Register(new offPredictionFittingFilter(parameters, trainUntil, time, exchange));

            return offlinePipeline;
        }
Пример #2
0
        public void Start(string id, IMessageQueue queue)
        {
            var suffix = Guid.NewGuid().ToString();

            var pipeline = new StreamPipeline();

            pipeline.Register(new MeanPredictionFilter());
            pipeline.Register(new ResultOutputFilter(repository) { MeasurementId = id, ForecastModelId = name });

            var task1 = Task.Factory.StartNew(() => { RegisterStream(queue, pipeline, id + "-online-" + suffix, id); });

            Task.WaitAll(task1);
        }
Пример #3
0
        protected virtual StreamPipeline ComposeOnPipeline(string id, DataExchange exchange, string name)
        {
            var onlinePipeline = new StreamPipeline();

            parameters = new FilterParameters();

            var trainUntil = testStartDateProvider.GetTimestampOfTestStart(id);

            onlinePipeline.Register(new onNeuralPredictionFilter(parameters, trainUntil, exchange));
            onlinePipeline.Register(new onErrorCalculationFilter(parameters));

            onlinePipeline.Register(new ResultOutputFilter(repository) { MeasurementId = id, ForecastModelId = name});

            return onlinePipeline;
        }
Пример #4
0
 private void RegisterStream(IMessageQueue messageQueue, StreamPipeline pipeline, string pipelineName, string id)
 {
     while (true)
     {
         try
         {
             var units = messageQueue.Dequeue(id, pipelineName);
             pipeline.Execute(units);
         }
         catch (EndOfStreamException)
         {
             Console.WriteLine("End of stream");
             break;
         }
         catch (Exception ex)
         {
             Logging.Debug(ex.ToString());
             throw;
         }
     }
 }
Пример #5
0
 public StreamPipeline UpdatePipeline(StreamPipeline sourcePipeline, Command command)
 {
     return sourcePipeline;
 }