00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Math Library 00005 * Module : IGAChromosome 00006 * Package : Zeus.ZeusMath.Intel.Interfaces 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 00033 #ifndef IGAChromosomeHPP 00034 #define IGAChromosomeHPP 00035 00036 #include <zeusmath/Intel/Interfaces/IGAGene.hpp> 00037 #include <zeusmath/Config/PlatformDefines.hpp> 00038 #include <zeusbase/System/Interfaces/IArray.hpp> 00039 #include <zeusbase/System/Interfaces/IByteArray.hpp> 00040 00041 // {46C1F667-A6A2-4302-9117-E3B8593AF42A} 00042 #define INTERFACE_IGAChromosome TIID(0x46c1f667, 0xa6a2, 0x4302, 0x91, 0x17, 0xe3, 0xb8, 0x59, 0x3a, 0xf4, 0x2a) 00043 00044 BEGIN_NAMESPACE_Zeus 00045 00046 /***************************************************************************/ 00049 /***************************************************************************/ 00050 class IGAChromosome : public IZUnknown 00051 { 00052 HIDE_ASSIGNMENT_OPERATOR(IGAChromosome) 00053 00054 public: 00055 00056 /***********************************************************************/ 00060 /***********************************************************************/ 00061 virtual Uint MQUALIFIER getChromosomeID() const = 0; 00062 00063 /***********************************************************************/ 00066 /***********************************************************************/ 00067 virtual IByteArray& MQUALIFIER getDNA() = 0; 00068 00069 /***********************************************************************/ 00072 /***********************************************************************/ 00073 virtual const IByteArray& MQUALIFIER getDNAConst() const = 0; 00074 00075 /***********************************************************************/ 00079 /***********************************************************************/ 00080 virtual Int MQUALIFIER getGeneCount() const = 0; 00081 00082 /***********************************************************************/ 00086 /***********************************************************************/ 00087 virtual Int MQUALIFIER getGeneSize() const = 0; 00088 00089 /***********************************************************************/ 00095 /***********************************************************************/ 00096 virtual IGAGene& MQUALIFIER getGene(Int iIndex) = 0; 00097 00098 /***********************************************************************/ 00104 /***********************************************************************/ 00105 virtual const IGAGene& MQUALIFIER getGeneConst(Int iIndex) const = 0; 00106 00107 /***********************************************************************/ 00119 /***********************************************************************/ 00120 virtual Retval MQUALIFIER crossOver(IGAChromosome& rChrom, IGAChromosome*& rpNewChrom1, IGAChromosome*& rpNewChrom2)=0; 00121 00122 /***********************************************************************/ 00128 /***********************************************************************/ 00129 virtual Retval MQUALIFIER clone(IGAChromosome*& rpNewChrom) const = 0; 00130 00131 /***********************************************************************/ 00134 /***********************************************************************/ 00135 virtual void MQUALIFIER mutate() =0; 00136 }; 00137 00138 END_NAMESPACE_Zeus 00139 00140 #endif