public void LoadSimulation() { //Load a save; string[] loadedSave = SaveLoad.LoadSimulation(); //CheckCorrection; if (loadedSave.Length != 11) { Debug.LogError("BÅ‚edny Save"); return; } int.TryParse(loadedSave[0], out Size); float.TryParse(loadedSave[1], out Mutation); int.TryParse(loadedSave[2], out LifeTime); int.TryParse(loadedSave[3], out Generation); float.TryParse(loadedSave[4], out startTime); int.TryParse(loadedSave[10], out SchematSize); char IndividualSpacer = 'X'; char Spacer = '|'; string[] temporary = loadedSave[5].Split(Spacer); NeuralSchemat = new int[temporary.Length]; for (int i = 0; i < temporary.Length; i++) { int.TryParse(temporary[i], out NeuralSchemat[i]); } UserInterface.Load.interactable = false; UserInterface.Save.interactable = true; timeOfStartGeneration = Time.time; Population = new Model[Size]; List <int[]> layers = new List <int[]>(); List <float[][]> outputs = new List <float[][]>(); List <float[][][]> weights = new List <float[][][]>(); string[] TemporaryLayers = loadedSave[6].Split(IndividualSpacer); string[] TemporaryOutputs = loadedSave[7].Split(IndividualSpacer); string[] TemporaryInputs = loadedSave[8].Split(IndividualSpacer); for (int p = 0; p < Size; p++) { // temporary = TemporaryLayers[p].Split(Spacer); int[] temp = new int[temporary.Length]; for (int i = 0; i < temporary.Length; i++) { int.TryParse(temporary[i], out temp[i]); } layers.Add(temp); string[] outp = TemporaryOutputs[p].Split(Spacer); float[][] output; output = new float[NeuralSchemat.Length][]; int t = 0; for (int i = 0; i < NeuralSchemat.Length; i++) { output[i] = new float[NeuralSchemat[i]]; for (int j = 0; j < NeuralSchemat[i]; j++) { float.TryParse(outp[t], out output[i][j]); t++; } } outputs.Add(output); string[] inp = TemporaryInputs[p].Split(Spacer); float[][][] input; input = new float[NeuralSchemat.Length - 1][][]; t = 0; for (int i = 0; i < input.Length; i++) { input[i] = new float[NeuralSchemat[i + 1]][]; for (int j = 0; j < input[i].Length; j++) { input[i][j] = new float[NeuralSchemat[i]]; for (int n = 0; n < input[i][j].Length; n++) { float.TryParse(inp[t], out input[i][j][n]); t++; } } } weights.Add(input); Vector3 position = Start; position.x = p * Separate; GameObject a = Instantiate(PreFabs, position, PreFabs.transform.rotation, this.transform.parent); Model b = a.GetComponent <Model>(); b.Creation(layers[p], outputs[p], weights[p], UserInterface, SchematSize); Population[p] = b; Population[p].id = p; Population[p].Name = Population[p].name = p + " model"; } MutaChanseInputField.text = Mutation.ToString(); UserInterface.Popfield.text = Size.ToString(); TimeInput.text = LifeTime.ToString(); UserInterface.DeleteList(); UserInterface.FillList(NeuralSchemat); UserInterface.GenerationInformation.text = Generation + "\t:Generation"; UserInterface.PopulationInformation.text = Size + "\t:Population"; Invoke("Information", 0.1f); string s = Time.time.ToString(); dataRecorder = new DataRecorder(s, Size, NeuralSchemat, SchematSize, LifeTime, Mutation); dataRecorder.output = loadedSave[10]; foreach (var individual in Population) { individual.active = true; } startEvolution = true; }