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

📄 swarmrepulsive.java

📁 這是最近蒐集資料找到的Java PSO Swarm 大家可以下載回去參考使用 理面文件有原出處以及作者 請大家要記得尊重版權
💻 JAVA
字号:
package net.sourceforge.jswarm_pso;/** * A swarm of repulsive particles * @author Pablo Cingolani <pcingola@sinectis.com> */public class SwarmRepulsive extends Swarm {	public static double DEFAULT_OTHER_PARTICLE_INCREMENT = 0.9;	public static double DEFAULT_RANDOM_INCREMENT = 0.1;	/** Other particle increment */	double otherParticleIncrement;	/** Random increment */	double randomIncrement;	/**	 * Create a Swarm and set default values	 * @param numberOfParticles : Number of particles in this swarm (should be greater than 0). 	 * If unsure about this parameter, try Swarm.DEFAULT_NUMBER_OF_PARTICLES or greater	 * @param sampleParticle : A particle that is a sample to build all other particles	 * @param fitnessFunction : Fitness function used to evaluate each particle	 */	public SwarmRepulsive(int numberOfParticles, Particle sampleParticle, FitnessFunction fitnessFunction) {		super(numberOfParticles, sampleParticle, fitnessFunction);		this.otherParticleIncrement = DEFAULT_OTHER_PARTICLE_INCREMENT;		this.randomIncrement = DEFAULT_RANDOM_INCREMENT;		// Set up particle update strategy (default: ParticleUpdateRepulsive) 		this.particleUpdate = new ParticleUpdateRepulsive(sampleParticle);	}	public double getOtherParticleIncrement() {		return otherParticleIncrement;	}	public double getRandomIncrement() {		return randomIncrement;	}	public void setOtherParticleIncrement(double otherParticleIncrement) {		this.otherParticleIncrement = otherParticleIncrement;	}	public void setRandomIncrement(double randomIncrement) {		this.randomIncrement = randomIncrement;	}}

⌨️ 快捷键说明

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