Пример #1
0
 public RunScpVm(IScpParams scpParams, IEnumerable <ISorterGenomeEvalVm> sorterGenomeEvalVms)
 {
     ScpRunnerVm = new ScpRunnerVm(scpParams, sorterGenomeEvalVms);
     ScpRunnerVm.OnIterationResult.Subscribe(ReportBestResult);
     ReportFrequency   = 10;
     _trajectoryGridVm = new SgHistoryGridVm();
     _stopwatch        = new Stopwatch();
 }
Пример #2
0
        public MultiRunScpVm(IEnumerable <ConfigScpVm> configScpVms)
        {
            _trajectoryGridVm = new SgHistoryGridVm();
            _reportFrequency  = 1;
            _stopwatch        = new Stopwatch();
            _scpRunnerVms     = new ObservableCollection <ScpRunnerVm>(
                configScpVms.Select
                (
                    c => new ScpRunnerVm(
                        scpParams: c.ConfigScpParamVm.GetParams,
                        sorterGenomeEvalVms:  c.SorterGenomeEvalGridVm.SorterGenomeEvalVms
                        ))
                );

            //var dict = _scpRunnerVms.Select(v=>v.OnIterationResult.Subscribe())
            foreach (var scpRunnerVm in ScpRunnerVms)
            {
                var disp = scpRunnerVm.OnIterationResult.Subscribe(ReportBestResult);
            }
        }