コード例 #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;
 }