亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? world.java

?? 遺傳算法源代碼,實現了選擇操作、交叉操作和變異操作
?? JAVA
字號:
/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*//** * World * * location: net.openai.ai.ga.world.World * */package net.openai.ai.ga.world;import net.openai.ai.ga.environment.*;import net.openai.ai.ga.population.*;import net.openai.ai.ga.selection.*;/** * World contains all the information necessary to simulate a complete * genetic algorithm implementation. This includes: * <ul> *   <li>An environment (the problem to be solved) *   <li>A population (possible solutions to solve the problem) *   <li>Parent selection algorithm (ways to choose parents to create new *       solutions to solve the problem) *   <li>Mutation selection algorithm (ways to choose members of the *       population to mutate *   <li>Survival selection algorithm (ways to choose who will survive into *       the next generation * </ul> * <p>One iteration performs the following operations: * <ul> *   <li>Mature the population (increase its age) *   <li>Adjust the environment to fit its population *   <li>Evaluate the population *   <li>Create new offspring *   <li>Mutate the population *   <li>Trim the population * </ul> * @author	Jared Grubb * @version	%I%, %G% * @since	JDK1.3 */public class World implements java.io.Serializable {    /**     * The environment that the population must evaluate against     */    private Environment		    environment;    /**     * The name of this World object. Used in GeneticAlgorithm operations     */    private String		    name;    /**     * The population of this world     */    private Population		    population;    /**     * The parent selection algorithm by which new cells are created.     * This occurs before mutation and before survival selection.     */    private ArraySelectionAlgorithm parentSelection;    /**     * The mutation selection algorithm by which cells in the population     * are selected to mutate. This occurs after parent selection (and may     * therefore include new offspring) but before survival selection.     */    private SelectionAlgorithm      mutationSelection;    /**     * The survival selection algorithm by which the population to survive is     * chosen at the end of an iteration. It occurs after parent selection and     * mutation.     */    private SelectionAlgorithm      survivalSelection;    /**     * The number of generations this world has been iterated through.     */    private int			    generation;    /**     * Reset generation count and create an empty <code>Population</code> and no     * selection algorithms. Gives the world a name.     *     * @param name		a <code>String</code> for the name of this World     */    public World(String name) {	this(name, new Population());    }    /**     * Reset generation count, use the specified <code>Population</code>, and     * initialize no selection algorithms.     *     * @param name		a <code>String</code> for the name of this World     * @param initialPopulation	the inital <code>Population</code> for this World     */    public World(String name, Population initialPopulation) {        this(name, initialPopulation, null, null, null);    }    /**     * Reset generation count and create an empty population and specified     * selection algorithms. Gives the world a name. Assign     *     * @param name a <code>String</code> for the name of this World     * @param parentSelection an <code>ArraySelectionAlgorithm</code>     *          to be used for parent selection.     * @param mutationSelection a <code>SelectionAlgorithm</code>     *          to be used for mutation selection.     * @param survivalSelection a <code>SelectionAlgorithm</code>     *          to be used for survival selection.     */    public World(String name, ArraySelectionAlgorithm parentSelection,    			      SelectionAlgorithm mutationSelection,    			      SelectionAlgorithm survivalSelection) {	this(name, new Population(), parentSelection, mutationSelection,	        survivalSelection);    }    /**     * Reset generation count and create an empty population and specified     * selection algorithms. Gives the world a name. Assign     *     * @param name a <code>String</code> for the name of this World     * @param initialPopulation	the inital <code>Population</code> for this World     * @param parentSelection an <code>ArraySelectionAlgorithm</code>     *          to be used for parent selection.     * @param mutationSelection a <code>SelectionAlgorithm</code>     *          to be used for mutation selection.     * @param survivalSelection a <code>SelectionAlgorithm</code>     *          to be used for survival selection.     */    public World(String name, Population initialPopulation,                              ArraySelectionAlgorithm parentSelection,    			      SelectionAlgorithm mutationSelection,    			      SelectionAlgorithm survivalSelection) {        this.generation = 0;        this.population = initialPopulation;	this.parentSelection = parentSelection;	this.mutationSelection= mutationSelection;	this.survivalSelection= survivalSelection;    }    /**     * Returns the name of this World.     *     * @return	a <code>String</code> containing the name of this World     */    public String getName() {	return this.name;    }    /**     * Returns a string showing the current status of this World. Returns     * the name of the World followed by the String returned by the     * Population's toString().     *     * @return	a <code>String</code> showing the status of this World     */    public String toString() {	return this.getName() + ":" + this.population;    }    /**     * Returns the Environment assigned to this World.     *     * @return	the <code>Environment</code> assigned to this World     */    public Environment getEnvironment() {	return this.environment;    }    /**     * Sets the Environment used in this World.     *     * @param newEnvironment the <code>Environment</code> to use in this World     */    public void setEnvironment(Environment newEnvironment) {	this.environment = newEnvironment;    }    /**     * Returns the Population assigned to this World.     *     * @return	the <code>Population</code> assigned to this World     */    public Population getPopulation() {	return this.population;    }    /**     * Sets the Population used in this World.     *     * @param newPopulation the <code>Population</code> to use in this World     */    public void setPopulation(Population newPopulation) {	this.population = newPopulation;    }    /**     * Iterates this World through one generation. Does the following items:     * <ul>     *   <li>Calls the environment's reactToPopulation method     *   <li>Matures the population     *   <li>Evaluates the population     *   <li>Creates new offspring     *   <li>Mutates the population     *   <li>Trims the population     * </ul>     */    public void iterate() {	this.generation++;	this.environment.reactToPopulation(this.population);	this.maturePopulation();	this.evaluatePopulation();	this.createOffspring();	this.mutatePopulation();	this.trimPopulation();    }    /**     * Calls the Population's mature method.     */    private void maturePopulation() {	this.population.mature();    }    /**     * Calls the Population's evaluate method.     */    private void evaluatePopulation() {	this.population.evaluate(environment);    }    /**     * Subjects the population to the parent selection algorithm and passes the     * returned PopulationArray to the Population's <code>combine()</code>     * method.     */    private void createOffspring() {	PopulationArray parents =	    this.parentSelection.selectFromPopulation(this.population);	this.population.combine(parents);    }    /**     * Subjects the population to the mutation selection algorithm and passes     * the returned Population to the Population's <code>mutate()</code>     * method.     */    private void mutatePopulation() {	Population mutants =	    this.mutationSelection.selectFromPopulation(this.population);	this.population.mutate(mutants);    }    /**     * Subjects the population to the survival selection algorithm and sets the     * population to equal the Population returned.     */    private void trimPopulation() {	Population oldPop = new Population(this.population);	this.population.removeAllCellsBut(		this.survivalSelection.selectFromPopulation(this.population));	oldPop.removeCells(this.population);	Population.condemnPopulation(oldPop);    }    /**     * Sets the parent selection algorithm to the given algorithm. This     * algorithm is used to determine the groups of cells that will be used     * to create offspring.     *     * @param parentSelection a <code>ArraySelectionAlgorithm</code> to set to     */    public void setParentSelectionAlgorithm(    		ArraySelectionAlgorithm parentSelection) {	this.parentSelection = parentSelection;    }    /**     * Returns the current parent selection algorithm.     *     * @return the parent-selection <code>ArraySelectionAlgorithm</code>     */    public ArraySelectionAlgorithm getParentSelectionAlgorithm() {	return this.parentSelection;    }    /**     * Sets the mutation selection algorithm to the given algorithm. This     * algorithm is used to determine the cells that will subjected to     * mutation.     *     * @param mutationSelection a <code>SelectionAlgorithm</code> to set to     */    public void setMutationSelectionAlgorithm(    		SelectionAlgorithm mutationSelection) {	this.mutationSelection = mutationSelection;    }    /**     * Returns the current mutation selection algorithm. This algorithm is     * used to determine the cells that will subjected to mutation.     *     * @return the mutation-selection <code>SelectionAlgorithm</code>     */    public SelectionAlgorithm getMutationSelectionAlgorithm() {	return this.mutationSelection;    }    /**     * Sets the survival selection algorithm to the given algorithm. This     * algorithm is used to determine the cells that will survive into     * the next generation.     *     * @param survivalSelection a <code>SelectionAlgorithm</code> to set to     */    public void setSurvivalSelectionAlgorithm(    		SelectionAlgorithm survivalSelection) {	this.survivalSelection = survivalSelection;    }    /**     * Returns the current survival selection algorithm. This algorithm is     * used to determine the cells that will survive into the next generation.     *     * @return the mutation-selection <code>SelectionAlgorithm</code>     */    public SelectionAlgorithm getSurvivalSelectionAlgorithm() {	return this.survivalSelection;    }}/*--- formatting done in "Sun Java Convention" style on 12-28-2000 ---*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品中文在线影院| 激情欧美一区二区| 久久国产福利国产秒拍| 成人在线视频首页| 7777女厕盗摄久久久| 国产日产欧美一区二区三区| 亚洲一级片在线观看| 成人av影院在线| 精品久久久久久久久久久久久久久| 自拍偷拍亚洲激情| 成人综合在线观看| 欧美大片在线观看一区二区| 亚洲午夜免费福利视频| 欧美顶级少妇做爰| 亚洲视频每日更新| 成人国产精品免费观看| 久久亚洲捆绑美女| 久久av资源网| 欧美一区二区视频在线观看2022| 一区二区三区在线视频免费| 99久免费精品视频在线观看| 欧美国产欧美综合| 国产ts人妖一区二区| 久久久精品一品道一区| 国产一区二区三区在线观看免费 | 日韩一区二区免费电影| 亚洲麻豆国产自偷在线| 成人黄色av网站在线| 久久久久国色av免费看影院| 国产主播一区二区| 久久久亚洲精品一区二区三区| 久久精品久久99精品久久| 欧美一级专区免费大片| 免费成人在线观看| 欧美精品一区二区三区蜜臀| 国产美女av一区二区三区| 精品国产伦一区二区三区免费| 日本在线不卡一区| 欧美大度的电影原声| 激情欧美一区二区| 日本一区二区高清| 99久久精品99国产精品| 亚洲自拍偷拍麻豆| 欧美日本一区二区| 黄色日韩三级电影| 国产精品美女www爽爽爽| 91麻豆免费观看| 亚洲欧美国产三级| 欧美老年两性高潮| 九色|91porny| 国产精品天干天干在观线| 色屁屁一区二区| 偷拍一区二区三区四区| 精品久久一区二区| 成人av资源站| 亚洲福利一区二区三区| 精品动漫一区二区三区在线观看| 国产成人精品三级| 亚洲三级视频在线观看| 7777精品伊人久久久大香线蕉最新版| 国内欧美视频一区二区| 亚洲欧洲日韩综合一区二区| 欧美日韩高清一区二区不卡 | 91在线云播放| 天堂一区二区在线| 国产女人18毛片水真多成人如厕 | 一区二区三区高清| 精品国产一区二区国模嫣然| 成人av网址在线观看| 婷婷激情综合网| 中文字幕欧美激情一区| 欧美午夜宅男影院| 国产成人免费在线观看| 丝袜美腿亚洲一区| 日韩一区有码在线| 欧美成人精品1314www| 91亚洲大成网污www| 老司机精品视频在线| 亚洲男人的天堂一区二区| 日韩美女天天操| 一本大道av伊人久久综合| 精品在线你懂的| 一级日本不卡的影视| 久久嫩草精品久久久精品 | 色综合久久88色综合天天免费| 日韩电影一区二区三区| 国产精品婷婷午夜在线观看| 日韩视频免费直播| 欧美在线视频全部完| 国产91精品露脸国语对白| 免费在线欧美视频| 亚洲va中文字幕| 一区二区三区波多野结衣在线观看 | 久久精品亚洲精品国产欧美kt∨| 欧美视频一区二区| 一本到高清视频免费精品| 国产·精品毛片| 国产一区二区精品久久99| 美女性感视频久久| 日本女优在线视频一区二区| 亚洲电影欧美电影有声小说| 一区二区三区四区蜜桃| 中文字幕乱码久久午夜不卡 | 成人中文字幕电影| 国产成人免费视频一区| 精久久久久久久久久久| 精品一区二区三区香蕉蜜桃 | 国产精品一区二区三区乱码| 精品综合久久久久久8888| 免费欧美高清视频| 首页综合国产亚洲丝袜| 亚洲一卡二卡三卡四卡五卡| 亚洲国产cao| 日韩中文字幕区一区有砖一区| 香蕉久久一区二区不卡无毒影院| 亚洲午夜久久久久久久久电影网 | 日韩欧美一级特黄在线播放| 欧美日韩视频在线一区二区| 欧美日韩视频一区二区| 欧美日韩日日摸| 337p亚洲精品色噜噜| 日韩视频永久免费| 欧美v国产在线一区二区三区| 91精品国产综合久久福利软件| 91精品欧美福利在线观看| 91精品国产乱码久久蜜臀| 日韩欧美色综合网站| 久久综合五月天婷婷伊人| 国产亚洲欧美激情| 国产精品美女久久久久av爽李琼 | 国产午夜精品一区二区三区嫩草| 久久免费精品国产久精品久久久久| 精品日韩欧美一区二区| 精品粉嫩aⅴ一区二区三区四区| 国产欧美综合在线观看第十页 | 99这里只有久久精品视频| 99久久精品国产一区| 欧美欧美欧美欧美首页| 欧美成人video| 亚洲欧美一区二区在线观看| 亚洲成人在线网站| 激情图区综合网| 色婷婷av一区二区三区大白胸| 欧美午夜精品久久久久久孕妇| 日韩你懂的在线播放| 中文字幕中文在线不卡住| 亚洲午夜久久久久久久久久久| 精品一区二区三区免费视频| 99久久免费精品高清特色大片| 欧美亚洲国产一区二区三区| 亚洲精品一区二区三区99| 亚洲激情六月丁香| 国产一区视频网站| 欧美午夜片在线观看| 久久久噜噜噜久久人人看 | 日韩一二三四区| 欧美国产丝袜视频| 免费成人在线播放| 色综合久久久久久久久久久| 精品卡一卡二卡三卡四在线| 一区二区三国产精华液| 国内一区二区视频| 欧美一区日韩一区| 亚洲人成网站精品片在线观看| 日韩精品亚洲专区| 在线视频国内自拍亚洲视频| 亚洲国产成人自拍| 久久精品国产亚洲a| 欧美日韩中文另类| √…a在线天堂一区| 国产一区视频在线看| 日韩亚洲欧美综合| 亚洲成a人v欧美综合天堂下载| 国产成人精品午夜视频免费| 日韩免费观看2025年上映的电影| 亚洲与欧洲av电影| 99精品偷自拍| 久久亚洲精品小早川怜子| 免费日韩伦理电影| 欧美麻豆精品久久久久久| 亚洲精品你懂的| 成人av综合在线| 国产精品久久三| 国产精品一级片在线观看| 精品少妇一区二区| 天天爽夜夜爽夜夜爽精品视频 | av电影一区二区| 欧美国产欧美综合| 国产精品一区二区男女羞羞无遮挡| 欧美久久久久久蜜桃| 一区二区三区四区乱视频| 91视频www| 亚洲欧美欧美一区二区三区| 99视频热这里只有精品免费| 中文字幕成人在线观看| 国产美女一区二区| 国产精品每日更新| 91麻豆免费看| 亚洲第一综合色| 欧美男人的天堂一二区|