| JSimul is a JAVA-based simulated annealing package consisting of three layers: |
| 1. A SWING-based user interface that provides intuitive access to the tuning of the algorithm's parameters. |
| 2. A simulated annealing algorithm coupled with a downhill simplex, essentially a JAVA object wrapper around two Numerical Recipes algorithms (1) (ameba & amotsa). The driver is largely inspired from the example book(2) and I've added a clustering scheme to test for convergence. |
| 3. Examples of a third layer (ie: test objective functions to minimize) are provided with the release. Refer to the directory structure section for their location. Presently, this third layer must be written in JAVA. Adding the flexibility of connecting the package to native C or Fortran code through JNI is high on the TODO list. |
Follow this link to a detailed description of the Numerical Recipes algorithm.
Installation
To install JSimul, you need the jdk
(ie: JAVA), as well as ant
(an xml-based build tool to compile and run the code).
and run the binary:
./j2sdk-{version}.bin
The JDK will extract under its own directory (named j2sdk-{version})
To make versioning easier, create a symlink:
ln -s j2sdk-{version} jdk
set the following environment variable in your .tcshrc (or .cshrc or whatever)
setenv JAVA_HOME /usr/local/java/jdk
./jakarta-ant-{version}-bin
You may also want to create a symlink to the ant directory:
ln -s ./jakarta-ant-{version} ant
The following sets up the environment:
setenv ANT_HOME /usr/local/java/ant
Finally, adding the following to your path will allow you to call ant and java
from anywhere on your system:
setenv PATH $PATH/:$JAVA_HOME/bin/:$ANT_HOME/bin/:
Extract the source code:
jar xvf JSimul-{build}.jar
Create a classes directory in $HOME/dev/classes/JSimul (this is where the compiled JAVA bytecode
will go)
mkdir $HOME/dev/classes/JSimul
and add the following line to your .tcshrc
setenv CLASSPATH $CLASSPATH:$HOME/dev/classes/JSimul
Compile the source code:
cd $HOME/dev/src/JSimul/org/theblueplanet
ant -buildfile buildJSimul.xml build
Launching JSimul
The easiest way is to create an alias - (make sure that the CLASSPATH is set
in the .tcshrc):
alias JSimul java org.theblueplanet.annealing.ui.UILauncher
and to launch with:
JSimul
or if you enjoy typing:
java org.theblueplanet.annealing.ui.UILauncher
Launching can also be done through an ant call:
cd $HOME/src/org/theblueplanet
ant -buildfile buildJSimul.xml JSimul-run
Using JSimul
Logging to file
Yes, append - append results to ~/JSimul.log. Do not overwrite the former log file
Yes, overwrite - overwrite results to ~/JSimul.log. Contents of the former log file are lost
No - Do not append to log file
The slider allows to set the number of iterations after which logging to file and console
occurs. It is disabled when logging is unselected. Range: 1-1000.
Annealing scheme selector (right-handside)
Temperature selector : the temperature at which to start the annealing
(log10 scale). Range: 1 - 109 K
Cooling rate selector: the cooling rate applied. Range: 0-100 %
Number of iterations selector: the number of iterations after which cooling is applied. Range: 0-100
Fractional tolerance selector: sets the convergence criterion for the
cluster of solutions (log10 scale).
A low value corresponds to low tolerance (ie: convergence is slow).
Range: 10-20 - 0.1
The values chosen with the sliders are simultaneously updated in the summary panel at the bottom of the screen.
Directory structure
Extracting the JSimul package will create 4 directories: