コード例 #1
0
        public void CreateGaleShapley()
        {
            NewModel();

            _model.CreateGaleShapleyAlgorithm();
            Assert.AreEqual(1, _context.Algorithms.Count());

            _visitor = new AlgorithmVisitor(null, () => Assert.Fail());
            _visitor.Visit(_context.Algorithms[0].Element);
            Assert.IsTrue(_context.AlgorithmsChanged);
        }
コード例 #2
0
ファイル: AppModelTest.cs プロジェクト: kolpet/szakdolgozat
        public void NewAlgorithmModel()
        {
            NewModel();
            SetupModel setupModel = _model.NewSetupModel();

            setupModel.Initialize();
            ParticipantsModel participantsModel = _model.NewParticipantsModel();

            participantsModel.Initialize();
            PreferencesModel preferencesModel = _model.NewPreferencesModel();

            preferencesModel.Initialize();
            AlgorithmModel algorithmModel = _model.NewAlgorithmModel();

            algorithmModel.Initialize();
            _context.AlgorithmsChanged = false;

            algorithmModel.CreateGaleShapleyAlgorithm();
            Assert.AreEqual(1, _context.Algorithms.Count());

            AlgorithmVisitor _visitor = new AlgorithmVisitor(null, () => Assert.Fail());

            _visitor.Visit(_context.Algorithms[0].Element);
            Assert.IsTrue(_context.AlgorithmsChanged);
        }
コード例 #3
0
        public void RefreshPage()
        {
            NewViewModel();
            _model.CreateGaleShapleyAlgorithm();
            _model.CreateGeneticAlgorithm();

            _viewModel.RefreshPage();
            Assert.AreEqual(2, _viewModel.AlgorithmOptions.Count());
            Assert.IsInstanceOfType(_viewModel.AlgorithmOptions[0], typeof(AlgorithmOptionGaleShapley));
            Assert.IsInstanceOfType(_viewModel.AlgorithmOptions[1], typeof(AlgorithmOptionGenetic));
        }
コード例 #4
0
        private void OnNewGaleShapleyAlgorithmCommand()
        {
            _model.CreateGaleShapleyAlgorithm();
            AlgorithmOptionGaleShapley alg = new AlgorithmOptionGaleShapley(
                _context.GetAlgorithms.Last().Name,
                AlgorithmOptions.Count()
                );

            AlgorithmOptions.Add(alg);
            AlgorithmElements.Add(alg);

            //UpdateGeneticSettings(alg.Index);
            OnPropertyChanged("AlgorithmOptions");
        }
コード例 #5
0
ファイル: RunModelTest.cs プロジェクト: kolpet/szakdolgozat
        private void NewModel()
        {
            _context = new ModelContext();
            SetupModel setupModel = new SetupModel(_context);

            setupModel.Initialize();
            ParticipantsModel participantsModel = new ParticipantsModel(_context);

            participantsModel.Initialize();
            PreferencesModel preferencesModel = new PreferencesModel(_context);

            preferencesModel.Initialize();
            AlgorithmModel algorithmModel = new AlgorithmModel(_context);

            algorithmModel.Initialize();
            algorithmModel.CreateGaleShapleyAlgorithm();
            algorithmModel.CreateGeneticAlgorithm();
            _model = new RunModel(_context);
            _model.Initialize();
            _context.AlgorithmsChanged = false;
        }
コード例 #6
0
        private void NewViewModel()
        {
            _context   = new ModelContext();
            _model     = new RunModel(_context);
            _viewModel = new RunViewModel(_model, _context);

            SetupModel setupModel = new SetupModel(_context);

            setupModel.Initialize();
            ParticipantsModel participantsModel = new ParticipantsModel(_context);

            participantsModel.Initialize();
            PreferencesModel preferencesModel = new PreferencesModel(_context);

            preferencesModel.Initialize();
            AlgorithmModel algorithmModel = new AlgorithmModel(_context);

            algorithmModel.Initialize();

            algorithmModel.CreateGaleShapleyAlgorithm();
            algorithmModel.CreateGeneticAlgorithm();

            _viewModel.RefreshPage();
        }