コード例 #1
0
        private async void _startAutomaticProgress()
        {
            if (isAutomatic)
            {
                while (isAutomatic)
                {
                    isAutomaticInProgress = true;
                    fitnessVM             = new FitnessViewModel(populationVM._gpContainer);
                    await fitnessVM.beginFitnessEvaluation();

                    selectionVM = new SelectionCrossoverViewModel(populationVM._gpContainer);
                    selectionVM.beginSelection();
                    isAutomaticInProgress = false;
                    _changeVMToPopulationUpdate();
                    OnPropertyChanged("gpData");
                }
            }
        }
コード例 #2
0
        public DefaultViewModel()
        {
            gpData = new GeneticManagement();

            entryVM      = new EntryViewModel();
            populationVM = new PopulationViewModel();
            highlightVM  = new HighlightViewModel();
            fitnessVM    = new FitnessViewModel();
            selectionVM  = new SelectionCrossoverViewModel();

            initPopulationCommand = new RelayCommand(x => this._newPopulation(), x => this._canChangeVMToPopulation());
            populationCommand     = new RelayCommand(x => _changeVMToPopulation(x), x => _canChangeVMToPopulation());
            mainMenuCommand       = new RelayCommand(x => this._changeVMToEntry(), x => this._canChangeVMToEntry());
            highlightCommand      = new RelayCommand(x => this._changeVMToHighlight(x), x => this._canChangeVMToHighlight(x));
            fitnessCommand        = new RelayCommand(x => _changeVMToFitness(), x => _canChangeVMToFitness());
            selectionCommand      = new RelayCommand(x => _changeVMToSelection(), x => _canChangeVMToSelection());
            newGenCommand         = new RelayCommand(x => _changeVMToPopulationUpdate(), x => true);

            currentViewModel = entryVM;
            OnPropertyChanged("currentViewModel");
        }
コード例 #3
0
        private bool _canChangeVMToFitness()
        {
            FitnessViewModel vm = currentViewModel as FitnessViewModel;

            return(vm == null);
        }
コード例 #4
0
 private void _changeVMToFitness()
 {
     fitnessVM        = new FitnessViewModel(populationVM._gpContainer);
     currentViewModel = fitnessVM;
     OnPropertyChanged("currentViewModel");
 }