void UpdateSorterResults(IIterationResult <ISorterEval> result) { if (result.ProgressStatus == ProgressStatus.StepComplete) { SorterEvalGridVm.SorterEvalVms.Add(result.Data.ToSorterEvalVm()); } }
public IDataCollector Create(IIterationResult iterationContext) { IProducer <IResult> pipe = _pipeFactory.Create(); IDataCollector collector = new PipeDataCollector(pipe, iterationContext, _counter); return(collector); }
public void UpdateSorterMutateResults(IIterationResult <ISgMutantProfile> result) { SgMutantProfileGridVm .SgMutantProfileVms.Add( result.Data.ToSgMutantProfileVm() ); _onIterationResult.OnNext(result.Data.SorterGenomeEvals); }
void UpdateSorterResults(IIterationResult <IEnumerable <ISorterEval> > results) { if (results.ProgressStatus == ProgressStatus.StepComplete) { SorterEvalGridVm.SorterEvalVms .AddMany(results.Data.Select(r => r.ToSorterEvalVm())); } OnPropertyChanged("ProcTime"); }
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(); }
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; }
internal void Add(IIterationResult iteration) { _iterations.Add(iteration); }
public IDataCollector Create(IIterationResult iterationContext) { return(new NullDataCollector()); }
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)); } } }
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)); }