public void Start()
        {
            DatabaseId = ArgumentStore.IdToLoad ?? DatabaseId;

            DbHandler = new EvolutionDatabaseHandler();

            EvolutionConfig = DbHandler.ReadConfig(DatabaseId);

            DbHandler.SetAutoloadId(DatabaseId);

            if (EvolutionConfig == null || EvolutionConfig.DatabaseId != DatabaseId)
            {
                throw new Exception("Did not retrieve expected config from database");
            }

            _matchControl = gameObject.GetComponent <EvolutionMatchController>();
            if (_matchControl == null)
            {
                _matchControl = gameObject.AddComponent <EvolutionMatchController>();
            }

            _mutationControl.Config = EvolutionConfig.MutationConfig;
            _matchControl.Config    = EvolutionConfig.MatchConfig;
            ShipConfig.Config       = EvolutionConfig.MatchConfig;

            ReadInGeneration();

            SpawnRaceGoal();

            SpawnShips();

            SpawnDrones();
        }
Exemple #2
0
        public override void PopulateControls(EvolutionConfig config)
        {
            _loaded      = config ?? new EvolutionConfig();
            RunName.text = _loaded.RunName;
            MinMatchesPerIndividual.text   = _loaded.MinMatchesPerIndividual.ToString();
            WinnersFromEachGeneration.text = _loaded.WinnersFromEachGeneration.ToString();

            _generationNumber = _loaded.GenerationNumber;
        }
Exemple #3
0
        public EvolutionConfig ReadControls()
        {
            _loaded         = _loaded ?? new EvolutionConfig();
            _loaded.RunName = RunName.text;
            _loaded.MinMatchesPerIndividual   = int.Parse(MinMatchesPerIndividual.text);
            _loaded.WinnersFromEachGeneration = int.Parse(WinnersFromEachGeneration.text);
            _loaded.GenerationNumber          = _generationNumber;

            return(_loaded);
        }
Exemple #4
0
        public override void PopulateControls(EvolutionConfig config)
        {
            _loaded = config.MutationConfig;

            Mutations.text         = _loaded.Mutations.ToString();
            MaxMutationLength.text = _loaded.MaxMutationLength.ToString();
            GenomeLength.text      = _loaded.GenomeLength.ToString();
            GenerationSize.text    = _loaded.GenerationSize.ToString();
            UseCompletelyRandomDefaultGenome.text = _loaded.UseCompletelyRandomDefaultGenome.ToString();
            DefaultGenome.text = _loaded.DefaultGenome.ToString();
        }
Exemple #5
0
        public override void PopulateControls(EvolutionConfig config)
        {
            _loaded = config.MatchConfig;

            MatchTimeout.text       = _loaded.MatchTimeout.ToString();
            WinnerPollPeriod.text   = _loaded.WinnerPollPeriod.ToString();
            InitialRange.text       = _loaded.InitialRange.ToString();
            InitialSpeed.text       = _loaded.InitialSpeed.ToString();
            RandomInitialSpeed.text = _loaded.RandomInitialSpeed.ToString();
            CompetitorsPerTeam.text = _loaded.CompetitorsPerTeam.ToString();
            AllowedModules.text     = _loaded.AllowedModulesString;
            Budget.text             = _loaded.Budget.ToString();
        }
 public abstract void PopulateControls(EvolutionConfig config);