コード例 #1
0
 private void _changeVMToSelection()
 {
     gpData.calculatePositions();
     selectionVM = new SelectionCrossoverViewModel(populationVM._gpContainer);
     selectionVM.beginSelection();
     currentViewModel = selectionVM;
     OnPropertyChanged("currentViewModel");
 }
コード例 #2
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");
                }
            }
        }
コード例 #3
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");
        }
コード例 #4
0
        private bool _canChangeVMToSelection()
        {
            SelectionCrossoverViewModel vm = currentViewModel as SelectionCrossoverViewModel;

            return(vm == null);
        }