⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abstractenvironment.java

📁 遗传算法源代码,实现了选择操作、交叉操作和变异操作
💻 JAVA
字号:
/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*//** * AbstractEnvironment Class * * location: net.openai.ai.ga.environment.AbstractEnvironment * */package net.openai.ai.ga.environment;import net.openai.ai.ga.population.*;/** * The <code>AbstractEnvironment</code> is the encapsulation of the problem that * the population will try to solve. This class provides a skeletal * implementation to minimize the effort needed to implement a simple * <code>Environment</code> interface. * * @author	Jared Grubb * @version	%I%, %G% * @since	JDK1.3 */public abstract class AbstractEnvironment implements Environment {    protected int environmentGeneration;    /**     * Tells the <code>AbstractEnvironment</code> to react to the given <code>     * Population</code>. This allows for evolution of the problem model     * according to what its population is. This method is called by a     * <code>World</code> during each Iteration and may also be used as an     * age counter. For many programs, this function may be stubbed {} in     * cases when the problem does not need to evolve.     *     * This skeletal implementation increments a variable, <code>generation     * </code> that stores what generation this class is in.     *     * @param pop	the <code>Population</code> that works on it     */    public void reactToPopulation(Population pop) {        this.environmentGeneration++;    }}/*--- formatting done in "Sun Java Convention" style on 12-28-2000 ---*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -