/// <summary>
        /// Accept a new seed program that should be inserted into the next
        /// Population generation.
        /// </summary>
        /// <param name="xmlBytes"></param>
        public void AddSeedProgram(byte[] xmlBytes)
        {
            String             ProgramXML = DecompressProgram(xmlBytes);
            GPProgramReaderXML xmlReader  = new GPProgramReaderXML(ProgramXML, m_FunctionSet);
            GPProgram          Program    = xmlReader.Construct();

            if (Program != null)
            {
                Program.ConvertToArray(m_FunctionSet);
                m_SeedPrograms.Add(Program);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Construct a GPProgram object from an XML program description
        /// </summary>
        /// <param name="ProgramXML">Program XML string</param>
        /// <returns>True/False depending upon success or failure</returns>
        public bool ProgramFromXML(String ProgramXML)
        {
            GPProgramReaderXML xmlReader = new GPProgramReaderXML(ProgramXML, m_FunctionSet);

            m_Program = xmlReader.Construct();

            if (m_Program == null)
            {
                return(false);
            }

            return(true);
        }