arrayselectionalgorithm.java
来自「遗传算法源代码,实现了选择操作、交叉操作和变异操作」· Java 代码 · 共 59 行
JAVA
59 行
/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*//** * ArraySelectionAlgorithm Class * * location: net.openai.ai.ga.selection.ArraySelectionAlgorithm * */package net.openai.ai.ga.selection;import net.openai.ai.ga.population.*;/** * <code>ArraySelectionAlgorithm</code> is a method by which <code> * Population</code> members are created and chosen from a * <code>Population</code>. This algorithm is used for the selection of * parents for recombination (reproduction). * * @author Jared Grubb * @version %I%, %G% * @since JDK1.3 */public interface ArraySelectionAlgorithm { /** * Creates a <code>PopulationArray</code> according to a given algorithm * or rule. The initial <code>Population</code> is passed and a selection * from it is chosen and returned. * * <p>This function is passed a shallow clone of the original population, * therefore allowing additions and deletions to the passed population * without worry about how it affects the original. Any changes meant for * the original <code>Population</code> should be handled through the * recombination and survival implementations of this algorithm. * * <p>The returned <code>PopulationArray</code> should not be considered * crucial to any internal functions of this implementation of the <code> * ArraySelectionAlgorithm</code>, since the genetic algorithm may make * changes directly onto this structure and may make the structure * available for others to make changes to. If the structure is needed * internally and such behavior could be detrimental to this * implementation's function, then it is recommended that a shallow * clone be returned via a <code>return new * PopulationArray(returnPopulationArray)</code> rather than a plain * <code>return returnPopulationArray</code>. This allows for this * additional overhead to be avoided in cases where it not needed. * * @param pop the <code>Population</code> to choose from * @return a <code>PopulationArray</code> derived from the passed * <code>Population</code> * */ public PopulationArray selectFromPopulation(Population pop);}/*--- formatting done in "Sun Java Convention" style on 12-28-2000 ---*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?