Ejemplo n.º 1
0
        private void ShowBrainExecute()
        {
            if (_agent == null)
            {
                return;
            }

            var window = new BrainWindow {DataContext = new AgentBrainViewModel(_agent)};
            window.ShowDialog();
        }
Ejemplo n.º 2
0
        private void ShowBestAgent(AgentType agentType)
        {
            if (SelectedAge == null)
            {
                MessageBox.Show("Age should be selected", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            var bestAgent = SelectedAge.GetLandscape().Statistics.GetMaxAgeAgent(agentType);
            if (bestAgent == null)
            {
                MessageBox.Show("The best " + agentType + " is not determined yet", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            var viewModel = new AgentBrainViewModel(bestAgent);
            var window = new BrainWindow();
            window.DataContext = viewModel;
            window.ShowDialog();
        }