Beispiel #1
0
        /// <summary>
        /// Display simple Onscreen buttons for quickly accessing ceratain lifecycle funtions and to display generation info.
        /// </summary>
        private void OnGUI()
        {
            if (GUI.Button(new Rect(10, 10, 110, 40), "Start EA"))
            {
                _neatSupervisor.StartEvolution();
            }
            if (GUI.Button(new Rect(10, 60, 110, 40), "Stop + save EA"))
            {
                _neatSupervisor.StopEvolution();
            }
            if (GUI.Button(new Rect(10, 110, 110, 40), "Run best"))
            {
                _neatSupervisor.RunBest();
            }
            if (GUI.Button(new Rect(10, 160, 110, 40), "Delete Saves"))
            {
                ExperimentIO.DeleteAllSaveFiles(_neatSupervisor.Experiment);
            }

            GUI.Button(new Rect(10, Screen.height - 70, 110, 60), string.Format("Generation: {0}\nFitness: {1:0.00}", _neatSupervisor.CurrentGeneration, _neatSupervisor.CurrentBestFitness));
        }
 public List <NeatGenome> LoadChampions()
 {
     return(ExperimentIO.ReadChampions(this));
 }
 /// <summary>
 /// Loads the saved champion genome from the champion safe file of this experiment (by default: myexperimentname.champ.xml).
 /// If the file does not exist, then null is returned
 /// </summary>
 public NeatGenome LoadChampion()
 {
     return(ExperimentIO.ReadChampion(this));
 }
 /// <summary>
 /// Saves the specified genome to the champion safe file of this experiment (by default: myexperimentname.champ.xml)
 /// </summary>
 public bool SaveChampion(NeatGenome bestGenome)
 {
     return(ExperimentIO.WriteChampion(this, bestGenome));
 }
 /// <summary>
 /// Loads the saved population from the population safe file of this experiment (by default: myexperimentname.pop.xml).
 /// If the file does not exist, then a new population is created and returned.
 /// </summary>
 public List <NeatGenome> LoadPopulation()
 {
     return(ExperimentIO.ReadPopulation(this));
 }
 public bool SaveChampions(IList <NeatGenome> genomeList)
 {
     return(ExperimentIO.WriteChampions(this, genomeList));
 }
 /// <summary>
 /// Saves the specified genomes to the population safe file of this experiment (by default: myexperimentname.pop.xml)
 /// </summary>
 public bool SavePopulation(IList <NeatGenome> genomeList)
 {
     return(ExperimentIO.WritePopulation(this, genomeList));
 }