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"); } } }
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"); }
private bool _canChangeVMToFitness() { FitnessViewModel vm = currentViewModel as FitnessViewModel; return(vm == null); }
private void _changeVMToFitness() { fitnessVM = new FitnessViewModel(populationVM._gpContainer); currentViewModel = fitnessVM; OnPropertyChanged("currentViewModel"); }