environment.java
来自「遗传算法源代码,实现了选择操作、交叉操作和变异操作」· Java 代码 · 共 45 行
JAVA
45 行
/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*//** * Environment Interface * * location: net.openai.ai.ga.environment.Environment * */package net.openai.ai.ga.environment;import net.openai.ai.ga.population.*;/** * The Environment is the encapsulation of the problem that the population * will try to solve. It is provided as an interface so as to allow maximum * flexibility for the type of implementation an Environment can be. The * Environment is passed along to every Cell in the Population. The Population * and the World groups are completely ignorant of what is in the Environment * (except for the methods included in this interface). Therefore, the Cells * (the possible solutions) are fitted to the Environment (the problem) and * must know how to communicate with it. * @author Jared Grubb * @version %I%, %G% * @since JDK1.3 */public interface Environment { /** * Tells the <code>Environment</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. * * @param pop the <code>Population</code> that works on it */ void reactToPopulation(Population pop);}/*--- formatting done in "Sun Java Convention" style on 12-28-2000 ---*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?