You are here: start » solenopsis

Back

Solenopsis

Solenopsis is a platform for the development and deployment of distributed (ant-based) algorithms.

Download

Java source code: SolenopsisII_20100728.tar.gz (Rev. 20100728)

License: GPL3

Requirements: Java JRE 6

Publications

Brocco, Amos, Hirsbrunner, Béat and Courant, Michèle, Solenopsis: A Framework for the Development of Ant Algorithms, in: Swarm Intelligence Symposium, pages 316-323, IEEE, SIS, Honolulu, Hawaii, April, 2007.

<html>

<h2>Ping Pong Ant</h2>

In this example two nodes are created and executed. The first node, <tt>alpha</tt>, sends an ant of type <tt>pingant</tt> to the second node, <tt>beta</tt>. On each node, the ant prints a message.

<h3>Node initialization</h3>

Nodes are initialized by means of a script, that is passed upon execution, i.e. : <pre>java shell.Shell –script [scriptfile]</pre>

The script file for node <tt>alpha</tt>, saved as <a href=“examples/pingpong/alpha.dlisp”><tt>alpha.dlisp</tt></a> is as follows:

<pre> (platform::init {

"codepath" : "path where the ant code is found",
"port"	   : 56335 })

(var d (platform::addDaemon “alpha”))

(platform::call d

"ants::new" 
"pingpong.ant" { "$target" : "bebop://localhost:56336/beta" })

(platform::run) </pre>

The call to the <tt>platform::init</tt> function initializes the execution platform. The dictionary parameter is used to define some options like the <tt>codepath</tt>, which sets the path where the ant code is to be found, and <tt>port</tt>, which defines the listening port for the platform's mail server (where incoming ant are received). <br/><br/> By means of the <tt>platform::addDaemon</tt> function a node is created on the network. The node is assigned a name (<tt>alpha</tt> in this case), and the function returns the full address of the node (which has the form <tt>bebop:localhost:56335/alpha</tt>). Subsequently, <tt>platform::call</tt> is used to invoke the function <tt>ants::new</tt> on the previously created node, so that an ant of type <tt>pingpong.ant</tt> is instantiated on it. The last parameter, a dictionary, is used to define variables inside the ant: in this example the <tt>$target</tt> variable is assigned the address of the <tt>beta</tt> node. <br/><br/> Finally, calling the <tt>platform::run</tt> function results in the execution of nodes. <br/><br/> The script file for node <tt>beta</tt>, saved as <a href=“examples/pingpong/beta.dlisp”><tt>beta.dlisp</tt></a>, is as follows: <pre> (platform::init { “codepath” : “path where the ant code is found”, “port” : 56336 }) (var d (platform::addDaemon “beta”)) (platform::run) </pre> The code for the ant itself, saved as <a href=“examples/pingpong/pingpong.ant”><tt>pingpong.ant</tt></a>, is: <pre> (virtual $target) (while 1 (begin (var source (migrate $target)) (print “Hello beta!”) (migrate source) (print “Hello alpha!”))) </pre> To run the example do:<br/> <pre> java shell.Shell –script beta.dlisp java shell.Shell –script alpha.dlisp </pre> <h2>Towers of hanoi</h2> (TODO) <h2>Bl&#0229;tAnt-S</h2> (TODO) </html>

solenopsis.txt · Last modified: 2024/05/27 12:21 by 127.0.0.1
Kleine Websites, die ein Wiki als CMS verwenden.de