# Isula: A Framework for Ant Colony Algorithms
Isula allows an easy implementation of Ant-Colony Optimization algorithms using the Java Programming Language. It contains the common elements present in the meta-heuristic to allow algorithm designers the reutilization of common behaviors. With Isula, solving optimization problems with Ant Colony can be done in few lines of code.
Isula in Action
---------------
If you are not familiar with the framework, a good place to start is the classic Travelling Salesman Problem:
* The Travelling Salesman Problem, using Ant System: https://github.com/cptanalatriste/aco-tsp
* The Travelling Salesman Problem, using Ant Colony System: https://github.com/cptanalatriste/aco-acs-tsp
Here are some advanced examples of optimization problems solved with Isula-based algorithms:
* The Flow-Shop Scheduling Problem, using Max-Min Ant System: https://github.com/cptanalatriste/aco-flowshop
* Binary Image Segmentation using Ant System: https://github.com/cptanalatriste/aco-image-thresholding
* Image Clustering using Max-Min Ant System: https://github.com/cptanalatriste/aco-image-segmentation
An Isula Primer
---------------
To solve a problem with an Ant-Colony Optimization algorithm, you need a Colony of Agents (a.k.a Ants), a graph representing the problem, and a pheromone data-structure to allow communication between this agents. Isula tries to emulate that pattern:
```java
TspProblemConfiguration configurationProvider = new TspProblemConfiguration(problemRepresentation);
AntColony<Integer, TspEnvironment> colony = getAntColony(configurationProvider);
TspEnvironment environment = new TspEnvironment(problemRepresentation);
AcoProblemSolver<Integer, TspEnvironment> solver = new AcoProblemSolver<>();
solver.initialize(environment, colony, configurationProvider);
solver.addDaemonActions(new StartPheromoneMatrix<Integer, TspEnvironment>(),
new PerformEvaporation<Integer, TspEnvironment>());
solver.addDaemonActions(getPheromoneUpdatePolicy());
solver.getAntColony().addAntPolicies(new RandomNodeSelection<Integer, TspEnvironment>());
solver.solveProblem();
```
That's a snippet from the Travelling Salesman Problem solution. Some things to notice there:
* Problem and algorithm configuration is provided by `ConfigurationProvider` instances. Make your own with the values you need.
* The class that does everything is `AcoProblemSolver`. In this case, we're using the same one provided by the framework but you can extend it to suit your needs.
* The Problem Solver needs an Environment that manages the problem graph and the pheromone matrix. You need to extend the `Environment` class provided with the framework to adjust it to support your problem.
* And we need an Ant Colony, of course. The Ant Colony main responsibility is to create Ants, and make them built solutions in iterations. The robust base `AntColony` class makes implementing this very easy.
* The hearth of the algorithm is the `Ant` class. You will need to define an Ant that suits your needs.
* Isula supports daemon actions -global behaviors- and ant-level policies, such as the ones present in multiple ACO Algorithms. You can add daemon actions to a solver via the `addDaemonActions` method and ant policies to a colony via the `addAntPolicies` method.
* Finaly, you call the `solveProblem()` method and wait for the best solution to be shown.
Isula internals
------------------
Here is a sequence diagram of the `solveProblem()` method, for you to get an idea on how isula works:
![Alt text](https://github.com/cptanalatriste/isula/blob/master/resources/ACO_metaheuristic.png?raw=true "Title")
Isula will provide you the basic execution flow for an algorithm in the ACO metaheuristic. On a common use case, you can rely on the implementations already available for `AcoProblemSolver` and `AntColony` but you are free to override and extend in case you need it. Take in mind that usually you will need to create your own `Ant` instance according to your project needs, however the base implementation already contains a lot of functionality available. If you need some reference, please take a look to the projects on the "Isula in action" section.
Every ACO algorithm has a set of customized behaviours that are executed during the solution processes: this behaviours can have global impact (`DaemonAction` instances, like pheromone update rules) or only affect an ant and its solution (like component selection rules: they are subclasses of `AntPolicy`). Isula already provides this behaviours for some representative algorithms -take a look at the `isula.aco.algorithms` package- but you might be in the need of defining your own policies or extending the ones already available.
Read abour Isula
---------------
The Javadoc of every class on the framework is available here: http://cptanalatriste.github.io/isula/doc/
Also, in this article Ant Colony Optimization algorithms are discussed and Isula is used to implement them in the Java Programming Language: http://www.codeproject.com/Articles/1011148/A-Java-Primer-of-Ant-Colony-Algorithms
How to use this code
--------------------
The code uploaded to this GitHub Repository corresponds to a Maven Java Project. As such, it is strongly recommended that you have Maven installed before working with Isula.
After downloading - or cloning – the Isula code, just execute `mvn install` at the Isula folder to add it to your local repository. Once the Isula Project is installed in your Maven repository, you can use it as a dependency on your personal Ant Colony Optimization project by adding:
```xml
<dependencies>
<dependency>
<groupId>isula</groupId>
<artifactId>isula</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
```
To your project `pom.xml` file. Or if you prefer, you can generate a JAR file of the framework if it is more convenient for you and use your IDE support for external libraries.
Questions, issues or support?
----------------------------
Feel free to contact me at carlos.gavidia@pucp.edu.pe.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ACO.rar (96个子文件)
ACO
DataMining
myra-3.7.jar 750KB
gui_antminer1.2.1.jar 77KB
AntMiner+ v1.0.rar 39KB
CarSequencingProblem
AntCar.tgz 5KB
ACO_JavaFramework
cptanalatriste-isula-v1.0-40-g18c1324.zip 89KB
cptanalatriste-isula-18c1324
.gitignore 494B
.project 755B
README.md 6KB
pom.xml 1KB
bin
.gitignore 7B
resources
ACO_metaheuristic.png 59KB
test
isula
aco
AntColonyTest.java 3KB
AntTest.java 3KB
test
DummyFactory.java 3KB
EnvironmentTest.java 3KB
.settings
org.eclipse.jdt.core.prefs 723B
src
isula
image
util
ImageSegment.java 1KB
ImagePixel.java 4KB
ClusteredPixel.java 4KB
package-info.java 86B
ImageFileHelper.java 12KB
ImageComparator.java 4KB
aco
algorithms
maxmin
UpdatePheromoneMatrixForMaxMin.java 6KB
MaxMinConfigurationProvider.java 357B
package-info.java 108B
StartPheromoneMatrixForMaxMin.java 952B
antsystem
RandomNodeSelection.java 6KB
PerformEvaporation.java 1KB
OfflinePheromoneUpdate.java 2KB
OnlinePheromoneUpdate.java 2KB
package-info.java 103B
StartPheromoneMatrix.java 2KB
acs
AcsConfigurationProvider.java 311B
PseudoRandomNodeSelection.java 4KB
package-info.java 104B
exception
MethodNotImplementedException.java 291B
SolutionConstructionException.java 385B
package-info.java 114B
ConfigurationException.java 386B
InvalidInputException.java 291B
DaemonActionType.java 344B
AntColony.java 5KB
AntPolicyType.java 444B
package-info.java 128B
AcoProblemSolver.java 7KB
Ant.java 10KB
Environment.java 4KB
ConfigurationProvider.java 1KB
DaemonAction.java 2KB
AntPolicy.java 1KB
.classpath 1005B
ConstraintSatisfactionProblem
AntSolver.tgz 20KB
Note.txt 175B
TSP
acopt.zip 28KB
ACOTSPJava-1.0.3-1.0.1
commons-cli-1.2.LICENSE.txt 11KB
tsp
lin318.tsp 4KB
rat783.tsp 10KB
pcb1173.tsp 32KB
pr2392.tsp 67KB
att532.tsp 7KB
pcb442.tsp 12KB
d198.tsp 5KB
d1291.tsp 36KB
kroA100.tsp 1KB
eil51.tsp 579B
ACOTSPJava.jar 44KB
commons-cli-1.2.NOTICE.txt 172B
commons-cli-1.2.jar 40KB
ACOTSPJava-1.0.3-1.0.1.zip 138KB
README.txt 2KB
LICENSE.txt 18KB
ACOTSP-1.03.README.txt 11KB
ACOTSPJava-1.0.3-1.0.1_Source
ACOTSPJava-1.0.3-1.0.1
.gitignore 686B
README.md 838B
tsp
lin318.tsp 4KB
rat783.tsp 10KB
pcb1173.tsp 32KB
pr2392.tsp 67KB
att532.tsp 7KB
pcb442.tsp 12KB
d198.tsp 5KB
d1291.tsp 36KB
kroA100.tsp 1KB
eil51.tsp 579B
LICENSE 18KB
src
de
adrianwilke
acotspjava
test
Test.java 1KB
Ants.java 27KB
Timer.java 3KB
Utilities.java 9KB
AcoTsp.java 20KB
InOut.java 27KB
Parse.java 12KB
Tsp.java 9KB
LocalSearch.java 38KB
MANIFEST.MF 102B
ACOTSPJava-1.0.3-1.0.1_Source.zip 87KB
共 96 条
- 1
资源评论
- 振哥在,世界充满爱!2017-02-23你好,有代码相关文档吗?或者车辆的调度相关文档吗?麻烦你分享一下。
koolboy2016
- 粉丝: 2
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功