particleupdate.java
来自「這是最近蒐集資料找到的Java PSO Swarm 大家可以下載回去參考使用 」· Java 代码 · 共 36 行
JAVA
36 行
package net.sourceforge.jswarm_pso;/** * Particle update strategy * * Every Swarm.evolve() itereation the following methods are called * - begin(Swarm) : Once at the begining of each iteration * - update(Swarm,Particle) : Once for each particle * - end(Swarm) : Once at the end of each iteration * * @author Pablo Cingolani <pcingola@sinectis.com> */public abstract class ParticleUpdate { /** * Constructor * @param particle : Sample of particles that will be updated later */ public ParticleUpdate(Particle particle) { } /** * This method is called at the begining of each iteration * Initialize random vectors use for local and global updates (rlocal[] and rother[]) */ public void begin(Swarm swarm) { } /** Update particle's velocity and position */ public abstract void update(Swarm swarm, Particle particle); /** This method is called at the end of each iteration */ public void end(Swarm swarm) { }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?