This repository contains a JAVA code implementation for the Particle Swarm Optimization (PSO) algorithm in solving the N-Queens problem.
Classes include:
Particle.java- class which contains the solutions.
ParticleSwarmOptimization.java - class which implements the PSO algorithm for N-Queens. Algorithm parameters are defined here.
Writer.java - class which holds a string list to be written in a log file.
TesterPSO.java - class which runs the tests and invokes the creation of the log file.
How to use:
Install JAVA JDK.
Compile and run TesterPSO.java along with its required classes in your preferred editor.
Sample log file:
PSO-N4-4.0-1000.txt
Particle Swarm Optimization Algorithm
Parameters
MAX_LENGTH/N: 4
STARTING_POPULATION: 40
MAX_EPOCHS: 1000
MAX_VELOCITY: 4.0
MINIMUM_SHUFFLES: 8
MAXIMUM_SHUFFLES: 20
Run: 1
Runtime in nanoseconds: 38167312
Found at epoch: 1
Population size: 40
. . Q .
Q . . .
. . . Q
. Q . .
. Q . .
. . . Q
Q . . .
. . Q .
. Q . .
. . . Q
Q . . .
. . Q .
Run: 2
Runtime in nanoseconds: 18812173
Found at epoch: 1
Population size: 40
. Q . .
. . . Q
Q . . .
. . Q .
. . Q .
Q . . .
. . . Q
. Q . .
Run: 3
Runtime in nanoseconds: 51481481
Found at epoch: 1
Population size: 40
. Q . .
. . . Q
Q . . .
. . Q .
. Q . .
. . . Q
Q . . .
. . Q .
. Q . .
. . . Q
Q . . .
. . Q .
. Q . .
. . . Q
Q . . .
. . Q .
. Q . .
. . . Q
Q . . .
. . Q .
. . Q .
Q . . .
. . . Q
. Q . .
. . Q .
Q . . .
. . . Q
. Q . .
. Q . .
. . . Q
Q . . .
. . Q .
...
没有合适的资源?快使用搜索试试~ 我知道了~
用于解决 N-Queens 问题的粒子 群优化 (PSO) 算法的 Java 代码
共7个文件
java:4个
gitattributes:1个
txt:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 67 浏览量
2022-06-20
18:44:07
上传
评论
收藏 10KB ZIP 举报
温馨提示
粒子群优化算法 参数 MAX_LENGTH/N: 4 STARTING_POPULATION:40 MAX_EPOCHS:1000 最大速度:4.0 MINIMUM_SHUFFLES:8 MAXIMUM_SHUFFLES:20 运行:1 运行时间(以纳秒为单位):38167312 发现时间:1 人口规模:40 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
JAVA-PSO-master.zip (7个子文件)
JAVA-PSter
README.txt 2KB
ParticleSwarmOptimization.java 10KB
TesterPSO.java 6KB
Writer.java 2KB
Particle.java 4KB
.gitignore 3KB
.gitattributes 483B
共 7 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功