Exemplo n.º 1
0
        public void LoadData(string filePath)
        {
            SaveData save = FileReadWrite.ReadFromJsonFile <SaveData>(filePath);

            for (int i = 0; i < loadExternalGenes; i++)
            {
                Population.Add(save.SavedMember[i]);
            }
        }
Exemplo n.º 2
0
        // Saving and Retrieving data
        public void SaveData(string filePath)
        {
            SaveData save = new SaveData {
                SavedMember = new List <NeuralNetwork>()
            };

            for (int i = 0; i < saveGenes; i++)
            {
                save.SavedMember.Add(Population[i]);
            }

            FileReadWrite.WriteToJsonFile(filePath, save);
        }