Exemplo n.º 1
0
 public Training(Models.GameConfiguration gc)
 {
     InitializeComponent();
     stopped = false;
     this.gc = gc;
     Btn_StopTraining.IsEnabled = false;
 }
Exemplo n.º 2
0
 public MainWindow()
 {
     InitializeComponent();
     gc      = new Models.GameConfiguration();
     menu    = new MainMenu(gc);
     Content = menu;
 }
Exemplo n.º 3
0
        public GamePage(Models.GameConfiguration gc, Game game)
        {
            InitializeComponent();

            this.game = game;
            this.gc   = gc;
        }
Exemplo n.º 4
0
        private void Btn_LoadConfig_Click(object sender, RoutedEventArgs e)
        {
            var openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Json file (*.json)|*.json";
            if (openFileDialog.ShowDialog() == true)
            {
                Models.GameConfiguration gc = Models.GameConfiguration.FromJson(File.ReadAllText(openFileDialog.FileName));
                SetConfiguration(gc);
            }
        }
Exemplo n.º 5
0
        public void SetConfiguration(Models.GameConfiguration gc)
        {
            NeuronCount.Value         = gc.NeuronCount;
            LayerCount.Value          = gc.LayerCount;
            MemoryNeuronCount.Value   = gc.MemoryNeuronCount;
            BaseEvolutionFactor.Value = gc.BaseEvolutionFactor;

            NumberOfAIs.Value     = gc.NumberOfAIs;
            KeepBestAIs.Value     = gc.KeepBestAIs;
            MaximumChildren.Value = gc.MaximumChildrenPerAi;
            GameLength.Value      = gc.GameLength;
            SaveBestAIAfterEveryRound.IsChecked  = gc.SaveBestAIAfterEveryRound;
            SaveBestAIAfterStoppingSim.IsChecked = gc.SaveBestAIAfterStoppingSim;

            InitialBallSpeed.Value   = gc.InitialBallSpeed;
            BallSpeedIncrement.Value = gc.BallSpeedIncrement;
            PaddleSpeed.Value        = gc.PaddleSpeed;
        }
Exemplo n.º 6
0
        public Models.GameConfiguration GetGameConfiguration()
        {
            Models.GameConfiguration gc = new Models.GameConfiguration()
            {
                NeuronCount                = (int)NeuronCount.Value,
                LayerCount                 = (int)LayerCount.Value,
                MemoryNeuronCount          = (int)MemoryNeuronCount.Value,
                BaseEvolutionFactor        = (int)BaseEvolutionFactor.Value,
                NumberOfAIs                = (uint)NumberOfAIs.Value,
                KeepBestAIs                = (uint)KeepBestAIs.Value,
                MaximumChildrenPerAi       = (uint)MaximumChildren.Value,
                GameLength                 = (int)GameLength.Value,
                SaveBestAIAfterEveryRound  = (bool)SaveBestAIAfterEveryRound.IsChecked,
                SaveBestAIAfterStoppingSim = (bool)SaveBestAIAfterStoppingSim.IsChecked,
                InitialBallSpeed           = (float)InitialBallSpeed.Value,
                BallSpeedIncrement         = (float)BallSpeedIncrement.Value,
                PaddleSpeed                = (float)PaddleSpeed.Value
            };

            return(gc);
        }
Exemplo n.º 7
0
 public MainMenu(Models.GameConfiguration gc)
 {
     InitializeComponent();
     this.gc = gc;
 }
Exemplo n.º 8
0
 public GameConfiguration(Models.GameConfiguration gc)
 {
     InitializeComponent();
     SetConfiguration(gc);
 }
Exemplo n.º 9
0
 public PlayGame(Models.GameConfiguration gc)
 {
     InitializeComponent();
     this.gc = gc;
 }