void UpdateSorterResults(IIterationResult <ISorterEval> result)
 {
     if (result.ProgressStatus == ProgressStatus.StepComplete)
     {
         SorterEvalGridVm.SorterEvalVms.Add(result.Data.ToSorterEvalVm());
     }
 }
Example #2
0
        public IDataCollector Create(IIterationResult iterationContext)
        {
            IProducer <IResult> pipe = _pipeFactory.Create();

            IDataCollector collector = new PipeDataCollector(pipe, iterationContext, _counter);

            return(collector);
        }
Example #3
0
        public void UpdateSorterMutateResults(IIterationResult <ISgMutantProfile> result)
        {
            SgMutantProfileGridVm
            .SgMutantProfileVms.Add(
                result.Data.ToSgMutantProfileVm()
                );

            _onIterationResult.OnNext(result.Data.SorterGenomeEvals);
        }
Example #4
0
 void UpdateSorterResults(IIterationResult <IEnumerable <ISorterEval> > results)
 {
     if (results.ProgressStatus == ProgressStatus.StepComplete)
     {
         SorterEvalGridVm.SorterEvalVms
         .AddMany(results.Data.Select(r => r.ToSorterEvalVm()));
     }
     OnPropertyChanged("ProcTime");
 }
Example #5
0
        public IterationResult(IIterationResult iteration, IThreadPoolStats threadPoolContext)
        {
            ThreadId          = iteration.ThreadId;
            GlobalIterationId = iteration.GlobalIterationId;
            ThreadIterationId = iteration.ThreadIterationId;
            UserData          = iteration.UserData;


            IterationStarted  = iteration.IterationStarted;
            IterationFinished = iteration.IterationFinished;

            CreatedThreads = threadPoolContext.InitializedThreadCount;
            IdleThreads    = threadPoolContext.IdleThreadCount;

            Checkpoints = iteration.CopyCheckpoints();
        }
Example #6
0
        void UpdateSorterSamplerResults(IIterationResult <SorterSamplerResults> result)
        {
            if (result.Data == null)
            {
                return;
            }

            SorterEvalGridVm.SorterEvalVms.AddMany
            (
                result.Data.SwitchResults.Select(r => r.ToSorterEvalVm())
            );

            _switchUseHistoGram.Merge(result.Data.SwitchUseHistogram, (a, b) => a + b);
            OnPropertyChanged("SizeDistributionReport");
            OnPropertyChanged("ProcTime");
            SortFails = (SortFails.HasValue) ? SortFails.Value + result.Data.SortFails : result.Data.SortFails;
        }
Example #7
0
 internal void Add(IIterationResult iteration)
 {
     _iterations.Add(iteration);
 }
 public IDataCollector Create(IIterationResult iterationContext)
 {
     return(new NullDataCollector());
 }
Example #9
0
        private void UpdateSorterTuneResults(IIterationResult <IScpWorkflow> result)
        {
            if (
                (result.ProgressStatus == ProgressStatus.StepComplete)
                &&
                (result.Data.SorterLayerEval != null)
                )
            {
                var sorterEvalDict = result.Data.CompPool.SorterEvals.ToDictionary(e => e.Sorter.Guid);

                var nextEvals = new List <ISorterGenomeEval>();
                foreach (var genomeEval in result.Data.SorterLayerEval.GenomeEvals.Where(ev => ev.Success))
                {
                    if (_sorterGenomeEvals.ContainsKey(genomeEval.Guid))
                    {
                        nextEvals.Add(_sorterGenomeEvals[genomeEval.Guid]);
                    }
                    else
                    {
                        nextEvals.Add
                        (
                            SorterGenomeEval.Make
                            (
                                sorterGenome: genomeEval.Genome,
                                parentGenomeEval: _sorterGenomeEvals.ContainsKey(genomeEval.Genome.ParentGuid)
                                                           ?  _sorterGenomeEvals[genomeEval.Genome.ParentGuid] : null,
                                sorterEval: sorterEvalDict[genomeEval.Guid],
                                generation: ScpParamsVm.CurrentGeneration,
                                success: genomeEval.Success
                            )
                        );
                    }
                }

                ScpParamsVm.CurrentGeneration = result.Data.Generation;

                if (ScpParamsVm.CurrentGeneration % ReportFrequency == 0)
                {
                    SorterGenomeEvalGridVm.SorterGenomeEvalVms.Clear();

                    SorterGenomeEvalGridVm
                    .SorterGenomeEvalVms
                    .AddMany(
                        nextEvals.OrderBy(e => e.Score)
                        .ThenByDescending(e => e.Generation)
                        .Take(1000)
                        .Select(g => g.ToSorterGenomeEvalVm())
                        );
                }

                //var groips = result.Data.SorterLayerEval.GenomeEvals
                //                        .GroupBy(e => e.Score)
                //                        .OrderBy(g => g.Key)
                //                        .Select(g =>  string.Format("[{0}, {1}]", g.Key, g.Count()).PadLeft(12))
                //                        .Aggregate(string.Empty, (e, n) => e + n);

                var groips = JsonConvert.SerializeObject
                             (
                    result.Data.SorterLayerEval.GenomeEvals
                    .GroupBy(e => e.Score)
                    .OrderBy(g => g.Key)
                    .Select(g => new Tuple <int, int>((int)g.Key, g.Count()))
                    .ToList()
                             );

                _sorterGenomeEvals = nextEvals.ToDictionary(e => e.Guid);
                if (ScpParamsVm.CurrentGeneration % ReportFrequency == 0)
                {
                    _onIterationResult.OnNext(new Tuple <string, int, string>(ScpParamsVm.Name, ScpParamsVm.CurrentGeneration, groips));
                }
            }
        }
Example #10
0
 public PipeDataCollector(IProducer <IResult> producer, IIterationResult context, IThreadPoolStats poolStats)
 {
     _producer  = producer ?? throw new ArgumentNullException(nameof(producer));
     _context   = context ?? throw new ArgumentNullException(nameof(context));
     _poolStats = poolStats ?? throw new ArgumentNullException(nameof(poolStats));
 }