Ejemplo n.º 1
0
        /// <summary>
        /// Implements the logic of sequential uncertainties evaluation, reporting it, acquiring data mask (a subset of the data which is actually needs to be processed), generating the mean values for points left
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override sealed async Task <Array> ProcessRequestAsync(IRequestContext context)
        {
            Stopwatch sw          = Stopwatch.StartNew();
            var       compContext = await compContextFactory.CreateAsync(context);

            sw.Stop();
            traceSwitch.TraceEvent(TraceEventType.Information, 1, string.Format("Computational context is ready in {0}", sw.Elapsed));
            sw = Stopwatch.StartNew();
            var uncertaintes = await uncertaintyEvaluator.EvaluateAsync(context, compContext);

            sw.Stop();
            traceSwitch.TraceEvent(TraceEventType.Information, 2, string.Format("Uncertatinty was evaluated in {0}", sw.Elapsed));
            sw = Stopwatch.StartNew();
            //WARNING!!!
            //TODO: Implicit dependency here. The user of the ProcessRequestAsync EXPECTS that context.GetMaskAsync is called during the execution and waits for it. Separate the method!
            var mask = await context.GetMaskAsync(uncertaintes);

            sw.Stop();
            traceSwitch.TraceEvent(TraceEventType.Verbose, 3, string.Format("FetchEngine returned a bitmask in {0}", sw.Elapsed));
            sw = Stopwatch.StartNew();
            var result = await valuesAggregator.AggregateAsync(context, compContext, mask);

            sw.Stop();
            traceSwitch.TraceEvent(TraceEventType.Information, 3, string.Format("Aggregated values were got in {0}", sw.Elapsed));
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Implements the logic of sequential uncertainties evaluation, reporting it, acquiring data mask (a subset of the data which is actually needs to be processed), generating the mean values for points left
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override sealed async Task <Array> ProcessRequestAsync(IRequestContext context)
        {
            var uncertaintes = await uncertaintyEvaluator.EvaluateAsync(context);

            //WARNING!!!
            //TODO: Implicit dependency here. The user of the ProcessRequestAsync EXPECTS that context.GetMaskAsync is called during the execution and waits for it. Separate the method!
            var mask = await context.GetMaskAsync(uncertaintes);

            return(await valuesAggregator.AggregateAsync(context, mask));
        }