//Loads a environment from an XML file and initializes it public static ExperimentWrapper load(string name) { System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(ExperimentWrapper)); TextReader infile = new StreamReader(name); ExperimentWrapper e = (ExperimentWrapper)x.Deserialize(infile); infile.Close(); //TODO include LEO //Determine the number of CPPN inputs and outputs automatically //if (e.experiment.homogeneousTeam) // e.experiment.inputs = 4; //else // e.experiment.inputs = 5; //if (e.experiment.adaptableANN) //{ // if (e.experiment.modulatoryANN) e.experiment.outputs = 8; else e.experiment.outputs = 7; //} //else // e.experiment.outputs = 2; //TODO maybe include e.experiment.initialize(); return(e); }
private void saveExperimentToolStripMenuItem_Click(object sender, EventArgs e) { fileSaveDialog.Title = "Save Experiment"; DialogResult res = fileSaveDialog.ShowDialog(this); string filename = fileSaveDialog.FileName; if (res == DialogResult.OK || res == DialogResult.Yes) { ExperimentWrapper wr = new ExperimentWrapper(); wr.experiment = experiment; wr.save(filename); //experiment.save(filename); } }