Example #1
0
        private static void SaveChampionGenome()
        {
            string filename = string.Format("{0}_{1:d}_{2:yyyyMMdd_HHmmss}.gnm.xml",
                                            _options.ChampionPrefix, _ea.CurrentGeneration, DateTime.Now);

            // Save genome to xml file.
            using (XmlWriter xw = XmlWriter.Create(filename, XwSettings))
            {
                _experiment.SavePopulation(xw, new[] { _ea.CurrentChampGenome });
            }
        }
Example #2
0
    public string GenomeListToXmlString()
    {
        // Save genomes to xml file.
        XmlWriterSettings xwSettings = new XmlWriterSettings();

        xwSettings.Indent = true;
        StringBuilder sBuilder = new StringBuilder();

        using (XmlWriter xw = XmlWriter.Create(sBuilder, xwSettings))
        {
            experiment.SavePopulation(xw, contentEA.GenomeList);
        }

        return(sBuilder.ToString());
    }